[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/blist 950a214456 28/31: New option: blist-use-header-p
From: |
ELPA Syncer |
Subject: |
[elpa] externals/blist 950a214456 28/31: New option: blist-use-header-p |
Date: |
Tue, 28 Dec 2021 16:57:41 -0500 (EST) |
branch: externals/blist
commit 950a21445629591c0ff8c1178db247f78859ccc8
Author: JSDurand <mmemmew@gmail.com>
Commit: JSDurand <mmemmew@gmail.com>
New option: blist-use-header-p
* blist.el (blist-use-header-p, blist-list-bookmarks): Now the user
can choose to display column names in the header line.
---
ChangeLog | 5 +++++
blist.el | 26 ++++++++++++++++++++++++--
blist.elc | Bin 46200 -> 46699 bytes
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fdd5c18da0..7c3d6e572c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-12-22 李俊緯 <mmemmew@gmail.com>
+
+ New user option: blist-use-header-p. Now the user can choose to
+ use the header line to display the column names.
+
2021-12-21 李俊緯 <mmemmew@gmail.com>
Fix errors discovered by flymake.
diff --git a/blist.el b/blist.el
index 13e7d3fe5b..657d4339b7 100644
--- a/blist.el
+++ b/blist.el
@@ -232,6 +232,13 @@ list; they are simply ignored."
:group 'blist
:type 'string)
+;;;; Whether to use header or not
+
+(defcustom blist-use-header-p nil
+ "If non-nil, show a header of column names as well."
+ :group 'blist
+ :type 'boolean)
+
;;; Variables
;;;; Sorter
@@ -347,7 +354,8 @@ used as a `revert-buffer-function'."
;; load the bookmark if needed
(bookmark-maybe-load-default-file)
(let ((buffer (get-buffer-create blist-buffer-name))
- (first-time-generated t))
+ (first-time-generated t)
+ blist-header-line-format)
(with-current-buffer buffer
(let ((inhibit-read-only t)
front rear group pos)
@@ -412,6 +420,12 @@ used as a `revert-buffer-function'."
blist-sorter
t))
(goto-char (point-min))
+ ;; set the header if necessary
+ (cond
+ (blist-use-header-p
+ (setq blist-header-line-format
+ (buffer-substring-no-properties
+ (point) (line-end-position)))))
(cond
((and
(stringp rear)
@@ -438,7 +452,15 @@ used as a `revert-buffer-function'."
(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)))))
+ (first-time-generated (ilist-forward-line 1 nil t)))
+ (cond (blist-header-line-format
+ (setq header-line-format blist-header-line-format)
+ (with-silent-modifications
+ (add-text-properties
+ (point-min)
+ (save-excursion
+ (goto-char (point-min)) (forward-line 2) (point))
+ (list (intern "invisible") t)))))))
;;; Major mode
diff --git a/blist.elc b/blist.elc
index 8d7e887bdc..3dc54fa5cb 100644
Binary files a/blist.elc and b/blist.elc differ
- [elpa] branch externals/blist created (now e7d56657eb), ELPA Syncer, 2021/12/28
- [elpa] externals/blist 97a8b93b12 01/31: initial working version, ELPA Syncer, 2021/12/28
- [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 <=
- [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, 2021/12/28
- [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