Show node when jumping to compile/grep/occur results

This commit is contained in:
Greg Sexton 2015-03-29 15:14:03 +01:00
parent d81d57047e
commit f880c5dac5

View File

@ -622,6 +622,9 @@ uncover any bugs."
:type 'hook :type 'hook
:group 'origami) :group 'origami)
(defun origami-find-occurrence-show-node ()
(call-interactively 'origami-show-node))
;;;###autoload ;;;###autoload
(define-minor-mode origami-mode (define-minor-mode origami-mode
"Minor mode to selectively hide/show text in the current buffer. "Minor mode to selectively hide/show text in the current buffer.
@ -638,6 +641,16 @@ Key bindings:
:lighter nil :lighter nil
:keymap origami-mode-map :keymap origami-mode-map
:init-value nil :init-value nil
(if origami-mode
(progn
(add-hook 'occur-mode-find-occurrence-hook
'origami-find-occurrence-show-node nil t)
(setq next-error-move-function (lambda (ignored pos)
(goto-char pos)
(call-interactively 'origami-show-node))))
(remove-hook 'occur-mode-find-occurrence-hook
'origami-find-occurrence-show-node t)
(setq next-error-move-function nil))
(origami-reset (current-buffer))) (origami-reset (current-buffer)))
(provide 'origami) (provide 'origami)