From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Piotr Zielinski" Subject: [PATCH] Added backward isearch support for headings Date: Sun, 3 Aug 2008 20:41:04 +0100 Message-ID: <3c12eb8d0808031241w5e9fd842k753853abc4f4c520@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KPjS0-0008OR-5L for emacs-orgmode@gnu.org; Sun, 03 Aug 2008 15:41:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KPjRy-0008L6-Ar for emacs-orgmode@gnu.org; Sun, 03 Aug 2008 15:41:07 -0400 Received: from [199.232.76.173] (port=45900 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPjRy-0008Ka-4G for emacs-orgmode@gnu.org; Sun, 03 Aug 2008 15:41:06 -0400 Received: from wr-out-0506.google.com ([64.233.184.226]:37116) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KPjRx-00013T-R5 for emacs-orgmode@gnu.org; Sun, 03 Aug 2008 15:41:06 -0400 Received: by wr-out-0506.google.com with SMTP id c30so1369735wra.14 for ; Sun, 03 Aug 2008 12:41:04 -0700 (PDT) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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