diff options
| author | Juri Linkov | 2018-12-10 01:53:08 +0200 |
|---|---|---|
| committer | Juri Linkov | 2018-12-10 01:53:08 +0200 |
| commit | f8179cd366664484e849849027cdf6ecd55dbae9 (patch) | |
| tree | 21fcdab6115850421eb08c0945a30c8f6eacb438 /lisp/replace.el | |
| parent | 38f2b582711041ea75b8e486f5bf286542207f27 (diff) | |
| download | emacs-f8179cd366664484e849849027cdf6ecd55dbae9.tar.gz emacs-f8179cd366664484e849849027cdf6ecd55dbae9.zip | |
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.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index ecb47936e7b..dcae12e9b76 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1657,7 +1657,10 @@ See also `multi-occur'." | |||
| 1657 | (lines 0) ; count of matching lines | 1657 | (lines 0) ; count of matching lines |
| 1658 | (matches 0) ; count of matches | 1658 | (matches 0) ; count of matches |
| 1659 | (headerpt (with-current-buffer out-buf (point))) | 1659 | (headerpt (with-current-buffer out-buf (point))) |
| 1660 | ) | 1660 | (orig-line (if (not (overlayp boo)) |
| 1661 | (line-number-at-pos) | ||
| 1662 | (line-number-at-pos | ||
| 1663 | (overlay-get boo 'occur--orig-point))))) | ||
| 1661 | (save-excursion | 1664 | (save-excursion |
| 1662 | ;; begin searching in the buffer | 1665 | ;; begin searching in the buffer |
| 1663 | (goto-char (if (overlayp boo) (overlay-start boo) (point-min))) | 1666 | (goto-char (if (overlayp boo) (overlay-start boo) (point-min))) |
| @@ -1665,9 +1668,6 @@ See also `multi-occur'." | |||
| 1665 | (let* ((limit (if (overlayp boo) (overlay-end boo) (point-max))) | 1668 | (let* ((limit (if (overlayp boo) (overlay-end boo) (point-max))) |
| 1666 | (start-line (line-number-at-pos)) | 1669 | (start-line (line-number-at-pos)) |
| 1667 | (curr-line start-line) ; line count | 1670 | (curr-line start-line) ; line count |
| 1668 | (orig-line (if (not (overlayp boo)) 1 | ||
| 1669 | (line-number-at-pos | ||
| 1670 | (overlay-get boo 'occur--orig-point)))) | ||
| 1671 | (orig-line-shown-p) | 1671 | (orig-line-shown-p) |
| 1672 | (prev-line nil) ; line number of prev match endpt | 1672 | (prev-line nil) ; line number of prev match endpt |
| 1673 | (prev-after-lines nil) ; context lines of prev match | 1673 | (prev-after-lines nil) ; context lines of prev match |
| @@ -1796,7 +1796,7 @@ See also `multi-occur'." | |||
| 1796 | (setq orig-line-shown-p t) | 1796 | (setq orig-line-shown-p t) |
| 1797 | (save-excursion | 1797 | (save-excursion |
| 1798 | (goto-char (point-min)) | 1798 | (goto-char (point-min)) |
| 1799 | (forward-line (- orig-line start-line 1)) | 1799 | (forward-line (1- orig-line)) |
| 1800 | (occur-engine-line (line-beginning-position) | 1800 | (occur-engine-line (line-beginning-position) |
| 1801 | (line-end-position) keep-props))))) | 1801 | (line-end-position) keep-props))))) |
| 1802 | ;; Actually insert the match display data | 1802 | ;; Actually insert the match display data |
| @@ -1834,7 +1834,7 @@ See also `multi-occur'." | |||
| 1834 | (let ((orig-line-str | 1834 | (let ((orig-line-str |
| 1835 | (save-excursion | 1835 | (save-excursion |
| 1836 | (goto-char (point-min)) | 1836 | (goto-char (point-min)) |
| 1837 | (forward-line (- orig-line start-line 1)) | 1837 | (forward-line (1- orig-line)) |
| 1838 | (occur-engine-line (line-beginning-position) | 1838 | (occur-engine-line (line-beginning-position) |
| 1839 | (line-end-position) keep-props)))) | 1839 | (line-end-position) keep-props)))) |
| 1840 | (add-face-text-property | 1840 | (add-face-text-property |