aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorKim F. Storm2004-04-21 21:36:42 +0000
committerKim F. Storm2004-04-21 21:36:42 +0000
commit423e4de7c1f0f29b60f744ce4bf29e3d65f9271f (patch)
treec128b8923a54621475432588b6686ecb04954667 /lisp/replace.el
parent50f007fb09bc893294d0229e339e770e16a22f2b (diff)
downloademacs-423e4de7c1f0f29b60f744ce4bf29e3d65f9271f.tar.gz
emacs-423e4de7c1f0f29b60f744ce4bf29e3d65f9271f.zip
From: Teodor Zlatanov <tzz@lifelogs.com>
(occur-next-error, occur-1): Hook into the next-error framework.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 2d26cb5cc66..e14e1314352 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -538,6 +538,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
538 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function) 538 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function)
539 (make-local-variable 'occur-revert-arguments) 539 (make-local-variable 'occur-revert-arguments)
540 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 540 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
541 (setq next-error-function 'occur-next-error)
541 (run-hooks 'occur-mode-hook)) 542 (run-hooks 'occur-mode-hook))
542 543
543(defun occur-revert-function (ignore1 ignore2) 544(defun occur-revert-function (ignore1 ignore2)
@@ -614,6 +615,21 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
614 "Move to the Nth (default 1) previous match in an Occur mode buffer." 615 "Move to the Nth (default 1) previous match in an Occur mode buffer."
615 (interactive "p") 616 (interactive "p")
616 (occur-find-match n #'previous-single-property-change "No earlier matches")) 617 (occur-find-match n #'previous-single-property-change "No earlier matches"))
618
619(defun occur-next-error (&optional argp reset)
620 "Move to the Nth (default 1) next match in an Occur mode buffer.
621Compatibility function for \\[next-error] invocations."
622 (interactive "p")
623 (when reset
624 (occur-find-match 0 #'next-single-property-change "No first match"))
625 (occur-find-match
626 (prefix-numeric-value argp)
627 (if (> 0 (prefix-numeric-value argp))
628 #'previous-single-property-change
629 #'next-single-property-change)
630 "No more matches")
631 (occur-mode-goto-occurrence))
632
617 633
618(defcustom list-matching-lines-default-context-lines 0 634(defcustom list-matching-lines-default-context-lines 0
619 "*Default number of context lines included around `list-matching-lines' matches. 635 "*Default number of context lines included around `list-matching-lines' matches.
@@ -800,7 +816,9 @@ See also `multi-occur'."
800 (setq occur-revert-arguments (list regexp nlines bufs) 816 (setq occur-revert-arguments (list regexp nlines bufs)
801 buffer-read-only t) 817 buffer-read-only t)
802 (if (> count 0) 818 (if (> count 0)
803 (display-buffer occur-buf) 819 (progn
820 (display-buffer occur-buf)
821 (setq next-error-last-buffer occur-buf))
804 (kill-buffer occur-buf))) 822 (kill-buffer occur-buf)))
805 (run-hooks 'occur-hook)))) 823 (run-hooks 'occur-hook))))
806 824