[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/blist 4a4d94c09d 20/31: blist.el: QoL refinements
From: |
ELPA Syncer |
Subject: |
[elpa] externals/blist 4a4d94c09d 20/31: blist.el: QoL refinements |
Date: |
Tue, 28 Dec 2021 16:57:39 -0500 (EST) |
branch: externals/blist
commit 4a4d94c09dc7ae00dcde6d65d1e999ff5f15bbd9
Author: JSDurand <mmemmew@gmail.com>
Commit: JSDurand <mmemmew@gmail.com>
blist.el: QoL refinements
* blist.el (blist): Better discoverability.
(blist-buffer-name): Use a unique variable for the buffer name so that
the users can customize this if she uses multiple packages for
bookmarks.
(blist-set-annotation-column, blist-annotation-column-name)
(blist-annotation-column, blist-list-bookmarks): Now the user can
directly set the name of the column without doing anything special.
(blist-show-annotation): Correct error messages.
---
blist.el | 51 ++++++++++++++++++++++++++++++---------------------
1 file changed, 30 insertions(+), 21 deletions(-)
diff --git a/blist.el b/blist.el
index fc6503af64..c91a5b86fe 100644
--- a/blist.el
+++ b/blist.el
@@ -40,6 +40,13 @@
"Display bookmarks in an Ibuffer manner."
:group 'bookmark)
+;;;; Buffer name
+
+(defcustom blist-buffer-name "*Bookmark List*"
+ "The name of the buffer used to display bookmarks."
+ :group 'blist
+ :type 'string)
+
;;;; Display location or not
(defcustom blist-display-location-p t
@@ -57,6 +64,8 @@
;;;; Filter groups
+;; Maybe it will be better to add an automatic default group?
+
(defcustom blist-filter-groups (list
(cons "Eshell" #'blist-eshell-p)
(cons "Default" #'blist-default-p))
@@ -131,35 +140,25 @@ See `blist-sorter'."
If BOOKMARK has no annotation, return a space string."
(cond
((let ((annotation (bookmark-get-annotation bookmark)))
- (and (stringp annotation)
- (not (string= annotation ""))))
+ (and (stringp annotation) (not (string= annotation ""))))
"*")
(" ")))
-(defun blist-set-annotation-column (&rest _args)
- "Set the annotation column.
-ARGS are there to conform to the customization interface."
- (setq blist-annotation-column
- (list blist-annotation-column-name #'blist-get-annotation
- 1 1 :left nil)))
-
;;;;; Real column definition
(defcustom blist-annotation-column-name "A"
"The name of the column showing whether a bookmark has \
annotations.
-Only the first letter will be shown.
-
-If one changes this, run `blist-set-annotation-column' to set the
-annotation column again."
+Only the first letter will be shown."
:group 'blist
:type 'string)
-(defvar blist-annotation-column
+(defun blist-annotation-column ()
+ "The specification of the ANNOTATION column."
+ (declare (side-effect-free t))
(list blist-annotation-column-name #'blist-get-annotation
- 1 1 :left nil)
- "The specification of the ANNOTATION column.")
+ 1 1 :left nil))
;;;; How to open multiple bookmarks?
@@ -312,6 +311,10 @@ of the required type."
;;;; List function
+;; an alias for discoverability
+
+(defalias #'blist #'blist-list-bookmarks)
+
;;;###autoload
(defun blist-list-bookmarks (&rest _args)
"List bookmarks in an ibuffer fashion.
@@ -322,7 +325,7 @@ used as a `revert-buffer-function'."
(interactive)
;; load the bookmark if needed
(bookmark-maybe-load-default-file)
- (let ((buffer (get-buffer-create bookmark-bmenu-buffer))
+ (let ((buffer (get-buffer-create blist-buffer-name))
(first-time-generated t))
(with-current-buffer buffer
(let ((inhibit-read-only t)
@@ -379,7 +382,7 @@ used as a `revert-buffer-function'."
bookmark-alist
(append
(list ilist-mark-column
- blist-annotation-column
+ (blist-annotation-column)
(blist-name-column))
(cond
(blist-display-location-p (list blist-location-column))))
@@ -413,7 +416,7 @@ used as a `revert-buffer-function'."
((goto-char (line-beginning-position)))))
(blist-mode))
(display-buffer buffer)
- (select-window (get-buffer-window bookmark-bmenu-buffer))
+ (select-window (get-buffer-window blist-buffer-name))
;; if generated for the first time, advance a line
(cond
(first-time-generated (ilist-forward-line 1 nil t)))))
@@ -887,8 +890,14 @@ bookmark at point, use `completing-read' to choose one."
(complete-with-action
action items str pred)))
nil t)))
- ((user-error "No bookmarks to show")))))
- ((user-error "No bookmarks to show")))))
+ ((user-error
+ (concat
+ "No bookmarks selected or the selected "
+ "bookmarks have no annotations"))))))
+ ((user-error
+ (concat
+ "No bookmarks selected or the selected "
+ "bookmarks have no annotations"))))))
(blist-show-all-annotations targets)))
;;;; show all annotations
- [elpa] externals/blist 896e5568f8 04/31: More features, (continued)
- [elpa] externals/blist 896e5568f8 04/31: More features, ELPA Syncer, 2021/12/28
- [elpa] externals/blist a4c0a7626f 07/31: fix defcustom problem, ELPA Syncer, 2021/12/28
- [elpa] externals/blist fa54e09b57 03/31: More features, ELPA Syncer, 2021/12/28
- [elpa] externals/blist a24f9d6d35 06/31: fix `blist-select', ELPA Syncer, 2021/12/28
- [elpa] externals/blist a0b9bc4eb5 18/31: * blist.el (blist-relocate): Fix a bug caused by a typo., ELPA Syncer, 2021/12/28
- [elpa] externals/blist 950a214456 28/31: New option: blist-use-header-p, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 4a5eb414f7 27/31: Fix errors and byte-compile, ELPA Syncer, 2021/12/28
- [elpa] externals/blist db67745821 13/31: Fix some README issues, ELPA Syncer, 2021/12/28
- [elpa] externals/blist c868a2d8b3 24/31: * blist.el (blist-all-bookmarks): refactor, ELPA Syncer, 2021/12/28
- [elpa] externals/blist eddd17ce4d 14/31: try to fix image, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 4a4d94c09d 20/31: blist.el: QoL refinements,
ELPA Syncer <=
- [elpa] externals/blist c2f4bc47d4 25/31: fix previous bugs caused by invisibility, ELPA Syncer, 2021/12/28
- [elpa] externals/blist f1b556af33 12/31: Add README, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 48510bdefa 05/31: preserve the original point in building the list, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 41735b2a03 08/31: Make `blist-list-bookmarks' interactive, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 1bac76696c 09/31: fix a wrong function call, ELPA Syncer, 2021/12/28
- [elpa] externals/blist c5145aea0e 02/31: Fix documentations., ELPA Syncer, 2021/12/28
- [elpa] externals/blist 0f0ceddf53 26/31: Refine the ChangeLog., ELPA Syncer, 2021/12/28
- [elpa] externals/blist 81d5a0fe71 19/31: blist: refine functions to display annotations, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 65ff602eee 30/31: blist: Add a variable to choose features, ELPA Syncer, 2021/12/28
- [elpa] externals/blist 5fd8b00d72 22/31: implement hiding groups by buffer-invisibility-spec, ELPA Syncer, 2021/12/28