From 9bc97e6f16963b49ea818c3c63ea00cf941f82c0 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 19 Nov 2009 14:25:02 +0100 Subject: [PATCH] Widen buffers for multi-occur Bernt Hansen writes: > The org-agenda multi-occur search command (C-c a /) does not return > results on buffers that are currently narrowed if the search would > normally match outside the narrowed region. This prevents possible > matches from being displayed. --- lisp/ChangeLog | 3 +++ lisp/org.el | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42b7a6259..33dfd688b 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-11-19 Carsten Dominik + * org.el (org-occur-in-agenda-files): Make sure none of the + buffers is narrowed. + * org-habit.el (org-is-habit-p): Add doc string. 2009-11-18 Carsten Dominik diff --git a/lisp/org.el b/lisp/org.el index 12e950f3a..5408d8a2a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16663,7 +16663,12 @@ really on, so that the block visually is on the match." (add-to-list 'files f 'append) (add-to-list 'tnames (file-truename f) 'append))) (multi-occur - (mapcar (lambda (x) (or (get-file-buffer x) (find-file-noselect x))) files) + (mapcar (lambda (x) + (with-current-buffer + (or (get-file-buffer x) (find-file-noselect x)) + (widen) + (current-buffer))) + files) regexp))) (if (boundp 'occur-mode-find-occurrence-hook)