branch: elpa/gptel
commit 075376c002d0f0c50e68ffd23c647eeab27fea73
Author: Henrik Ahlgren <pa...@seestieto.com>
Commit: GitHub <nore...@github.com>

    gptel-rewrite: Make rewrite work on Emacs < 29 again (#721)
    
    * gptel-rewrite.el (gptel--rewrite-dispatch): The function
    `rmc--add-key-description' was introduced in Emacs 29, resulting in an
    error for `gptel-rewrite': "mapcar: Symbol’s function definition is
    void: rmc--add-key-description".  For older supported Emacs versions,
    skip this part to restore rewrite functionality, albeit with slightly
    reduced user guidance.  The actual rmc menu remains accessible in the
    minibuffer.
---
 gptel-rewrite.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gptel-rewrite.el b/gptel-rewrite.el
index 8dec3cb57f..05d77b91a6 100644
--- a/gptel-rewrite.el
+++ b/gptel-rewrite.el
@@ -360,7 +360,8 @@ OV is the rewrite overlay, CI is true for interactive 
calls."
            (concat
             (unless (eq (char-before (overlay-start ov)) ?\n) "\n")
             (propertize "REWRITE READY: " 'face 'success)
-            (mapconcat (lambda (e) (cdr e)) (mapcar #'rmc--add-key-description 
choices) ", ")
+           (when (fboundp #'rmc--add-key-description)  ; introduced in Emacs 29
+              (mapconcat (lambda (e) (cdr e)) (mapcar 
#'rmc--add-key-description choices) ", "))
             (propertize
              " " 'display `(space :align-to (- right ,(1+ (length hint-str)))))
             (propertize hint-str 'face 'success)))

Reply via email to