Emacs outline-mode auto expand upon grep -


i'm using outline-mode (org-mode mostly) in emacs, , use grep-mode search. annoys me when follow links in grep buffer, folded texts not unfold. there way automate that?

a similar problem auto-unfold when goto-line called, can achieved define advice goto-line function, however, defadvice goto-line , goto-char not work mouse-events.

more generally, happens when click link in emacs ? tried track down function stack can not find source due event-mode used in emacs.

for first part of question, here trickery use. comments follow.

 (setq org-directory "~/topdir-of-org-files")  (global-set-key "\c-cog" 'fp-org-grep)  (defun fp-org-grep (regexp)   (interactive "morg grep? ")   (if (string-equal regexp "")       (error "rien à trouver!")     (require 'grep)     (unless grep-find-template       (grep-compute-defaults))     (let ((grep-find-ignored-directories nil)           (grep-find-ignored-files nil))       (rgrep regexp "*.org" org-directory))     (setq fp-org-isearch-string regexp)     (save-excursion       (set-buffer "*grep*")       (setq next-error-function 'fp-org-grep-next-error))))  (defun fp-org-grep-next-error (n &optional reset)   (compilation-next-error-function n reset)   (org-reveal)   (setq isearch-string fp-org-isearch-string)   (when (or (null search-ring)             (not (string-equal (car search-ring) fp-org-isearch-string)))     (push fp-org-isearch-string search-ring)))  (defvar fp-org-isearch-string "") 

for speed, keep 3 org files agenda, define "c-c o g" command grep recursively through org files. when go entry through usual means, org surrounding context gets revealed. may hit "c-s" highlight searched text.

françois


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -