mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 03:10:58 -08:00
Guard occur against an undefined orig-line
; Not to be merged to master * lisp/replace.el (occur-engine): Avoid inserting the current line if orig-line is nil. This happens, for example, when reverting an occur buffer with `list-matching-lines-jump-to-current-line' set to t. (Bug#33476)
This commit is contained in:
parent
908af9dfc4
commit
ee1ebe8246
1 changed files with 3 additions and 1 deletions
|
|
@ -1748,6 +1748,7 @@ See also `multi-occur'."
|
||||||
(when (and list-matching-lines-jump-to-current-line
|
(when (and list-matching-lines-jump-to-current-line
|
||||||
(not multi-occur-p)
|
(not multi-occur-p)
|
||||||
(not orig-line-shown-p)
|
(not orig-line-shown-p)
|
||||||
|
orig-line
|
||||||
(>= curr-line orig-line))
|
(>= curr-line orig-line))
|
||||||
(insert
|
(insert
|
||||||
(concat
|
(concat
|
||||||
|
|
@ -1774,7 +1775,8 @@ See also `multi-occur'."
|
||||||
;; Insert original line if haven't done yet.
|
;; Insert original line if haven't done yet.
|
||||||
(when (and list-matching-lines-jump-to-current-line
|
(when (and list-matching-lines-jump-to-current-line
|
||||||
(not multi-occur-p)
|
(not multi-occur-p)
|
||||||
(not orig-line-shown-p))
|
(not orig-line-shown-p)
|
||||||
|
orig-line)
|
||||||
(with-current-buffer out-buf
|
(with-current-buffer out-buf
|
||||||
(insert
|
(insert
|
||||||
(concat
|
(concat
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue