From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: patch to outline.el concerning isearch Date: Sat, 16 Dec 2006 02:03:21 +0100 Message-ID: References: <87bqm7yvyw.fsf@earthlink.net> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1166231024 3964 80.91.229.10 (16 Dec 2006 01:03:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Dec 2006 01:03:44 +0000 (UTC) Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 16 02:03:42 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GvNxk-0001oX-LX for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2006 02:03:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvNxk-0007QW-Ac for ged-emacs-devel@m.gmane.org; Fri, 15 Dec 2006 20:03:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GvNxX-0007QL-Sm for emacs-devel@gnu.org; Fri, 15 Dec 2006 20:03:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GvNxX-0007Pd-1X for emacs-devel@gnu.org; Fri, 15 Dec 2006 20:03:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvNxW-0007PH-Qa; Fri, 15 Dec 2006 20:03:26 -0500 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GvNxW-0005g2-7U; Fri, 15 Dec 2006 20:03:26 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx19.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id CAEAC8A0026; Sat, 16 Dec 2006 02:03:24 +0100 (CET) Original-To: John J Foerch In-Reply-To: <87bqm7yvyw.fsf@earthlink.net> (John J. Foerch's message of "Wed\, 13 Dec 2006 22\:53\:11 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (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:63813 gmane.emacs.orgmode:973 Archived-At: John J Foerch writes: > Hello, > > I want to implement a particular feature in org-mode that depends upon some > functionality being added to outline-mode. (org-mode is derived from > outline-mode.) The feature concerns display of ancestor and sibling headings > when an isearch has come to successful completion in a hidden part of the > file. The function whose job it is to decide what to display when an isearch > has completed is called `outline-isearch-open-invisible'. Currently, it > simply calls `(show-entry)'. The following patch changes that function, and > adds a new variable, to allow derived modes or motivated users to implement > alternate behavior. The default behavior remains the same, but can more > easily be reprogrammed by a derived mode. Hi John, Your request seems reasonable, but I think your proposed change is a little more complex than necessary. Does the following patch provide what you need? *** outline.el 04 Dec 2006 09:41:09 +0100 1.24 --- outline.el 16 Dec 2006 02:00:21 +0100 *************** *** 690,695 **** --- 690,700 ---- (goto-char beg))) + (defvar outline-isearch-open-invisible-function nil + "Function called if `isearch' finishes in an invisible overlay. + The function is called with the overlay as its only argument. + If nil, `show-entry' is called to reveal the invisible text.") + (put 'outline 'reveal-toggle-invisible 'outline-reveal-toggle-invisible) (defun outline-flag-region (from to flag) "Hide or show lines from FROM to TO, according to FLAG. *************** *** 698,704 **** (when flag (let ((o (make-overlay from to))) (overlay-put o 'invisible 'outline) ! (overlay-put o 'isearch-open-invisible 'outline-isearch-open-invisible))) ;; Seems only used by lazy-lock. I.e. obsolete. (run-hooks 'outline-view-change-hook)) --- 703,711 ---- (when flag (let ((o (make-overlay from to))) (overlay-put o 'invisible 'outline) ! (overlay-put o 'isearch-open-invisible ! (or outline-isearch-open-invisible-function ! 'outline-isearch-open-invisible)))) ;; Seems only used by lazy-lock. I.e. obsolete. (run-hooks 'outline-view-change-hook)) -- Kim F. Storm http://www.cua.dk