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

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

[elpa] externals/transient 2033ac1ed9 031/366: transient-mode-line-forma


From: Jonas Bernoulli
Subject: [elpa] externals/transient 2033ac1ed9 031/366: transient-mode-line-format: New option
Date: Tue, 25 Jan 2022 18:54:23 -0500 (EST)

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

    transient-mode-line-format: New option
---
 docs/CHANGELOG      |  6 ++++++
 docs/transient.org  | 23 +++++++++++++++++++++--
 docs/transient.texi | 23 +++++++++++++++++++++--
 lisp/transient.el   | 41 ++++++++++++++++++++++++++++++++++++-----
 4 files changed, 84 insertions(+), 9 deletions(-)

diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 32db5f4376..990d7ab44d 100644
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -5,6 +5,12 @@
   specify how a window is selected to display the transient popup
   buffer.  The ~lv~ library is no longer used.  #17
 
+- The new option ~transient-mode-line-format~ allows users to use
+  a mode-line for the transient popup buffer instead of just a
+  thin line that separates it from the echo area.  When using a
+  non-standard value for ~transient-display-buffer-action~ it may
+  be necessary to do that.  #17
+
 - The window that was selected before the transient window was shown
   is no longer re-selected before calling a suffix that exits the
   transient.  If a suffix changes the selected window unintentionally,
diff --git a/docs/transient.org b/docs/transient.org
index 809c09dfe2..7e6251e830 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-28-g625683c+1)
+#+SUBTITLE: for version 0.1.0 (v0.1.0-29-g7e45a57+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-28-g625683c+1).
+This manual is for Transient version 0.1.0 (v0.1.0-29-g7e45a57+1).
 
 #+BEGIN_QUOTE
 Copyright (C) 2018-2019 Jonas Bernoulli <jonas@bernoul.li>
@@ -524,6 +524,25 @@ as many additional suffixes as you hoped.)
   If the window manager selects the new window (Emacs frame),
   then it doesn't work.
 
+  If you change the value of this option, then you might also want
+  to change the value of ~transient-mode-line-format~.
+
+- User Option: transient-mode-line-format
+
+  This option controls whether the transient popup buffer has a
+  mode-line, separator line, or neither.
+
+  If ~nil~, then the buffer has no mode-line.  If the buffer is not
+  displayed right above the echo area, then this probably is not a
+  good value.
+
+  If ~line~ (the default), then the buffer also has no mode-line, but a
+  thin line is drawn instead, using the background color of the face
+  ~transient-separator~.
+
+  Otherwise this can be any mode-line format.  See ~[[info:elisp#Mode
+  Line Format]] for details.
+
 - User Option: transient-highlight-mismatched-keys
 
   This option controls whether key bindings of infix commands that do
diff --git a/docs/transient.texi b/docs/transient.texi
index befba1b9f1..f217791141 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-28-g625683c+1)
+@subtitle for version 0.1.0 (v0.1.0-29-g7e45a57+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-28-g625683c+1).
+This manual is for Transient version 0.1.0 (v0.1.0-29-g7e45a57+1).
 
 @quotation
 Copyright (C) 2018-2019 Jonas Bernoulli <jonas@@bernoul.li>
@@ -680,6 +680,25 @@ It may be possible to display the window in another frame, 
but
 whether that works in practice depends on the window-manager.
 If the window manager selects the new window (Emacs frame),
 then it doesn't work.
+
+If you change the value of this option, then you might also want
+to change the value of @code{transient-mode-line-format}.
+@end defopt
+
+@defopt transient-mode-line-format
+
+This option controls whether the transient popup buffer has a
+mode-line, separator line, or neither.
+
+If @code{nil}, then the buffer has no mode-line.  If the buffer is not
+displayed right above the echo area, then this probably is not a
+good value.
+
+If @code{line} (the default), then the buffer also has no mode-line, but a
+thin line is drawn instead, using the background color of the face
+@code{transient-separator}.
+
+Otherwise this can be any mode-line format.  See ~@ref{Mode Line 
Format,,,elisp,} for details.
 @end defopt
 
 @defopt transient-highlight-mismatched-keys
diff --git a/lisp/transient.el b/lisp/transient.el
index a4db1422c3..453b116ee4 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -105,12 +105,37 @@ see info node `(elisp)Display Action Functions'.
 It may be possible to display the window in another frame, but
 whether that works in practice depends on the window-manager.
 If the window manager selects the new window (Emacs frame),
-then it doesn't work."
+then it doesn't work.
+
+If you change the value of this option, then you might also
+want to change the value of `transient-mode-line-format'."
   :package-version '(transient . "0.2.0")
   :group 'transient
   :type '(cons (choice function (repeat :tag "Functions" function))
                alist))
 
+(defcustom transient-mode-line-format 'line
+  "The mode-line format for the transient popup buffer.
+
+If nil, then the buffer has no mode-line.  If the buffer is not
+displayed right above the echo area, then this probably is not
+a good value.
+
+If `line' (the default), then the buffer also has no mode-line,
+but a thin line is drawn instead, using the background color of
+the face `transient-separator'.
+
+Otherwise this can be any mode-line format.
+See `mode-line-format' for details."
+  :package-version '(transient . "0.2.0")
+  :group 'transient
+  :type '(choice (const :tag "hide mode-line" nil)
+                 (const :tag "substitute thin line" line)
+                 (const :tag "name of prefix command"
+                        ("%e" mode-line-front-space
+                         mode-line-buffer-identification))
+                 (sexp  :tag "custom mode-line format")))
+
 (defcustom transient-show-common-commands nil
   "Whether to show common transient suffixes in the popup buffer.
 
@@ -302,6 +327,7 @@ See info node `(transient)Enabling and Disabling Suffixes'."
   '((((class color) (background light)) :background "grey80")
     (((class color) (background  dark)) :background "grey30"))
   "Face used to draw line below transient popup window.
+This is only used if `transient-mode-line-format' is `line'.
 Only the background color is significant."
   :group 'transient-faces)
 
@@ -2235,16 +2261,21 @@ have a history of their own.")
       (set-window-dedicated-p transient--window t)
       (set-window-parameter transient--window 'no-other-window t)
       (setq window-size-fixed t)
-      (setq mode-line-format nil)
+      (setq mode-line-format (if (eq transient-mode-line-format 'line)
+                                 nil
+                               transient-mode-line-format))
+      (setq mode-line-buffer-identification
+            (symbol-name (oref transient--prefix command)))
       (setq cursor-type nil)
       (setq display-line-numbers nil)
       (setq show-trailing-whitespace nil)
       (transient--insert-groups)
       (when (or transient--helpp transient--editp)
         (transient--insert-help))
-      (insert
-       (propertize "__" 'face 'transient-separator 'display '(space :height 
(1)))
-       (propertize "\n" 'face 'transient-separator 'line-height t))
+      (when (eq transient-mode-line-format 'line)
+        (insert (propertize "__" 'face 'transient-separator
+                            'display '(space :height (1))))
+        (insert (propertize "\n" 'face 'transient-separator 'line-height t)))
       (let ((window-resize-pixelwise t)
             (window-size-fixed nil))
         (fit-window-to-buffer nil nil 1))



reply via email to

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