From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.bugs Subject: Function `lisp-outline-level' in `emacs-lisp/lisp-mode.el'. Date: 10 Jul 2002 20:12:14 +0200 Organization: CWI Sender: bug-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1026324747 1798 127.0.0.1 (10 Jul 2002 18:12:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2002 18:12:27 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17SLwx-0000St-00 for ; Wed, 10 Jul 2002 20:12:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17SLxf-0004aI-00; Wed, 10 Jul 2002 14:13:11 -0400 Original-Received: from hera.cwi.nl ([192.16.191.8]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17SLwl-0004TO-00 for ; Wed, 10 Jul 2002 14:12:15 -0400 Original-Received: from occarina.pna.cwi.nl (occarina.pna.cwi.nl [192.16.184.200]) by hera.cwi.nl with ESMTP id UAA08454 for ; Wed, 10 Jul 2002 20:12:14 +0200 (MEST) Original-Received: (from lute@localhost) by occarina.pna.cwi.nl (8.11.6/8.9.3) id g6AICEv15161; Wed, 10 Jul 2002 20:12:14 +0200 X-Authentication-Warning: occarina.pna.cwi.nl: lute set sender to Lute.Kamstra@cwi.nl using -f Original-To: bug-gnu-emacs@gnu.org User-Agent: Gnus 5.9 on Emacs 21.2 Original-Lines: 55 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2600 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2600 Dear People, I've been working on a substitute of the outline minor mode, so I studied the implementation of this minor mode and its interaction with some major modes. In `emacs-lisp/lisp-mode.el' (Emacs 21.2), `outline-regexp' and `outline-level' are set as follows: (setq outline-regexp ";;;;* \\|(") (setq outline-level 'lisp-outline-level) The function `lisp-outline-level' is defined as: (defun lisp-outline-level () "Lisp mode `outline-level' function." (if (looking-at "(") 1000 (looking-at outline-regexp) (- (match-end 0) (match-beginning 0)))) I'm a bit surprised by this. It means that comments starting with four semi-colons are less important then comments starting with three. This is counter-intuitive to me. I don't know if there are people that have a coding style that involves comments that start with more than three semi-colons, but I doubt that they would deem such comments subordinate to comments starting with three. The following definition of `lisp-outline-level' would fix this problem: (defun lisp-outline-level () "Lisp mode `outline-level' function." (if (looking-at "(") 1000 (looking-at outline-regexp) (- 100 (- (match-end 0) (match-beginning 0))))) However, I do not like the fact that the number returned by the function does not accurately reflect the level of the header in the sense that the most important headers in a buffer are not assigned 1 and that there is a large gap in the range of the function. I would prefer to give all comments starting with three or more semi-colons the same level number an define `lisp-outline-level' like: (defun lisp-outline-level () "Lisp mode `outline-level' function." (if (looking-at "(") 2 1)) Regards, Lute Kamstra. -- Lute Kamstra CWI department PNA4 Room M233 phone (+31) 20 592 4214