branch: master
commit 139816af8e65106a08e5a8ed432d185fcc629e80
Author: SAITOU Keita <[email protected]>
Commit: Oleh Krehel <[email protected]>
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.