summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-07-24 21:34:47 +0000
committerRichard M. Stallman <rms@gnu.org>2004-07-24 21:34:47 +0000
commitf22a74063c8024ab3012b511b668392ebef6995f (patch)
tree0818e23b2f24c1cb316879e10f646232ebf0885e /lisp/replace.el
parentfc820cc5400e444db02b891dca8e728e692fef4d (diff)
downloademacs-f22a74063c8024ab3012b511b668392ebef6995f.tar.gz
emacs-f22a74063c8024ab3012b511b668392ebef6995f.tar.bz2
emacs-f22a74063c8024ab3012b511b668392ebef6995f.zip
(occur-next-error): Call set-window-point.
(occur-engine): Handle negative NLINES.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index f81c6f53914..f09868cc6d3 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -732,6 +732,8 @@ Compatibility function for \\[next-error] invocations."
#'previous-single-property-change
#'next-single-property-change)
"No more matches")
+ ;; In case the *Occur* buffer is visible in a nonselected window.
+ (set-window-point (get-buffer-window (current-buffer)) (point))
(occur-mode-goto-occurrence))
@@ -1009,9 +1011,11 @@ See also `multi-occur'."
;; concatenate them all together.
(apply #'concat
(nconc
- (occur-engine-add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ nlines)) keep-props))))
+ (occur-engine-add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ (abs nlines))) keep-props))))
(list out-line)
- (occur-engine-add-prefix (cdr (occur-accumulate-lines (1+ nlines) keep-props))))))))
+ (if (> nlines 0)
+ (occur-engine-add-prefix
+ (cdr (occur-accumulate-lines (1+ nlines) keep-props)))))))))
;; Actually insert the match display data
(with-current-buffer out-buf
(let ((beg (point))