about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-26T17·30+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-26T17·30+0100
commitea0788fd62cb48b5907f4efeafa4ac58e7fb09f4 (patch)
treefc69590a75fbb5e22ecb7ab740e3a9d39b901db1
parent8fef6c0408545195dfacfa07c488b00f16c64b8b (diff)
Delete unused parts of bookmark.el
Trimming more fat.
-rw-r--r--emacs/.emacs.d/wpc/bookmark.el45
1 files changed, 1 insertions, 44 deletions
diff --git a/emacs/.emacs.d/wpc/bookmark.el b/emacs/.emacs.d/wpc/bookmark.el
index d4c102575dbe..77fddd86fa98 100644
--- a/emacs/.emacs.d/wpc/bookmark.el
+++ b/emacs/.emacs.d/wpc/bookmark.el
@@ -65,31 +65,6 @@ Otherwise, open with `counsel-find-file'."
                   :kbd "p"))
   "List of registered bookmarks.")
 
-(defun bookmark/from-label (label)
-  "Return the bookmark with LABEL or nil."
-  (->> bookmark/whitelist
-       (list/find (lambda (b) (equal label (bookmark-label b))))))
-
-(defun bookmark/magit-status ()
-  "Use ivy to select a bookmark and jump to its `magit-status' buffer."
-  (interactive)
-  (let ((labels (set/new "briefcase" "depot"))
-        (all-labels (->> bookmark/whitelist
-                         (list/map (>> bookmark-label))
-                         set/from-list)))
-    (prelude/assert (set/subset? labels all-labels))
-    (ivy-read "Repository: "
-              (set/to-list labels)
-              :require-match t
-              :action (lambda (label)
-                        (->> label
-                             bookmark/from-label
-                             bookmark-path
-                             magit-status)))))
-
-;; TODO: Consider `ivy-read' extension that takes a list of structs,
-;; `struct-to-label' and `label-struct' functions.
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; API
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -103,21 +78,7 @@ Otherwise, open with `counsel-find-file'."
      ((f-file? path)
       (funcall bookmark/handle-file path)))))
 
-(defun bookmark/ivy-open ()
-  "Use ivy to filter available bookmarks."
-  (interactive)
-  (ivy-read "Bookmark: "
-            (->> bookmark/whitelist
-                 (list/map #'bookmark-label))
-            :require-match t
-            :action (lambda (label)
-                      (bookmark/open (bookmark/from-label label)))))
-
 (when bookmark/install-kbds?
-  (general-define-key
-   :prefix "<SPC>"
-   :states '(normal)
-   "jj" #'bookmark/ivy-open)
   (->> bookmark/whitelist
        (list/map
         (lambda (b)
@@ -127,11 +88,7 @@ Otherwise, open with `counsel-find-file'."
            (string/concat "j" (bookmark-kbd b))
            ;; TODO: Consider `cl-labels' so `which-key' minibuffer is more
            ;; helpful.
-           (lambda () (interactive) (bookmark/open b))))))
-  (general-define-key
-   :states '(normal)
-   :prefix "<SPC>"
-   "gS" #'bookmark/magit-status))
+           (lambda () (interactive) (bookmark/open b)))))))
 
 (provide 'bookmark)
 ;;; bookmark.el ends here