diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2024-01-21 20:00:02 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2024-01-21 20:00:02 +0100 |
| commit | 81a108ba03c8c0cee9d455cfc7c0804c850cb99a (patch) | |
| tree | 775ffd86d2b3bf6a9d79b271c88009f1f83cd0b3 | |
| parent | 9a3e1a4469711dd8d6bff134b1e35cf3edb3ecaf (diff) | |
transient--parse-suffix: Avoid overly long symbol names
We already fall back to making the suffix's key part of the name of
the command, when its description is a lambda. Do the same if it is
a named function, and if it is a string, then only use it if it is
less than 16 characters long.
(As a side-note, using the description has the advantage that more
meaningful symbols appear in backtraces. While falling back to using
the key, is less meaningful (and users may change the key, leading to
a mismatch), it is still much more useful than using `gensym'.)
| -rw-r--r-- | lisp/transient.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/transient.el b/lisp/transient.el index 48b180a..bc2fde7 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1140,7 +1140,8 @@ this case, because the `man-page' slot was not set in this case." (format "transient:%s:%s" prefix (let ((desc (plist-get args :description))) - (if (and desc (or (stringp desc) (symbolp desc))) + (if (and (stringp desc) + (length< desc 16)) desc (plist-get args :key))))))) (setq args (plist-put |
