[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive d1b68b1a66 048/102: Add: (hyperdrive-entry-form
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/hyperdrive d1b68b1a66 048/102: Add: (hyperdrive-entry-format-alist) Consolidate entry formats |
|
Date: |
Wed, 29 Nov 2023 04:00:52 -0500 (EST) |
branch: elpa/hyperdrive
commit d1b68b1a668e30d4af7b6e7db58081042d6314cd
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Add: (hyperdrive-entry-format-alist) Consolidate entry formats
---
hyperdrive-lib.el | 15 ++++++------
hyperdrive-vars.el | 72 ++++++++++++++++++++----------------------------------
2 files changed, 35 insertions(+), 52 deletions(-)
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 237d7eb19d..27fcde5459 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1364,33 +1364,34 @@ FORMAT may be a format string like the value of
`((?n . ,name)
(?p . ,path)
(?v . ,(if version
- (format hyperdrive-entry-version-format version)
+ (format (alist-get 'version
hyperdrive-format-alist)
+ version)
""))
(?D . ,(if domains
- (format hyperdrive-entry-domains-format
+ (format (alist-get 'domains
hyperdrive-format-alist)
(propertize (string-join domains ",")
'face 'hyperdrive-domain))
""))
(?H . ,(hyperdrive--format-host hyperdrive :with-label t))
- (?k . ,(format hyperdrive-entry-public-key-short-format
+ (?k . ,(format (alist-get 'short-key
hyperdrive-format-alist)
(concat (propertize (substring public-key 0
6)
'face
'hyperdrive-public-key)
"…")))
- (?K . ,(format hyperdrive-entry-public-key-full-format
+ (?K . ,(format (alist-get 'public-key
hyperdrive-format-alist)
(propertize public-key
'face 'hyperdrive-public-key)))
(?N . ,(if nickname
- (format hyperdrive-entry-nickname-format
+ (format (alist-get 'nickname
hyperdrive-format-alist)
(propertize nickname
'face 'hyperdrive-nickname))
""))
(?P . ,(if petname
- (format hyperdrive-entry-petname-format
+ (format (alist-get 'petname
hyperdrive-format-alist)
(propertize petname
'face 'hyperdrive-petname))
""))
(?S . ,(if seed
- (format hyperdrive-entry-seed-format
+ (format (alist-get 'seed
hyperdrive-format-alist)
(propertize seed
'face 'hyperdrive-seed))
""))))
diff --git a/hyperdrive-vars.el b/hyperdrive-vars.el
index b90a36b6b5..abf1b493c1 100644
--- a/hyperdrive-vars.el
+++ b/hyperdrive-vars.el
@@ -177,11 +177,12 @@ Specifiers:
%n Entry name
%p Entry path
-%v Entry version (see `hyperdrive-entry-version-format')
+%H Hyperdrive default host format (see `hyperdrive-default-host-format')
-%H Hyperdrive default host format (see
- `hyperdrive-default-host-format')
+The format of the following specifiers can be configured using
+`hyperdrive-format-alist':
+%v Entry version
%D Hyperdrive domains
%k Hyperdrive public key (short)
%K Hyperdrive public key (full)
@@ -193,7 +194,7 @@ Specifiers:
(defvar hyperdrive-default-entry-format-without-version "[%H] %p"
"Format string for displaying entries without displaying the version.
The format of the following specifiers can be configured using
-`hyperdrive-entry-format-alist', which see.")
+`hyperdrive-format-alist', which see.")
(defcustom hyperdrive-buffer-name-format "[%H] %n%v"
"Format string for buffer names.
@@ -201,47 +202,28 @@ Specifiers are as in `hyperdrive-default-entry-format',
which
see."
:type 'string)
-(defcustom hyperdrive-entry-version-format " (version:%s)"
- "Format string for entry version.
-\"%s\" is replaced with the entry version. Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
-
-(defcustom hyperdrive-entry-domains-format "domains:%s"
- "Format string for entry domains.
-\"%s\" is replaced with the entry domains. Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
-
-(defcustom hyperdrive-entry-nickname-format "nickname:%s"
- "Format string for entry nickname.
-\"%s\" is replaced with the entry nickname Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
-
-(defcustom hyperdrive-entry-petname-format "petname:%s"
- "Format string for entry petname.
-\"%s\" is replaced with the entry petname Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
-
-(defcustom hyperdrive-entry-public-key-full-format "public-key:%s"
- "Format string for entry full public-key.
-\"%s\" is replaced with the entry's full public-key. Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
-
-(defcustom hyperdrive-entry-public-key-short-format "public-key:%s"
- "Format string for entry public-key (short format).
-\"%s\" is replaced with the entry's short public-key. Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
-
-(defcustom hyperdrive-entry-seed-format "seed:%s"
- "Format string for entry seed.
-\"%s\" is replaced with the entry seed Used in
-`hyperdrive-buffer-name-format', which see."
- :type 'string)
+(defcustom hyperdrive-format-alist '((version . " (version:%s)")
+ (domains . "domains:%s")
+ (nickname . "nickname:%s")
+ (petname . "petname:%s")
+ (public-key . "public-key:%s")
+ (short-key . "public-key:%s")
+ (seed . "seed:%s"))
+ "Alist mapping hyperdrive and hyperdrive entry metadata item to format
string.
+Each metadata item may be one of:
+
+- petname
+- nickname
+- version
+- domains
+- public-key
+- short-key
+- seed
+
+In each corresponding format string, \"%s\" is replaced with the
+metadatum. Used in `hyperdrive-buffer-name-format', which see."
+ :type '(alist :key-type symbol :value-type string)
+ :options '(petname nickname version domains public-key short-key seed))
;;;;; Faces
- [nongnu] elpa/hyperdrive f52b33cef4 057/102: Tidy: Docstring, (continued)
- [nongnu] elpa/hyperdrive f52b33cef4 057/102: Tidy: Docstring, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive ccaffb946d 021/102: Change: (hyperdrive-menu-hyperdrive) Remove adhoc mirror command, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 78522efb2b 053/102: Change: (-history) Use --format-entry to generate buffer name, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 4bc553f329 027/102: Fix: (hyperdrive-menu) Only show "Jump" in hyperdrive-dir-mode, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 4a91fe1ac9 010/102: Change: (-menu-hyperdrive) Place trivial lambdas on single lines, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive f5a90f3fb2 031/102: Fix: (hyperdrive-menu) Require hyperdrive, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 4277b29b50 023/102: Comment: Remove TODO, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 227a839bf7 058/102: Comment: Remove TODO, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 2678c1d7ca 064/102: Change: Replace hyperdrive--org- prefix with hyperdrive-org--, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 0b5102ac9c 036/102: Meta: Update CHANGELOG, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive d1b68b1a66 048/102: Add: (hyperdrive-entry-format-alist) Consolidate entry formats,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive cc0e3cdfdf 059/102: Tidy: Indentation, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive fa48b80132 060/102: Improve defcustom, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 98761ce57f 007/102: Change: (-menu-hyperdrive) Move definitions of suffix descriptions, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 807b1fd0df 051/102: Change: (hyperdrive--format-host) Remove :with-faces keyword argument, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive d19558893e 035/102: Fix: Require 'rx, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 22c95b82a4 068/102: Fix: Complete rename of org link functions, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 5883d33fca 099/102: Meta: Update changelog, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive e944a86276 077/102: Docs: Say "file" not "entry", ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive 514d771d5b 070/102: Use shorthands he//, he/, h// and h/, ELPA Syncer, 2023/11/29
- [nongnu] elpa/hyperdrive ace50018fa 084/102: Tidy: Remove Imenu compiler warning workaround, ELPA Syncer, 2023/11/29