[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: octave-mod.el: wrong indentation for "IF", "FOR", et

From: Glenn Morris
Subject: Re: address@hidden: octave-mod.el: wrong indentation for "IF", "FOR", etc.]
Date: Thu, 11 Oct 2007 21:23:08 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

"John W. Eaton" wrote:

> 2007-10-10  John W. Eaton  <address@hidden>
>       * progmodes/octave-mod.el (octave-looking-at-kw,
>       octave-re-search-forward-kw, octave-re-search-backward-kw):
>       New functions.

Why so complicated - why not just let-bind case-fold search in the
functions that need it?

> +(defun octave-re-search-forward-kw (regexp)
> +  (let ((case-fold-search nil))
> +    (re-search-forward regexp nil 'move inc)))
> +
> +(defun octave-re-search-backward-kw (regexp)
> +  (let ((case-fold-search nil))
> +    (re-search-backward regexp nil 'move inc)))

It seems ugly to (ab)use the variable `inc' in this way. If you do
want to do it this way, wouldn't it be nicer to use something like:

(defun octave-re-search-forward (regexp &optional bound noerror count)
  "Like `re-search-forward', but sets `case-fold-search' nil."
  (let (case-fold-search)
     (re-search-forward regexp bound noerror count)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]