From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: lisp-outline-level. Date: Sun, 13 Feb 2005 18:48:52 +0100 Message-ID: References: <87ekfke9hk.fsf@xs4all.nl> <87zmy82ydu.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1108317045 16376 80.91.229.2 (13 Feb 2005 17:50:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Feb 2005 17:50:45 +0000 (UTC) Cc: Lute Kamstra , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 13 18:50:44 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D0NtG-0001GI-Ue for ged-emacs-devel@m.gmane.org; Sun, 13 Feb 2005 18:50:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D0O8e-00079t-Fh for ged-emacs-devel@m.gmane.org; Sun, 13 Feb 2005 13:06:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D0O6t-0006SP-EB for emacs-devel@gnu.org; Sun, 13 Feb 2005 13:04:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D0O6p-0006Qo-Kl for emacs-devel@gnu.org; Sun, 13 Feb 2005 13:04:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D0O6p-0006P4-4w for emacs-devel@gnu.org; Sun, 13 Feb 2005 13:04:39 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D0NrX-0005fE-9R for emacs-devel@gnu.org; Sun, 13 Feb 2005 12:48:51 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1D0Nnc-0002B8-He; Sun, 13 Feb 2005 12:44:49 -0500 Original-To: Stefan Monnier In-Reply-To: <87zmy82ydu.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 13 Feb 2005 11:56:26 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:33348 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33348 Stefan Monnier writes: >> (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". Shall I commit the patch below? > > Why did you assume that the ;;;###autoload thingy got there by mistake? > Wouldn't it be better to fix outline-regexp? Anyway, I find the original butt-ugly and inefficient. Wouldn't it be better to write (defun lisp-outline-level () "Lisp mode `outline-level' function." (if (save-match-data (looking-at "(\\|;;;###autoload"))) 1000 (- (match-end 0) (match-beginning 0)))) or even (if preservation of match data is definitely not required) (defun lisp-outline-level (let ((len (- (match-end 0) (match-beginning 0)))) (if (looking-at ...) 1000 len))) -- David Kastrup, Kriemhildstr. 15, 44793 Bochum