all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* patch to outline.el concerning isearch
@ 2006-12-14  3:53 ` John J Foerch
  0 siblings, 0 replies; 13+ messages in thread
From: John J Foerch @ 2006-12-14  3:53 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

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.

Please comment, criticize, or enlighten.  Thank you,

John Foerch


[-- Attachment #2: patch to outline.el concerning isearch --]
[-- Type: text/plain, Size: 884 bytes --]

Index: lisp/outline.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/outline.el,v
retrieving revision 1.24
diff -r1.24 outline.el
745a746,757
> (defvar outline-isearch-open-invisible-fun
>   'outline-isearch-open-invisible-show-entry
>   "Function that will be called when a successful isearch
>   finishes in an invisible overylay.  The overlay will be passed
>   to the function as its sole argument.")
> 
> ;; Default function for outline-isearch-open-invisible-fun.  Makes only the
> ;; single entry containing point visible.
> (defun outline-isearch-open-invisible-show-entry (overlay)
>   ;; We rely on the fact that isearch places point on the matched text.
>   (show-entry))
> 
751c763,764
<   (show-entry))
---
>   (if outline-isearch-open-invisible-fun
>       (funcall outline-isearch-open-invisible-fun overlay)))

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* patch to outline.el concerning isearch
@ 2006-12-14  3:53 ` John J Foerch
  0 siblings, 0 replies; 13+ messages in thread
From: John J Foerch @ 2006-12-14  3:53 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

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.

Please comment, criticize, or enlighten.  Thank you,

John Foerch


[-- Attachment #2: patch to outline.el concerning isearch --]
[-- Type: text/plain, Size: 884 bytes --]

Index: lisp/outline.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/outline.el,v
retrieving revision 1.24
diff -r1.24 outline.el
745a746,757
> (defvar outline-isearch-open-invisible-fun
>   'outline-isearch-open-invisible-show-entry
>   "Function that will be called when a successful isearch
>   finishes in an invisible overylay.  The overlay will be passed
>   to the function as its sole argument.")
> 
> ;; Default function for outline-isearch-open-invisible-fun.  Makes only the
> ;; single entry containing point visible.
> (defun outline-isearch-open-invisible-show-entry (overlay)
>   ;; We rely on the fact that isearch places point on the matched text.
>   (show-entry))
> 
751c763,764
<   (show-entry))
---
>   (if outline-isearch-open-invisible-fun
>       (funcall outline-isearch-open-invisible-fun overlay)))

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Orgmode] patch to outline.el concerning isearch
  2006-12-14  3:53 ` John J Foerch
@ 2006-12-14 17:54   ` Carsten Dominik
  -1 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2006-12-14 17:54 UTC (permalink / raw)
  Cc: emacs-orgmode, emacs-devel

I strongly support this proposal, this is a feature that would be
very valuable.

- Carsten

On Dec 14, 2006, at 4:53, John J Foerch wrote:

> 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.
>
> Please comment, criticize, or enlighten.  Thank you,
>
> John Foerch
>
> Index: lisp/outline.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/outline.el,v
> retrieving revision 1.24
> diff -r1.24 outline.el
> 745a746,757
>> (defvar outline-isearch-open-invisible-fun
>>   'outline-isearch-open-invisible-show-entry
>>   "Function that will be called when a successful isearch
>>   finishes in an invisible overylay.  The overlay will be passed
>>   to the function as its sole argument.")
>>
>> ;; Default function for outline-isearch-open-invisible-fun.  Makes 
>> only the
>> ;; single entry containing point visible.
>> (defun outline-isearch-open-invisible-show-entry (overlay)
>>   ;; We rely on the fact that isearch places point on the matched 
>> text.
>>   (show-entry))
>>
> 751c763,764
> <   (show-entry))
> ---
>>   (if outline-isearch-open-invisible-fun
>>       (funcall outline-isearch-open-invisible-fun overlay)))
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Orgmode] patch to outline.el concerning isearch
@ 2006-12-14 17:54   ` Carsten Dominik
  0 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2006-12-14 17:54 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode, emacs-devel

I strongly support this proposal, this is a feature that would be
very valuable.

- Carsten

On Dec 14, 2006, at 4:53, John J Foerch wrote:

> 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.
>
> Please comment, criticize, or enlighten.  Thank you,
>
> John Foerch
>
> Index: lisp/outline.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/outline.el,v
> retrieving revision 1.24
> diff -r1.24 outline.el
> 745a746,757
>> (defvar outline-isearch-open-invisible-fun
>>   'outline-isearch-open-invisible-show-entry
>>   "Function that will be called when a successful isearch
>>   finishes in an invisible overylay.  The overlay will be passed
>>   to the function as its sole argument.")
>>
>> ;; Default function for outline-isearch-open-invisible-fun.  Makes 
>> only the
>> ;; single entry containing point visible.
>> (defun outline-isearch-open-invisible-show-entry (overlay)
>>   ;; We rely on the fact that isearch places point on the matched 
>> text.
>>   (show-entry))
>>
> 751c763,764
> <   (show-entry))
> ---
>>   (if outline-isearch-open-invisible-fun
>>       (funcall outline-isearch-open-invisible-fun overlay)))
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
  2006-12-14  3:53 ` John J Foerch
  (?)
  (?)
