[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master f8179cd: Fix occur for non-nil list-matching-lines-
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] master f8179cd: Fix occur for non-nil list-matching-lines-jump-to-current-line (bug#33476) |
Date: |
Sun, 9 Dec 2018 18:53:14 -0500 (EST) |
branch: master
commit f8179cd366664484e849849027cdf6ecd55dbae9
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
Fix occur for non-nil list-matching-lines-jump-to-current-line (bug#33476)
* lisp/replace.el (occur-engine): Move orig-line let-binding higher.
Don't use start-line in forward-line.
---
lisp/replace.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lisp/replace.el b/lisp/replace.el
index ecb4793..dcae12e 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1657,7 +1657,10 @@ See also `multi-occur'."
(lines 0) ; count of matching lines
(matches 0) ; count of matches
(headerpt (with-current-buffer out-buf (point)))
- )
+ (orig-line (if (not (overlayp boo))
+ (line-number-at-pos)
+ (line-number-at-pos
+ (overlay-get boo 'occur--orig-point)))))
(save-excursion
;; begin searching in the buffer
(goto-char (if (overlayp boo) (overlay-start boo) (point-min)))
@@ -1665,9 +1668,6 @@ See also `multi-occur'."
(let* ((limit (if (overlayp boo) (overlay-end boo) (point-max)))
(start-line (line-number-at-pos))
(curr-line start-line) ; line count
- (orig-line (if (not (overlayp boo)) 1
- (line-number-at-pos
- (overlay-get boo 'occur--orig-point))))
(orig-line-shown-p)
(prev-line nil) ; line number of prev match endpt
(prev-after-lines nil) ; context lines of prev match
@@ -1796,7 +1796,7 @@ See also `multi-occur'."
(setq orig-line-shown-p t)
(save-excursion
(goto-char (point-min))
- (forward-line (- orig-line start-line 1))
+ (forward-line (1- orig-line))
(occur-engine-line (line-beginning-position)
(line-end-position)
keep-props)))))
;; Actually insert the match display data
@@ -1834,7 +1834,7 @@ See also `multi-occur'."
(let ((orig-line-str
(save-excursion
(goto-char (point-min))
- (forward-line (- orig-line start-line 1))
+ (forward-line (1- orig-line))
(occur-engine-line (line-beginning-position)
(line-end-position)
keep-props))))
(add-face-text-property
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master f8179cd: Fix occur for non-nil list-matching-lines-jump-to-current-line (bug#33476),
Juri Linkov <=