* [PATCH] Added backward isearch support for headings
@ 2008-08-03 19:41 Piotr Zielinski
2008-09-03 9:36 ` Carsten Dominik
0 siblings, 1 reply; 2+ messages in thread
From: Piotr Zielinski @ 2008-08-03 19:41 UTC (permalink / raw)
To: emacs-orgmode
Changed org-goto-local-search-forward-headings to support backward
search, and renamed it to org-goto-local-search-headings.
---
lisp/org.el | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 57c6dae..62ad9ea 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4350,7 +4350,7 @@ or nil."
(let ((isearch-mode-map org-goto-local-auto-isearch-map)
(isearch-hide-immediately nil)
(isearch-search-fun-function
- (lambda () 'org-goto-local-search-forward-headings))
+ (lambda () 'org-goto-local-search-headings))
(org-goto-selected-point org-goto-exit-command))
(save-excursion
(save-window-excursion
@@ -4391,10 +4391,12 @@ or nil."
(define-key org-goto-local-auto-isearch-map "\C-i" 'isearch-other-control-char)
(define-key org-goto-local-auto-isearch-map "\C-m" 'isearch-other-control-char)
-(defun org-goto-local-search-forward-headings (string bound noerror)
+(defun org-goto-local-search-headings (string bound noerror)
"Search and make sure that anu matches are in headlines."
(catch 'return
- (while (search-forward string bound noerror)
+ (while (if isearch-forward
+ (search-forward string bound noerror)
+ (search-backward string bound noerror))
(when (let ((context (mapcar 'car (save-match-data (org-context)))))
(and (member :headline context)
(not (member :tags context))))
--
1.5.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Added backward isearch support for headings
2008-08-03 19:41 [PATCH] Added backward isearch support for headings Piotr Zielinski
@ 2008-09-03 9:36 ` Carsten Dominik
0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2008-09-03 9:36 UTC (permalink / raw)
To: Piotr Zielinski; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1853 bytes --]
Applied, thanks.
- Carsten
On Aug 3, 2008, at 9:41 PM, Piotr Zielinski wrote:
> Changed org-goto-local-search-forward-headings to support backward
> search, and renamed it to org-goto-local-search-headings.
> ---
> lisp/org.el | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 57c6dae..62ad9ea 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -4350,7 +4350,7 @@ or nil."
> (let ((isearch-mode-map org-goto-local-auto-isearch-map)
> (isearch-hide-immediately nil)
> (isearch-search-fun-function
> - (lambda () 'org-goto-local-search-forward-headings))
> + (lambda () 'org-goto-local-search-headings))
> (org-goto-selected-point org-goto-exit-command))
> (save-excursion
> (save-window-excursion
> @@ -4391,10 +4391,12 @@ or nil."
> (define-key org-goto-local-auto-isearch-map "\C-i" 'isearch-other-
> control-char)
> (define-key org-goto-local-auto-isearch-map "\C-m" 'isearch-other-
> control-char)
>
> -(defun org-goto-local-search-forward-headings (string bound noerror)
> +(defun org-goto-local-search-headings (string bound noerror)
> "Search and make sure that anu matches are in headlines."
> (catch 'return
> - (while (search-forward string bound noerror)
> + (while (if isearch-forward
> + (search-forward string bound noerror)
> + (search-backward string bound noerror))
> (when (let ((context (mapcar 'car (save-match-data (org-
> context)))))
> (and (member :headline context)
> (not (member :tags context))))
> --
> 1.5.2.5
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[-- Attachment #1.2: Type: text/html, Size: 2830 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-03 9:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-03 19:41 [PATCH] Added backward isearch support for headings Piotr Zielinski
2008-09-03 9:36 ` Carsten Dominik
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.