emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient 427e36046a 131/366: transient-force-fixed-pit


From: Jonas Bernoulli
Subject: [elpa] externals/transient 427e36046a 131/366: transient-force-fixed-pitch: New option
Date: Tue, 25 Jan 2022 18:54:33 -0500 (EST)

branch: externals/transient
commit 427e36046a288f60e318d8b1e5b5c45e8a1a3062
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient-force-fixed-pitch: New option
    
    Re #25.  Closes #67.
---
 docs/CHANGELOG      |  4 ++++
 docs/transient.org  | 12 ++++++++++--
 docs/transient.texi | 13 +++++++++++--
 lisp/transient.el   | 20 +++++++++++++++++++-
 4 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index bf7e4f5fa5..ee0b90fffb 100644
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -11,6 +11,10 @@
   non-standard value for ~transient-display-buffer-action~ it may
   be necessary to do that.  #17
 
+- The new option ~transient-force-fixed-pitch~ allows users to use a
+  monospaced font in transient's popup buffer even if they use a
+  proportional font for the rest of Emacs.  #25, #67
+
 - Added new commands ~transient-scroll-up~ and ~transient-scroll-down~,
   which scroll the transient window.  ~C-v~ and ~M-v~ (and ~<next>~ and
   ~<prior>~) are bound to these commands.  These keys were chosen they
diff --git a/docs/transient.org b/docs/transient.org
index 590aa1cb9a..01d4cd641c 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -8,7 +8,7 @@
 #+TEXINFO_DIR_CATEGORY: Emacs
 #+TEXINFO_DIR_TITLE: Transient: (transient).
 #+TEXINFO_DIR_DESC: Transient Commands
-#+SUBTITLE: for version 0.1.0 (v0.1.0-115-gad7f255+1)
+#+SUBTITLE: for version 0.1.0 (v0.1.0-129-gc1ae1ee+1)
 
 #+TEXINFO_DEFFN: t
 #+OPTIONS: H:4 num:4 toc:2
@@ -37,7 +37,7 @@ Calling a suffix command usually causes the transient to be 
exited
 but suffix commands can also be configured to not exit the transient.
 
 #+TEXINFO: @noindent
-This manual is for Transient version 0.1.0 (v0.1.0-115-gad7f255+1).
+This manual is for Transient version 0.1.0 (v0.1.0-129-gc1ae1ee+1).
 
 #+BEGIN_QUOTE
 Copyright (C) 2018-2019 Jonas Bernoulli <jonas@bernoul.li>
@@ -617,6 +617,14 @@ window, and the key bindings are the same as for 
~scroll-up-command~ and
   predicates of those suffixes prevent that more than one of them is
   enabled at a time.
 
+- User Option: transient-force-fixed-pitch
+
+  This option controls whether to force the use of a monospaced font
+  in 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.
+
 * Modifying Existing Transients
 
 To an extent transients can be customized interactively, see [[*Enabling
diff --git a/docs/transient.texi b/docs/transient.texi
index d61ec31954..ac13e8fc32 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -31,7 +31,7 @@ General Public License for more details.
 @finalout
 @titlepage
 @title Transient User and Developer Manual
-@subtitle for version 0.1.0 (v0.1.0-115-gad7f255+1)
+@subtitle for version 0.1.0 (v0.1.0-129-gc1ae1ee+1)
 @author Jonas Bernoulli
 @page
 @vskip 0pt plus 1filll
@@ -65,7 +65,7 @@ Calling a suffix command usually causes the transient to be 
exited
 but suffix commands can also be configured to not exit the transient.
 
 @noindent
-This manual is for Transient version 0.1.0 (v0.1.0-115-gad7f255+1).
+This manual is for Transient version 0.1.0 (v0.1.0-129-gc1ae1ee+1).
 
 @quotation
 Copyright (C) 2018-2019 Jonas Bernoulli <jonas@@bernoul.li>
@@ -808,6 +808,15 @@ predicates of those suffixes prevent that more than one of 
them is
 enabled at a time.
 @end defopt
 
+@defopt transient-force-fixed-pitch
+
+This option controls whether to force the use of a monospaced font
+in popup buffer.  Even if you use a proportional font for the
+@code{default} face, you might still want to use a monospaced font in
+transient's popup buffer.  Setting this option to t causes @code{default}
+to be remapped to @code{fixed-pitch} in that buffer.
+@end defopt
+
 @node Modifying Existing Transients
 @chapter Modifying Existing Transients
 
diff --git a/lisp/transient.el b/lisp/transient.el
index f76ca8dba2..148e84354b 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -230,6 +230,17 @@ used."
   :group 'transient
   :type 'boolean)
 
+(defcustom transient-force-fixed-pitch nil
+  "Whether to force used of monospaced font in 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."
+  :package-version '(transient . "0.2.0")
+  :group 'transient
+  :type 'boolean)
+
 (defcustom transient-default-level 4
   "Control what suffix levels are made available by default.
 
@@ -2529,6 +2540,8 @@ have a history of their own.")
             (window-size-fixed nil))
         (fit-window-to-buffer nil nil 1))
       (goto-char (point-min))
+      (when transient-force-fixed-pitch
+        (transient--force-fixed-pitch))
       (when transient-enable-popup-navigation
         (transient--goto-button focus)))))
 
@@ -3085,7 +3098,7 @@ search instead."
        (or (memq this-command '(top-level abort-recursive-edit))
            (string-prefix-p "edebug" (symbol-name this-command)))))
 
-;;;; Other Packages
+;;;; Miscellaneous
 
 (declare-function which-key-mode "which-key" (&optional arg))
 
@@ -3129,6 +3142,11 @@ we stop there."
           ((string-equal key "Q") "M-q")
           (t key))))
 
+(defun transient--force-fixed-pitch ()
+  (require 'face-remap)
+  (face-remap-reset-base 'default)
+  (face-remap-add-relative 'default 'fixed-pitch))
+
 ;;;; Missing from Emacs
 
 (defun transient--seq-reductions-from (function sequence initial-value)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]