From ea0788fd62cb48b5907f4efeafa4ac58e7fb09f4 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 26 Aug 2020 18:30:10 +0100 Subject: Delete unused parts of bookmark.el Trimming more fat. --- emacs/.emacs.d/wpc/bookmark.el | 45 +----------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) (limited to 'emacs') 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 "" - :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 "" - "gS" #'bookmark/magit-status)) + (lambda () (interactive) (bookmark/open b))))))) (provide 'bookmark) ;;; bookmark.el ends here -- cgit 1.4.1