From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Roehler Newsgroups: gmane.emacs.devel Subject: Re: outline-regexp Date: Thu, 07 Dec 2006 14:44:37 +0100 Message-ID: <45781AC5.5000705@easy-emacs.de> References: <457424E9.2060107@easy-emacs.de> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165499075 19592 80.91.229.10 (7 Dec 2006 13:44:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Dec 2006 13:44:35 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 07 14:44:32 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GsJY5-00089K-Qe for ged-emacs-devel@m.gmane.org; Thu, 07 Dec 2006 14:44:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GsJY5-0008BP-Ce for ged-emacs-devel@m.gmane.org; Thu, 07 Dec 2006 08:44:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GsJVR-0006tD-Rt for emacs-devel@gnu.org; Thu, 07 Dec 2006 08:41:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GsJVP-0006sE-NA for emacs-devel@gnu.org; Thu, 07 Dec 2006 08:41:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GsJVP-0006sA-HV for emacs-devel@gnu.org; Thu, 07 Dec 2006 08:41:43 -0500 Original-Received: from [212.227.126.188] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GsJVL-0001cb-CU; Thu, 07 Dec 2006 08:41:39 -0500 Original-Received: from [84.190.139.52] (helo=[192.168.178.25]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1GsJVI1LON-0000qs; Thu, 07 Dec 2006 14:41:37 +0100 User-Agent: Thunderbird 1.5.0.4 (X11/20060516) Original-To: rms@gnu.org In-Reply-To: X-Provags-ID: kundenserver.de abuse@kundenserver.de login:62d13292e0fce6aaed56aaadcb96352d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63413 Archived-At: 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