From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Strange behavior of emacs-lisp-mode with outline-minor-mode Date: Sun, 05 Mar 2006 23:49:54 -0500 Message-ID: <87wtf8ky2r.fsf-monnier+emacs@gnu.org> References: <87oe0kmjbg.fsf-monnier+emacs@gnu.org> <87d5h0p9xi.fsf@emacsfans.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1141620626 11282 80.91.229.2 (6 Mar 2006 04:50:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Mar 2006 04:50:26 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 06 05:50:24 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FG7fo-0005r3-8A for ged-emacs-devel@m.gmane.org; Mon, 06 Mar 2006 05:50:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FG7fw-0001yE-OW for ged-emacs-devel@m.gmane.org; Sun, 05 Mar 2006 23:50:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FG7fh-0001Uw-SK for emacs-devel@gnu.org; Sun, 05 Mar 2006 23:50:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FG7fe-0001MJ-4N for emacs-devel@gnu.org; Sun, 05 Mar 2006 23:50:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FG7fe-0001MF-0e for emacs-devel@gnu.org; Sun, 05 Mar 2006 23:50:10 -0500 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FG7hj-0006He-OW; Sun, 05 Mar 2006 23:52:20 -0500 Original-Received: from alfajor ([70.48.80.201]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060306044954.MFAK18394.tomts5-srv.bellnexxia.net@alfajor>; Sun, 5 Mar 2006 23:49:54 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 5851DD7304; Sun, 5 Mar 2006 23:49:54 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: <87d5h0p9xi.fsf@emacsfans.org> (Zhang Wei's message of "Mon, 06 Mar 2006 10:46:17 +0800") 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 Xref: news.gmane.org gmane.emacs.devel:51273 Archived-At: >> This means that >> >> ;;; Foo: >> >> gets level 1 and that >> >> (defun ...) >> >> also gets level 1. This is wrong. > Then what is right? Something else where the level of "(" is higher than for ";;; ". > Gets level 1000 is right? For example. > The problem is there's no level 1 in lisp-mode with outline-minor. Actually, I think the problem is that outline doesn't really define what levels mean. At least various major modes use different values. For most cases outline doesn't care about absolute values of levels but only relative ones. C-x @ C-q is the only counter example I've bumped into (there are probably others, tho). I think the expectation was that the user provide an explicit numeric argument when using it, rather than rely on the default. >> The motivation for this change was: >> >>> If we turn on outline-minor-mode in emacs-lisp-mode, and press >>> `C-c @ C-q', only three dots there, nothing left! >> >> I don't see this behavior. Please give a precise recipe. > 1, emacs -q > 2, C-x C-f emacs-source/lisp/ido.el > 3, C-c @ C-q Oops, sorry, yes I see it now. It turns out I've been using the patch below for so long that I completely forgot about it. I've just installed it. Stefan --- orig/lisp/outline.el +++ mod/lisp/outline.el @@ -828,7 +829,13 @@ (defun hide-sublevels (levels) "Hide everything but the top LEVELS levels of headers, in whole buffer." - (interactive "p") + (interactive (list + (cond + (current-prefix-arg (prefix-numeric-value current-prefix-arg)) + ((save-excursion (beginning-of-line) + (looking-at outline-regexp)) + (funcall outline-level)) + (t 1)))) (if (< levels 1) (error "Must keep at least one level of headers")) (let (outline-view-change-hook)