emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
To: John J Foerch <jjfoerch@earthlink.net>
Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org
Subject: Re: patch to outline.el concerning isearch
Date: Sat, 16 Dec 2006 02:03:21 +0100	[thread overview]
Message-ID: <m3odq4649y.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <87bqm7yvyw.fsf@earthlink.net> (John J. Foerch's message of "Wed\, 13 Dec 2006 22\:53\:11 -0500")

John J Foerch <jjfoerch@earthlink.net> 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)))
  \f
  
+ (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 <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2006-12-16  1:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14  3:53 patch to outline.el concerning isearch John J Foerch
2006-12-14 17:54 ` [Orgmode] " Carsten Dominik
2006-12-15 12:17   ` Tim O'Callaghan
2006-12-15 13:14     ` Carsten Dominik
2006-12-14 21:28 ` John J Foerch
2006-12-16  1:03 ` Kim F. Storm [this message]
2006-12-16 16:32   ` John J Foerch
2006-12-17  0:49     ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3odq4649y.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=jjfoerch@earthlink.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).