emacs-devel
[Top][All Lists]
Advanced

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

Re: outline-regexp


From: Stefan Monnier
Subject: Re: outline-regexp
Date: Thu, 07 Dec 2006 09:17:17 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

>  (defcustom outline-regexp "[*\^L]+"
>    "Regular expression to match the beginning of a heading.
>  Any line whose beginning matches this regexp is considered to start
> a heading.
> +
> + If the global value isn't into effect, probably it's set by the mode.
> + See lisp-mode.el for example how this is done.
> +
>  Note that Outline mode only checks this regexp at the start of a line,
>  so the regexp need not (and usually does not) start with `^'.
>  The recommended way to set this is with a Local Variables: list

If the user sees this text via C-h v it will also give both the global and
the buffer-local value, thus making it fairly obvious what's going on.

Maybe `custom' should do similar: e.g. check whether the variable is locally
changed in some buffers and if so add a little blurb about the global
setting not taking effect in those buffers.

> Why not let `outline-regexp' go with the mode, although not through a
> function as it's done now, but with defcustom.

Heavy, clunky, inconvenient.

Just set the variable in your file-local block and be done with it.

Or if you want to change the setting in all emacs-lisp-mode buffers, then do
it the normal way:

   (add-hook 'emacs-lisp-mode-hook
             (lambda () (setq outline-regexp "my favorite setting")))


-- Stefan




reply via email to

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