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

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

[elpa] master c8be397 222/348: update 'counsel-bookmark' with the abilit


From: Oleh Krehel
Subject: [elpa] master c8be397 222/348: update 'counsel-bookmark' with the ability to create, edit, and delete bookmarks
Date: Sat, 8 Apr 2017 11:04:00 -0400 (EDT)

branch: master
commit c8be3973a4841a3ee7d05e59666724965ecc8dd8
Author: Bryan Gilbert <address@hidden>
Commit: Bryan Gilbert <address@hidden>

    update 'counsel-bookmark' with the ability to create, edit, and delete 
bookmarks
---
 counsel.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/counsel.el b/counsel.el
index 387877c..162a22e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -618,17 +618,23 @@ input corresponding to the chosen variable."
 
 ;;;###autoload
 (defun counsel-bookmark ()
-  "Forward to `bookmark-jump'."
+  "Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist."
   (interactive)
   (require 'bookmark)
-  (ivy-read "Jump to bookmark: "
+  (ivy-read "Create or jump to bookmark: "
             (bookmark-all-names)
             :action (lambda (x)
-                      (with-ivy-window
-                        (bookmark-jump x)))
-            :require-match t
+                      (if (member x (bookmark-all-names))
+                          (with-ivy-window
+                            (bookmark-jump x))
+                        (bookmark-set x)))
             :caller 'counsel-bookmark))
 
+(ivy-set-actions
+ 'counsel-bookmark
+ '(("d" bookmark-delete "delete")
+   ("e" bookmark-rename "edit")))
+
 (defun counsel-M-x-transformer (cmd)
   "Return CMD appended with the corresponding binding in the current window."
   (let ((binding (substitute-command-keys (format "\\[%s]" cmd))))



reply via email to

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