Commit ee1ebe82 authored by Raimon Grau's avatar Raimon Grau Committed by Juri Linkov

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)
parent 908af9df
Pipeline #242 failed with stage
in 5 minutes and 37 seconds
......@@ -1748,6 +1748,7 @@ See also `multi-occur'."
(when (and list-matching-lines-jump-to-current-line
(not multi-occur-p)
(not orig-line-shown-p)
orig-line
(>= curr-line orig-line))
(insert
(concat
......@@ -1774,7 +1775,8 @@ See also `multi-occur'."
;; Insert original line if haven't done yet.
(when (and list-matching-lines-jump-to-current-line
(not multi-occur-p)
(not orig-line-shown-p))
(not orig-line-shown-p)
orig-line)
(with-current-buffer out-buf
(insert
(concat
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment