[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient a729bbba45 022/366: transient--ensure-infix-c
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient a729bbba45 022/366: transient--ensure-infix-command: Avoid false-positives |
Date: |
Tue, 25 Jan 2022 18:54:23 -0500 (EST) |
branch: externals/transient
commit a729bbba4529f38a56849699c66a1d020963ba62
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--ensure-infix-command: Avoid false-positives
This function is supposed to generate the command for an anonymous
infix argument but until now it also generated a command for other
kinds of suffixes if the command was not defined or autoloaded.
Now this function detects that issue and raises an informative error
instead of defining a bogus command, which then caused a confusing
error later on.
Closes https://github.com/magit/magit/issues/3761.
---
lisp/transient.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index c58349a7bf..ba1210ffe6 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -752,8 +752,12 @@ example, sets a variable use `define-infix-command'
instead.
(let ((cmd (oref obj command)))
(unless (or (commandp cmd)
(get cmd 'transient--infix-command))
- (put cmd 'transient--infix-command
- (transient--default-infix-command)))))
+ (if (or (cl-typep obj 'transient-switch)
+ (cl-typep obj 'transient-option))
+ (put cmd 'transient--infix-command
+ (transient--default-infix-command))
+ ;; This is not an anonymous infix argument.
+ (error "Suffix %s is not defined or autoloaded as a command" cmd)))))
(defun transient--derive-shortarg (arg)
(save-match-data
- [elpa] externals/transient eade425ec6 044/366: transient-init-value: Define catch all method using cl-defgeneric, (continued)
- [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
- [elpa] externals/transient 1e8dfe954a 070/366: transient--window: Add doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 99d3bf6e76 014/366: transient--show-brief: Don't show binding for transient-set-level, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 170a3fd791 005/366: make: Don't try to build removed transient-demo.el, Jonas Bernoulli, 2022/01/25
- [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 <=
- [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, 2022/01/25
- [elpa] externals/transient 08b4778890 033/366: Make it trivial to use "q" to quit again, Jonas Bernoulli, 2022/01/25