From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: [reveal-mode] Hiding short expressions Date: 03 Jul 2004 13:01:43 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1088874136 29242 80.91.224.253 (3 Jul 2004 17:02:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Jul 2004 17:02:16 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Jul 03 19:02:09 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bgntx-00036K-00 for ; Sat, 03 Jul 2004 19:02:09 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bgntx-0001dI-00 for ; Sat, 03 Jul 2004 19:02:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bgnvp-0002Qm-7Q for emacs-devel@quimby.gnus.org; Sat, 03 Jul 2004 13:04:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bgnvl-0002Oa-Lf for emacs-devel@gnu.org; Sat, 03 Jul 2004 13:04:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bgnvj-0002Nx-WB for emacs-devel@gnu.org; Sat, 03 Jul 2004 13:04:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bgnvj-0002Nn-Pa for emacs-devel@gnu.org; Sat, 03 Jul 2004 13:03:59 -0400 Original-Received: from [206.47.199.163] (helo=simmts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BgntY-0003B2-FO for emacs-devel@gnu.org; Sat, 03 Jul 2004 13:01:44 -0400 Original-Received: from empanada.local ([67.68.217.206]) by simmts5-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20040703170110.DQDG3387.simmts5-srv.bellnexxia.net@empanada.local>; Sat, 3 Jul 2004 13:01:10 -0400 Original-Received: by empanada.local (Postfix, from userid 502) id A37A4240AFE; Sat, 3 Jul 2004 13:01:43 -0400 (EDT) Original-To: emacs-devel@gnu.org In-Reply-To: Original-Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25411 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25411 >> The behavior you seem to want is actually simpler than the current >> behavior (in other words, I first implemented the behavior you want and >> then added code to keep the overlays open even after the cursor moves out >> of the overlay), and it should be easy to change the code such that you can >> choose between different behaviors. > One could add a variable which lets you choose what behavior is used. > But if you wanted to use outline-minor-mode and hiding of footnotes at > the same time in a latex-mode or LaTeX-mode buffer, it would probably > be better to choose the behavior depending on a special attribute of > the overlays. This could be done e.g. by adding a 'reveal-close > attribute to the 'category property of the overlay: Indeed, I think it should be decided on an overlay basis rather than for the whole buffer. But I don't like forcing an indirection through `category', so I'd just do (overlay-get ol 'reveal-close) which also obeys the `category' prop if present. Also I expect that a heuristic such as "is there a linefeed within the overlay" would provide a pretty good starting point without needing any extra tag on the overlays. The rationale for it is that the behavior that "keeps overlay opened when point is on same line" is mostly useful to allow the user to use C-p and C-n without spuriously closing the overlay because the C-p jumps to just a bit before the beginning. At least that was my experience when working on it. Stefan