From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: lisp-outline-level. Date: Sun, 13 Feb 2005 18:06:38 +0100 Message-ID: <873bw0e6e9.fsf@xs4all.nl> References: <87ekfke9hk.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1108315013 10684 80.91.229.2 (13 Feb 2005 17:16:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Feb 2005 17:16:53 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 13 18:16:52 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D0NMO-0004SB-Sj for ged-emacs-devel@m.gmane.org; Sun, 13 Feb 2005 18:16:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D0Nbl-0002u4-VS for ged-emacs-devel@m.gmane.org; Sun, 13 Feb 2005 12:32:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D0NTk-00074Y-CI for emacs-devel@gnu.org; Sun, 13 Feb 2005 12:24:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D0NTa-0006zl-3S for emacs-devel@gnu.org; Sun, 13 Feb 2005 12:24:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D0NTY-0006uX-Hn for emacs-devel@gnu.org; Sun, 13 Feb 2005 12:24:04 -0500 Original-Received: from [194.109.24.31] (helo=smtp-vbr11.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D0N5W-0002hn-1v; Sun, 13 Feb 2005 11:59:14 -0500 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr11.xs4all.nl (8.12.11/8.12.11) with ESMTP id j1DGxDkq016696; Sun, 13 Feb 2005 17:59:13 +0100 (CET) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1D0NCg-0000Ra-00; Sun, 13 Feb 2005 18:06:38 +0100 Original-To: David Kastrup In-Reply-To: (David Kastrup's message of "Sun, 13 Feb 2005 17:37:04 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 66 X-Virus-Scanned: by XS4ALL Virus Scanner 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33346 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33346 David Kastrup writes: > Lute Kamstra writes: > >> In (Emacs) Lisp mode, outline-regexp is ";;;;* [^ \t\n]\\|(" and >> outline-level is lisp-outline-level: >> >> (defun lisp-outline-level () >> "Lisp mode `outline-level' function." >> (if (looking-at "(\\|;;;###autoload") >> 1000 >> (looking-at outline-regexp) >> (- (match-end 0) (match-beginning 0)))) >> >> This is a bit strange as outline-regexp doesn't match >> ";;;###autoload". > > Why is that strange? outline-regexp is not even consulted when > ;###autoload is found, so I don't see how it would come into play > here. > >> Shall I commit the patch below? > >> *** lisp/emacs-lisp/lisp-mode.el 1 Feb 2005 15:48:50 -0000 1.171 >> --- lisp/emacs-lisp/lisp-mode.el 13 Feb 2005 11:03:02 -0000 >> *************** >> *** 212,223 **** >> >> (defun lisp-outline-level () >> "Lisp mode `outline-level' function." >> ! (if (looking-at "(\\|;;;###autoload") >> 1000 >> - (looking-at outline-regexp) >> (- (match-end 0) (match-beginning 0)))) >> >> - >> --- 212,221 ---- >> >> (defun lisp-outline-level () >> "Lisp mode `outline-level' function." >> ! (if (eq (following-char) ?\() >> 1000 >> (- (match-end 0) (match-beginning 0)))) > > The patch is completely nonsensical. It returns rubbish in almost all > cases since it is the "looking-at" that established match-end and > match-beginning in the first place. The variables outline-regexp and outline-level are used by Outline minor mode. Did you take a look at their docstrings? Outline minor mode searches for matches of outline-regexp and at each match the function in outline-level is called to determine the nesting level: ,----[ C-h v outline-level RET ] | outline-level's value is outline-level | | *Function of no args to compute a header's nesting level in an outline. | It can assume point is at the beginning of a header line and that the match | data reflects the `outline-regexp'. | | Defined in `outline'. `---- Does my patch make more sense now? Lute.