branch: externals/transient
commit 81a108ba03c8c0cee9d455cfc7c0804c850cb99a
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    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'.)
---
 lisp/transient.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 48b180aec4..bc2fde7d10 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

Reply via email to