[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient bbf81297c6 041/366: Prevent infix commands fr
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient bbf81297c6 041/366: Prevent infix commands from being added to command-history |
Date: |
Tue, 25 Jan 2022 18:54:24 -0500 (EST) |
branch: externals/transient
commit bbf81297c6e3a66aa1f4dd44eebddb4901bb1f13
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Prevent infix commands from being added to command-history
Closes #23.
---
docs/transient.org | 13 ++++++-------
docs/transient.texi | 13 ++++++-------
lisp/transient.el | 36 ++++++++++++++++++------------------
3 files changed, 30 insertions(+), 32 deletions(-)
diff --git a/docs/transient.org b/docs/transient.org
index b92c7c88a0..8dc9543e57 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-32-g08b4778+1)
+#+SUBTITLE: for version 0.1.0 (v0.1.0-39-gb1da0ca+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-32-g08b4778+1).
+This manual is for Transient version 0.1.0 (v0.1.0-39-gb1da0ca+1).
#+BEGIN_QUOTE
Copyright (C) 2018-2019 Jonas Bernoulli <jonas@bernoul.li>
@@ -908,11 +908,10 @@ suffixes".
The function definitions is always:
#+BEGIN_SRC emacs-lisp
- (lambda (obj value)
- (interactive
- (let ((obj (transient-suffix-object)))
- (list obj (transient-infix-read obj))))
- (transient-infix-set obj value)
+ (lambda ()
+ (interactive)
+ (let ((obj (transient-suffix-object)))
+ (transient-infix-set obj (transient-infix-read obj)))
(transient--show))
#+END_SRC
diff --git a/docs/transient.texi b/docs/transient.texi
index 35d93f0781..49f9fe5a2d 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-32-g08b4778+1)
+@subtitle for version 0.1.0 (v0.1.0-39-gb1da0ca+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-32-g08b4778+1).
+This manual is for Transient version 0.1.0 (v0.1.0-39-gb1da0ca+1).
@quotation
Copyright (C) 2018-2019 Jonas Bernoulli <jonas@@bernoul.li>
@@ -1133,11 +1133,10 @@ explicitly.
The function definitions is always:
@lisp
-(lambda (obj value)
- (interactive
- (let ((obj (transient-suffix-object)))
- (list obj (transient-infix-read obj))))
- (transient-infix-set obj value)
+(lambda ()
+ (interactive)
+ (let ((obj (transient-suffix-object)))
+ (transient-infix-set obj (transient-infix-read obj)))
(transient--show))
@end lisp
diff --git a/lisp/transient.el b/lisp/transient.el
index 48e4b7f21b..ea68131151 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -655,11 +655,10 @@ explicitly.
The function definitions is always:
- (lambda (obj value)
- (interactive
- (let ((obj (transient-suffix-object)))
- (list obj (transient-infix-read obj))))
- (transient-infix-set obj value)
+ (lambda ()
+ (interactive)
+ (let ((obj (transient-suffix-object)))
+ (transient-infix-set obj (transient-infix-read obj)))
(transient--show))
`transient-infix-read' and `transient-infix-set' are generic
@@ -802,11 +801,10 @@ example, sets a variable use `define-infix-command'
instead.
args)))
(defun transient--default-infix-command ()
- (cons 'lambda '((obj value)
- (interactive
- (let ((obj (transient-suffix-object)))
- (list obj (transient-infix-read obj))))
- (transient-infix-set obj value)
+ (cons 'lambda '(()
+ (interactive)
+ (let ((obj (transient-suffix-object)))
+ (transient-infix-set obj (transient-infix-read obj)))
(transient--show))))
(defun transient--ensure-infix-command (obj)
@@ -997,17 +995,19 @@ Each suffix commands is associated with an object, which
holds
additional information about the suffix, such as its value (in
the case of an infix command, which is a kind of suffix command).
-This function is intended to be called in the interactive form of
-infix commands, whose command definition usually (at least when
-defined using `define-infix-command') is this:
+This function is intended to be called by infix commands, whose
+command definition usually (at least when defined using
+`define-infix-command') is this:
- (lambda (obj value)
- (interactive
- (let ((obj (transient-suffix-object)))
- (list obj (transient-infix-read obj))))
- (transient-infix-set obj value)
+ (lambda ()
+ (interactive)
+ (let ((obj (transient-suffix-object)))
+ (transient-infix-set obj (transient-infix-read obj)))
(transient--show))
+\(User input is read outside of `interactive' to prevent the
+command from being added to `command-history'. See #23.)
+
Such commands need to be able to access their associated object
to guide how `transient-infix-read' reads the new value and to
store the read value. Other suffix commands (including non-infix
- [elpa] externals/transient 6236a4fd38 019/366: Bind ESC ESC ESC in all maps, (continued)
- [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, 2022/01/25
- [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 <=
- [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
- [elpa] externals/transient a47ae9499b 049/366: transient-{set, save}: Support exiting the transient, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9e30038d2d 051/366: transient-set-level: Limit when it is called, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 544b3bb864 057/366: Support automatically disabling incompatible arguments, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 28aac32e82 058/366: Fix previous commit, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 4f7ee36899 060/366: transient-infix-set: Bugfixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7a7c3e15b6 065/366: transient-show-popup: Support even suppressing one-line summary, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient d7a1e81440 067/366: transient-show-popup: Update documentation, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5a360bb206 090/366: Remove conflicting suffix when inserting new suffix, Jonas Bernoulli, 2022/01/25