emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 ee1ebe8: Guard occur against an undefined orig-li


From: Juri Linkov
Subject: [Emacs-diffs] emacs-26 ee1ebe8: Guard occur against an undefined orig-line
Date: Sun, 9 Dec 2018 18:43:04 -0500 (EST)

branch: emacs-26
commit ee1ebe8246c333e9ca0e3454f357d12c713c129b
Author: Raimon Grau <address@hidden>
Commit: Juri Linkov <address@hidden>

    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)
---
 lisp/replace.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/replace.el b/lisp/replace.el
index 940bf56..4f0cbf4 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]