all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@easy-emacs.de>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: outline-regexp
Date: Thu, 07 Dec 2006 14:44:37 +0100	[thread overview]
Message-ID: <45781AC5.5000705@easy-emacs.de> (raw)
In-Reply-To: <E1Grxgc-0007tf-3v@fencepost.gnu.org>

Richard Stallman schrieb:
> The most useful way to specify outline-regexp is with a file local
> variable. That is much more useful that customizing its default
> value.
>
> I think it is useful for that variable to show up in a custom buffer,
> since it is meant to be set by the user.  But we don't want the user
> to actually customize it; instead, when it appears in a custom buffer,
> it should say you should specify this with a file local variable.
>
> Is there an easy way to do that?
>

A first easy and helpful step could be to check in some
documentation mentioning the issue:

*** /usr/local/share/emacs/22.0.50/lisp/outline.el    2006-05-11 
17:01:41.000000000 +0200
--- /home/speck/progarbeit/emacs/veraendert/outline.el    2006-12-07 
13:49:38.000000000 +0100
***************
*** 48,53 ****
--- 48,57 ----
  (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

;;;;;;;;;;

Beside this:

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

It should be possible to

- use the mode-value (default)

- use the global-value be setting a boolean `use-mode-value' to nil.

- customize both.

Changed lisp-mode.el respectively, patch below.

GNU Emacs 22.0.90.1 (i686-pc-linux-gnu, X toolkit,
Xaw3d scroll bars) of 2006-10-28:

diff -c /home/speck/emacs/lisp/emacs-lisp/lisp-mode.el 
/home/speck/progarbeit/emacs/veraendert/lisp-mode.el
*** /home/speck/emacs/lisp/emacs-lisp/lisp-mode.el    2006-07-05 
09:47:41.000000000 +0200
--- /home/speck/progarbeit/emacs/veraendert/lisp-mode.el    2006-12-07 
14:06:54.000000000 +0100
***************
*** 30,35 ****
--- 30,57 ----
 
  ;;; Code:
 
+
+
+ (defcustom outline-use-mode-regexp  t
+  "If outline should use mode-specific customization.
+ If nil, global value of outline-regexp is used"
+
+ :type 'boolean
+ :group 'outlines)
+
+ (defcustom outline-emacs-lisp-regexp ";;;\\(;* [^ 
\t\n]\\|###autoload\\)\\|("
+   "Regular expression to match the beginning of a heading.
+ Any line whose beginning matches this regexp is considered to start a 
heading.
+ 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
+ in the file it applies to.  See also `outline-heading-end-regexp'."
+   :type '(regexp (const nil))
+   :group 'outlines)
+
+ (when outline-use-mode-regexp
+     (setq outline-regexp (eval outline-emacs-lisp-regexp)))
+
  (defvar font-lock-comment-face)
  (defvar font-lock-doc-face)
  (defvar font-lock-keywords-case-fold-search)
***************
*** 216,223 ****
    (setq indent-region-function 'lisp-indent-region)
    (make-local-variable 'parse-sexp-ignore-comments)
    (setq parse-sexp-ignore-comments t)
-   (make-local-variable 'outline-regexp)
-   (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
    (make-local-variable 'outline-level)
    (setq outline-level 'lisp-outline-level)
    (make-local-variable 'comment-start)
--- 238,243 ---

Regards
__
Andreas Roehler

  reply	other threads:[~2006-12-07 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 13:38 outline-regexp Andreas Roehler
2006-12-04 15:04 ` outline-regexp Stefan Monnier
2006-12-04 15:54   ` outline-regexp Andreas Roehler
2006-12-05  5:09   ` outline-regexp Richard Stallman
2006-12-06 14:23 ` outline-regexp Richard Stallman
2006-12-07 13:44   ` Andreas Roehler [this message]
2006-12-07 14:17     ` outline-regexp Stefan Monnier
2006-12-09  6:01     ` outline-regexp Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45781AC5.5000705@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.