[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))
- [elpa] externals/transient 33e96045b4 009/366: transient-substitute-key-function: Drop repeated wording, (continued)
- [elpa] externals/transient 33e96045b4 009/366: transient-substitute-key-function: Drop repeated wording, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a729bbba45 022/366: transient--ensure-infix-command: Avoid false-positives, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6467626e4e 024/366: Stop talking about the "echo area", Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1ffd0ba498 071/366: transient--original-buffer: Renamed from transient--source-buffer, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 892bc840c0 072/366: transient--original-buffer: Set globally, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient fa3b7574bb 087/366: transient--layout-member: Use appropriate argument order, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 20c231e0ec 089/366: transient--layout-member-1: Refactor, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cac657a03e 092/366: Support inserting/removing groups and doing it using coordinates, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6236a4fd38 019/366: Bind ESC ESC ESC in all maps, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e889030b0f 027/366: Quote a parenthesis in a doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2033ac1ed9 031/366: transient-mode-line-format: New option,
Jonas Bernoulli <=
- [elpa] externals/transient 08b4778890 033/366: Make it trivial to use "q" to quit again, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9429cb628a 035/366: transient-scroll-down: Fix pasto, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7e45a57ec8 030/366: No longer depend on lv to display the transient buffer, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 625683c9ea 029/366: transient--pre-exit: Don't reselect original window, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a2dada29c8 034/366: manual: Add a FAQ, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a2222d294c 038/366: transient-base-map: New parent of other shared keymaps, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient b1da0cab5d 040/366: Remove my personal key bindings, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient bbf81297c6 041/366: Prevent infix commands from being added to command-history, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a6295fa7ee 042/366: Declare that prefix and suffix commands are for interactive use only, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2872b4a661 045/366: transient-init-value: Define for transient-prefix, Jonas Bernoulli, 2022/01/25