update packages
This commit is contained in:
@@ -16,14 +16,15 @@
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;; Integrates treemacs with bookmark.el.
|
||||
;;; NOTE: This module is lazy-loaded.
|
||||
|
||||
;; Integrates treemacs with bookmark.el.
|
||||
|
||||
;; NOTE: This module is lazy-loaded.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'bookmark)
|
||||
(require 'dash)
|
||||
(require 'f)
|
||||
(require 'treemacs-follow-mode)
|
||||
(require 'treemacs-interface)
|
||||
(require 'treemacs-scope)
|
||||
@@ -48,18 +49,19 @@ fashion to `treemacs-find-file'.
|
||||
With a prefix argument ARG treemacs will also open the bookmarked location."
|
||||
(interactive "P")
|
||||
(treemacs-block
|
||||
(bookmark-maybe-load-default-file)
|
||||
(-let [bookmarks
|
||||
(cl-loop
|
||||
for b in bookmark-alist
|
||||
for name = (car b)
|
||||
for location = (bookmark-location b)
|
||||
when (or (f-file? location) (f-directory? location))
|
||||
for location = (treemacs-canonical-path (bookmark-location b))
|
||||
when (or (file-regular-p location) (file-directory-p location))
|
||||
collect (propertize name 'location location))]
|
||||
(treemacs-error-return-if (null bookmarks)
|
||||
"Didn't find any bookmarks pointing to files.")
|
||||
(let* ((bookmark (completing-read "Bookmark: " bookmarks))
|
||||
(location (f-long (get-text-property 0 'location (--first (string= it bookmark) bookmarks))))
|
||||
(dir (if (f-directory? location) location (f-dirname location)))
|
||||
(location (treemacs-canonical-path (get-text-property 0 'location (--first (string= it bookmark) bookmarks))))
|
||||
(dir (if (file-directory-p location) location (treemacs--parent-dir location)))
|
||||
(project (treemacs--find-project-for-path dir)))
|
||||
(treemacs-error-return-if (null project)
|
||||
"Bookmark at %s does not fall under any project in the workspace."
|
||||
@@ -196,7 +198,8 @@ treemacs node is pointing to a valid buffer position."
|
||||
(-let [name (treemacs--read-string "Bookmark name: ")]
|
||||
(bookmark-store name `((filename . ,(treemacs-button-get current-btn :path))) nil)))
|
||||
('tag-node
|
||||
(-let [(tag-buffer . tag-pos) (treemacs--extract-position (treemacs-button-get current-btn :marker))]
|
||||
(-let [(tag-buffer . tag-pos)
|
||||
(treemacs--extract-position (treemacs-button-get current-btn :marker) nil)]
|
||||
(if (buffer-live-p tag-buffer)
|
||||
(bookmark-store
|
||||
(treemacs--read-string "Bookmark name: ")
|
||||
|
||||
Reference in New Issue
Block a user