@ 2006-12-14 21:28 ` John J Foerch
  -1 siblings, 0 replies; 13+ messages in thread
From: John J Foerch @ 2006-12-14 21:28 UTC (permalink / raw)
  To: emacs-orgmode

PS: my post about the patch to outline.el was directed at emacs.devel, but I
cross-posted it to emacs.orgmode to make sure Carsten Dominik saw it.

--John

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
  2006-12-14 17:54   ` Carsten Dominik
  (?)
@ 2006-12-15 12:17   ` Tim O'Callaghan
  2006-12-15 13:14     ` Carsten Dominik
  -1 siblings, 1 reply; 13+ messages in thread
From: Tim O'Callaghan @ 2006-12-15 12:17 UTC (permalink / raw)
  To: emacs-orgmode

On 14/12/06, Carsten Dominik <carsten.dominik@gmail.com> wrote:
> I strongly support this proposal, this is a feature that would be
> very valuable.
>

Any chance you could hack it into the noutline you distribute for
XEmacs in the next release?
XEmacs has this search issue too.

Tim.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
  2006-12-15 12:17   ` Tim O'Callaghan
@ 2006-12-15 13:14     ` Carsten Dominik
  0 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2006-12-15 13:14 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: emacs-orgmode

Yes, I will, but I want to wait what the solution for emacs will be and 
then implement the same in the noutline for xemacs.

- Carsten

On Dec 15, 2006, at 13:17, Tim O'Callaghan wrote:

> On 14/12/06, Carsten Dominik <carsten.dominik@gmail.com> wrote:
>> I strongly support this proposal, this is a feature that would be
>> very valuable.
>>
>
> Any chance you could hack it into the noutline you distribute for
> XEmacs in the next release?
> XEmacs has this search issue too.
>
> Tim.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
  2006-12-14  3:53 ` John J Foerch
@ 2006-12-16  1:03   ` Kim F. Storm
  -1 siblings, 0 replies; 13+ messages in thread
From: Kim F. Storm @ 2006-12-16  1:03 UTC (permalink / raw)
  Cc: emacs-orgmode, emacs-devel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
@ 2006-12-16  1:03   ` Kim F. Storm
  0 siblings, 0 replies; 13+ messages in thread
From: Kim F. Storm @ 2006-12-16  1:03 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode, emacs-devel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
  2006-12-16  1:03   ` Kim F. Storm
@ 2006-12-16 16:32     ` John J Foerch
  -1 siblings, 0 replies; 13+ messages in thread
From: John J Foerch @ 2006-12-16 16:32 UTC (permalink / raw)
  Cc: emacs-orgmode

storm@cua.dk (Kim F. Storm) writes:
> 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?

Yes, that will work perfectly.  Thanks!

--John

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
@ 2006-12-16 16:32     ` John J Foerch
  0 siblings, 0 replies; 13+ messages in thread
From: John J Foerch @ 2006-12-16 16:32 UTC (permalink / raw)
  To: emacs-devel; +Cc: emacs-orgmode

storm@cua.dk (Kim F. Storm) writes:
> 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?

Yes, that will work perfectly.  Thanks!

--John

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
  2006-12-16 16:32     ` John J Foerch
@ 2006-12-17  0:49       ` Kim F. Storm
  -1 siblings, 0 replies; 13+ messages in thread
From: Kim F. Storm @ 2006-12-17  0:49 UTC (permalink / raw)
  Cc: emacs-orgmode, emacs-devel

John J Foerch <jjfoerch@earthlink.net> writes:

> storm@cua.dk (Kim F. Storm) writes:
>> 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?
>
> Yes, that will work perfectly.  Thanks!

Good.  I have installed the change.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: patch to outline.el concerning isearch
@ 2006-12-17  0:49       ` Kim F. Storm
  0 siblings, 0 replies; 13+ messages in thread
From: Kim F. Storm @ 2006-12-17  0:49 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode, emacs-devel

John J Foerch <jjfoerch@earthlink.net> writes:

> storm@cua.dk (Kim F. Storm) writes:
>> 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?
>
> Yes, that will work perfectly.  Thanks!

Good.  I have installed the change.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-12-17  0:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14  3:53 patch to outline.el concerning isearch John J Foerch
2006-12-14  3:53 ` John J Foerch
2006-12-14 17:54 ` [Orgmode] " Carsten Dominik
2006-12-14 17:54   ` 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
2006-12-16  1:03   ` Kim F. Storm
2006-12-16 16:32   ` John J Foerch
2006-12-16 16:32     ` John J Foerch
2006-12-17  0:49     ` Kim F. Storm
2006-12-17  0:49       ` Kim F. Storm

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.