emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 139816a 106/184: counsel.el (counsel-mark-ring): Add the l


From: Oleh Krehel
Subject: [elpa] master 139816a 106/184: counsel.el (counsel-mark-ring): Add the latest mark to selection
Date: Wed, 16 Oct 2019 13:15:00 -0400 (EDT)

branch: master
commit 139816af8e65106a08e5a8ed432d185fcc629e80
Author: SAITOU Keita <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-mark-ring): Add the latest mark to selection
    
    The mark-ring has the list of saved former marks.
    So, it does not have the latest mark.
    The latest mark is held by mark-marker.
    This change add the latest mark to counsel-mark-ring selection.
    
    Fixes #2252
---
 counsel.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index b046d1b..d2aa51f 100644
--- a/counsel.el
+++ b/counsel.el
@@ -3768,7 +3768,13 @@ Obeys `widen-automatically', which see."
                   (line (buffer-substring
                          (line-beginning-position) (line-end-position))))
               (cons (format fmt linum line) (point)))))
-         (marks (sort (delete-dups (copy-sequence mark-ring)) #'<))
+         (marks (copy-sequence mark-ring))
+         (marks
+          ;; mark-marker is empty?
+          (if (equal (mark-marker) (make-marker))
+              marks
+            (cons (copy-marker (mark-marker)) marks)))
+         (marks (sort (delete-dups marks) #'<))
          (cands
           ;; Widen, both to save `line-number-at-pos' the trouble
           ;; and for `buffer-substring' to work.



reply via email to

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