[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient f0213e0543 032/366: Add commands to scroll tr
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient f0213e0543 032/366: Add commands to scroll transient window |
Date: |
Tue, 25 Jan 2022 18:54:23 -0500 (EST) |
branch: externals/transient
commit f0213e05438ba044f0469b00bb8b4fef8b6122cb
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Add commands to scroll transient window
---
docs/CHANGELOG | 3 +++
docs/transient.org | 24 ++++++++++++++++++++++--
docs/transient.texi | 31 +++++++++++++++++++++++++++++--
lisp/transient.el | 30 +++++++++++++++++++++++++++++-
4 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 990d7ab44d..71836707e8 100644
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -11,6 +11,9 @@
non-standard value for ~transient-display-buffer-action~ it may
be necessary to do that. #17
+- Added new commands ~transient-scroll-up~ and ~transient-scroll-down~,
+ which scroll the transient window. #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 7e6251e830..f18c9ad0da 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-29-g7e45a57+1)
+#+SUBTITLE: for version 0.1.0 (v0.1.0-30-g2033ac1+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-29-g7e45a57+1).
+This manual is for Transient version 0.1.0 (v0.1.0-30-g2033ac1+1).
#+BEGIN_QUOTE
Copyright (C) 2018-2019 Jonas Bernoulli <jonas@bernoul.li>
@@ -489,6 +489,26 @@ as many additional suffixes as you hoped.)
Therefore, to control which suffixes are available given a certain
state, you have to make sure that that state is currently active.
+** Other Commands
+
+When invoking a transient in a small frame, the transient window may
+not show the complete buffer, making it necessary to scroll, using the
+following commands. These commands are never shown in the transient
+window, and the key bindings are the same as for ~scroll-up-command~ and
+~scroll-down-command~ in other buffers.
+
+- Command: transient-scroll-up arg
+
+ This command scrolls text of transient popup window upward ARG
+ lines. If ARG is ~nil~, then it scrolls near full screen. This
+ is a wrapper around ~scroll-up-command~ (which see).
+
+- Command: transient-scroll-down arg
+
+ This command scrolls text of transient popup window down ARG
+ lines. If ARG is ~nil~, then it scrolls near full screen. This
+ is a wrapper around ~scroll-down-command~ (which see).
+
* Other Options
- User Option: transient-show-popup
diff --git a/docs/transient.texi b/docs/transient.texi
index f217791141..92d52414ea 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-29-g7e45a57+1)
+@subtitle for version 0.1.0 (v0.1.0-30-g2033ac1+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-29-g7e45a57+1).
+This manual is for Transient version 0.1.0 (v0.1.0-30-g2033ac1+1).
@quotation
Copyright (C) 2018-2019 Jonas Bernoulli <jonas@@bernoul.li>
@@ -108,6 +108,7 @@ Usage
* Using History::
* Getting Help for Suffix Commands::
* Enabling and Disabling Suffixes::
+* Other Commands::
Defining New Commands
@@ -279,6 +280,7 @@ to implementing yet).
* Using History::
* Getting Help for Suffix Commands::
* Enabling and Disabling Suffixes::
+* Other Commands::
@end menu
@node Invoking Transients
@@ -644,6 +646,31 @@ Therefore, to control which suffixes are available given a
certain
state, you have to make sure that that state is currently active.
@end table
+@node Other Commands
+@section Other Commands
+
+When invoking a transient in a small frame, the transient window may
+not show the complete buffer, making it necessary to scroll, using the
+following commands. These commands are never shown in the transient
+window, and the key bindings are the same as for @code{scroll-up-command} and
+@code{scroll-down-command} in other buffers.
+
+@cindex transient-scroll-up arg
+@deffn Command transient-scroll-up arg
+
+This command scrolls text of transient popup window upward ARG
+lines. If ARG is @code{nil}, then it scrolls near full screen. This
+is a wrapper around @code{scroll-up-command} (which see).
+@end deffn
+
+@cindex transient-scroll-down arg
+@deffn Command transient-scroll-down arg
+
+This command scrolls text of transient popup window down ARG
+lines. If ARG is @code{nil}, then it scrolls near full screen. This
+is a wrapper around @code{scroll-down-command} (which see).
+@end deffn
+
@node Other Options
@chapter Other Options
diff --git a/lisp/transient.el b/lisp/transient.el
index 453b116ee4..74958d2986 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1110,6 +1110,8 @@ but unfortunately that does not exist (yet?)."
(define-key map (kbd "C-q") 'transient-quit-all)
(define-key map (kbd "C-z") 'transient-suspend)
(define-key map (kbd "ESC ESC ESC") 'transient-quit-all)
+ (define-key map [remap scroll-up-command] 'transient-scroll-up)
+ (define-key map [remap scroll-down-command]'transient-scroll-down)
map)
"Base keymap used by all transients.")
@@ -1122,6 +1124,8 @@ but unfortunately that does not exist (yet?)."
(define-key map (kbd "C-q") 'transient-quit-all)
(define-key map (kbd "C-z") 'transient-suspend)
(define-key map (kbd "ESC ESC ESC") 'transient-quit-all)
+ (define-key map [remap scroll-up-command] 'transient-scroll-up)
+ (define-key map [remap scroll-down-command]'transient-scroll-down)
map)
"Keymap that is active while a transient in is in \"edit mode\".")
@@ -1131,6 +1135,8 @@ but unfortunately that does not exist (yet?)."
(define-key map (kbd "C-q") 'transient-quit-all)
(define-key map (kbd "C-z") 'transient-suspend)
(define-key map (kbd "ESC ESC ESC") 'transient-quit-all)
+ (define-key map [remap scroll-up-command] 'transient-scroll-up)
+ (define-key map [remap scroll-down-command]'transient-scroll-down)
map)
"Keymap that is active while an incomplete key sequence is active.")
@@ -1186,6 +1192,9 @@ but unfortunately that does not exist (yet?)."
(define-key map [transient-save] 'transient--do-call)
(define-key map [describe-key-briefly] 'transient--do-stay)
(define-key map [describe-key] 'transient--do-stay)
+ (define-key map [transient-scroll-up] 'transient--do-stay)
+ (define-key map [transient-scroll-down] 'transient--do-stay)
+ (define-key map [mwheel-scroll] 'transient--do-stay)
map)
"Base keymap used to map common commands to their transient behavior.
@@ -1599,7 +1608,10 @@ EDIT may be non-nil."
(defun transient--redisplay ()
(if (or (eq transient-show-popup t)
transient--showp)
- (transient--show)
+ (unless (memq this-command '(transient-scroll-up
+ transient-scroll-down
+ mwheel-scroll))
+ (transient--show))
(when (and (numberp transient-show-popup)
(not transient--timer))
(transient--timer-start))
@@ -1844,6 +1856,22 @@ transient is active."
(oset obj value (nth pos hst))
(mapc #'transient-init-value transient--suffixes))))
+(defun transient-scroll-up (&optional arg)
+ "Scroll text of transient popup window upward ARG lines.
+If ARG is nil scroll near full screen. This is a wrapper
+around `scroll-up-command' (which see)."
+ (interactive "^P")
+ (with-selected-window transient--window
+ (scroll-up-command arg)))
+
+(defun transient-scroll-down (&optional arg)
+ "Scroll text of transient popup window down ARG lines.
+If ARG is nil scroll near full screen. This is a wrapper
+around `scroll-down-command' (which see)."
+ (interactive "^P")
+ (with-selected-window transient--window
+ (scroll-up-command arg)))
+
(defun transient-resume ()
"Resume a previously suspended stack of transients."
(interactive)
- [elpa] externals/transient 0758efa1db 015/366: transient--show: Remove trailing whitespace, (continued)
- [elpa] externals/transient 0758efa1db 015/366: transient--show: Remove trailing whitespace, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9183fe1ed2 006/366: Do not use cl-typep, which is broken for objects on Emacs 25, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient be13cd4616 008/366: readme: Fix screenshot url, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ca18bb66d2 012/366: transient--show: Bind lv-use-separator to t, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2f011c9f19 013/366: transient--show-brief: Don't call kbd twice per key, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient db815604b3 025/366: Mention that infixes are suffixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cc54574005 017/366: manual: Prevent evaluation of code blocks, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 328298fb7d 021/366: transient--pp-to-file: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 796f896507 026/366: Add a changelog, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1fa3896986 016/366: manual: Call ox-texinfo+-update-copyright-years while exporting, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f0213e0543 032/366: Add commands to scroll transient window,
Jonas Bernoulli <=
- [elpa] externals/transient 2fed1b4f90 036/366: Change transient-show's key binding, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6a9b8a6bd4 037/366: Bind transient-scroll-{up, down} explicitly, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5f0ec7d08c 039/366: transient-predicate-map: Bind digit-argument, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ebe9d9d354 046/366: transient-{set, save}-value: New generic functions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient eade425ec6 044/366: transient-init-value: Define catch all method using cl-defgeneric, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 93c9a7ecfc 052/366: transient--history-init: Fix doc-string pasto, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f2314ba2a4 059/366: transient-infix-set: Silence byte-compiler, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1c6afb817f 061/366: Teach the mode-related suffix predicates about lists of modes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6506cfdb8b 062/366: define-transient-command: Support :level in suffix definitions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a87cb2c35a 063/366: transient-read-directory: New function, Jonas Bernoulli, 2022/01/25