branch: elpa/gptel
commit 8558841543da35635eab9493cd07d99ee1db1e11
Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>

    gptel-transient: Use more keys in dynamic menus
    
    * gptel-transient.el (gptel--setup-directive-menu, gptel-tools):
    Get a little more breathing room in dynamic gptel menus by using 0-9
    for keybindings.  The tools menu is unfit for task and needs to be
    rewritten, but in the meantime up to 26 + 10 tools per category
    can be bound.  (MCP servers can provide dozens of tools each.)
---
 gptel-transient.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gptel-transient.el b/gptel-transient.el
index 7a9f4deead..2425a392ca 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -687,7 +687,8 @@ MSG is the meaning of symbol, used when messaging.
 If EXTERNAL is non-nil, include external sources of directives."
   (cl-loop for (type . prompt) in gptel-directives
            ;; Avoid clashes with the custom directive key
-           with unused-keys = (delete ?s (number-sequence ?a ?z))
+           with unused-keys = (delete ?s (nconc (number-sequence ?a ?z)
+                                                (number-sequence ?0 ?9)))
            with width = (window-width)
            for name = (symbol-name type)
            for key = (seq-find (lambda (k) (member k unused-keys)) name 
(seq-first unused-keys))
@@ -801,7 +802,8 @@ only (\"oneshot\")."
         nconc
         (cl-loop                    ;for each category, collect tools as 
infixes
          for (name . tool) in tools-alist
-         with tool-keys = (delete category-key (number-sequence ?a ?z))
+         with tool-keys = (delete category-key (nconc (number-sequence ?a ?z)
+                                                      (number-sequence ?0 ?9)))
          for tool-key = (seq-find (lambda (k) (member k tool-keys)) name
                                   (seq-first tool-keys))
          do (setq tool-keys (delete tool-key tool-keys))

Reply via email to