[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient cda6a12042 23/38: transient-align-variable-pi
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient cda6a12042 23/38: transient-align-variable-pitch: New option |
Date: |
Tue, 11 Jan 2022 05:37:45 -0500 (EST) |
branch: externals/transient
commit cda6a12042653b5a5642b9a72332c92fd16ba4f4
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-align-variable-pitch: New option
---
docs/transient.org | 14 ++++++++++++++
lisp/transient.el | 33 +++++++++++++++++++++++++++------
2 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/docs/transient.org b/docs/transient.org
index 304e003609..a6f7009ad6 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -661,6 +661,20 @@ Also see [[* Common Suffix Commands]].
This option controls whether the transient buffer is hidden while
user input is being read in the minibuffer.
+- User Option: transient-align-variable-pitch ::
+
+ This option controls whether columns are align pixel-wise in the
+ popup buffer.
+
+ If this is non-nil, then columns are aligned pixel-wise to support
+ variable-pitch fonts. Keys are not aligned, so you should use a
+ fixed-pitch font for the ~transient-key~ face. Other key faces
+ inherit from that face unless a theme is used that breaks that
+ relationship.
+
+ This option is intended for users who use a variable-pitch font for
+ the ~default~ face.
+
- User Option: transient-force-fixed-pitch ::
This option controls whether to force the use of a monospaced font
diff --git a/lisp/transient.el b/lisp/transient.el
index ad6bb74cb0..e84da4494f 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -317,13 +317,32 @@ used."
:group 'transient
:type 'boolean)
+(defcustom transient-align-variable-pitch nil
+ "Whether to align columns pixel-wise in the popup buffer.
+
+If this is non-nil, then columns are aligned pixel-wise to
+support variable-pitch fonts. Keys are not aligned, so you
+should use a fixed-pitch font for the `transient-key' face.
+Other key faces inherit from that face unless a theme is
+used that breaks that relationship.
+
+This option is intended for users who use a variable-pitch
+font for the `default' face.
+
+Also see `transient-force-fixed-pitch'."
+ :package-version '(transient . "0.4.0")
+ :group 'transient
+ :type 'boolean)
+
(defcustom transient-force-fixed-pitch nil
"Whether to force use of monospaced font in the popup buffer.
Even if you use a proportional font for the `default' face,
you might still want to use a monospaced font in transient's
popup buffer. Setting this option to t causes `default' to
-be remapped to `fixed-pitch' in that buffer."
+be remapped to `fixed-pitch' in that buffer.
+
+Also see `transient-align-variable-pitch'."
:package-version '(transient . "0.2.0")
:group 'transient
:type 'boolean)
@@ -451,7 +470,7 @@ give you as many additional suffixes as you hoped.)"
"Face used for the infix for which the value is being read."
:group 'transient-faces)
-(defface transient-unreachable-key '((t :inherit shadow))
+(defface transient-unreachable-key '((t :inherit (transient-key shadow)))
"Face used for keys unreachable from the current prefix sequence."
:group 'transient-faces)
@@ -3139,7 +3158,8 @@ have a history of their own.")
(push desc rows))
rows))
(oref group suffixes)))
- (vp (oref transient--prefix variable-pitch))
+ (vp (or (oref transient--prefix variable-pitch)
+ transient-align-variable-pitch))
(rs (apply #'max (mapcar #'length columns)))
(cs (length columns))
(cw (mapcar (lambda (col)
@@ -3287,12 +3307,13 @@ Optional support for popup buttons is also implemented
here."
(unless (string-match-p " " key)
(setq pre (replace-regexp-in-string " " "" pre))
(setq suf (replace-regexp-in-string " " "" suf)))
- (concat (propertize pre 'face 'default)
+ (concat (propertize pre 'face 'transient-unreachable-key)
(and (string-prefix-p (concat pre " ") key) " ")
(transient--colorize-key suf cmd)
(save-excursion
- (when (string-match " +\\'" key)
- (match-string 0 key))))))
+ (and (string-match " +\\'" key)
+ (propertize (match-string 0 key)
+ 'face 'fixed-pitch))))))
((transient--lookup-key transient-sticky-map (kbd key))
(transient--colorize-key key cmd))
(t
- [elpa] externals/transient f2e0dfcc4b 11/38: transient--get-predicate-for: Ignore error in transient--suffix-symbol, (continued)
- [elpa] externals/transient f2e0dfcc4b 11/38: transient--get-predicate-for: Ignore error in transient--suffix-symbol, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 3c78b10f52 14/38: transient--redisplay: Don't redisplay during mouse-drag-region, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 4a36b1d922 17/38: Interpret t and nil for sub-prefixes in define-transient-prefix, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 1cdadfddf8 21/38: manual: Use source block, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 777a84d26b 20/38: manual: Document all options, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 51585b8dd7 25/38: transient-reset: New command, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 6c9ae1f46a 27/38: manual: Replace some inaccurate information, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient de5a325616 30/38: Re-align debug declarations, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 12097b72d7 32/38: manual: Regenerate, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 45241225cf 36/38: transient-common-commands: Evaluate lambdas, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient cda6a12042 23/38: transient-align-variable-pitch: New option,
Jonas Bernoulli <=
- [elpa] externals/transient 4c31a10113 31/38: Remove unnecessary with-eval-after-load, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 8b1f8dcc51 35/38: transient--minibuffer-depth: Must always be a number, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 9412f26175 37/38: manual: Use more @itemx, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient bf29731a72 13/38: transient--post-command: Don't pop and push equal redisplay maps, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 22e032ae65 24/38: Move obsolete variable declaration, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 6d721f7490 29/38: Don't use convert-standard-filename when defining path variables, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient ecb815bcae 34/38: transient--abort-commands: Add keyboard-escape-quit, Jonas Bernoulli, 2022/01/11
- [elpa] externals/transient 3de8d9b256 38/38: manual: Fix list item, Jonas Bernoulli, 2022/01/11