# HG changeset patch # User Richard M. Stallman # Date 1090704887 0 # Node ID feaa69f279aa61e3ac0bb54823e2b1238a54e4d6 # Parent f7f0ca44ab23559b1399de7df0f6fb820ca2f33f (occur-next-error): Call set-window-point. (occur-engine): Handle negative NLINES. diff -r f7f0ca44ab23 -r feaa69f279aa lisp/replace.el --- a/lisp/replace.el Sat Jul 24 20:56:59 2004 +0000 +++ b/lisp/replace.el Sat Jul 24 21:34:47 2004 +0000 @@ -732,6 +732,8 @@ #'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 @@ ;; 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))