emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ellama 2a9ded036b 6/7: Merge pull request #42 from s-ko


From: ELPA Syncer
Subject: [elpa] externals/ellama 2a9ded036b 6/7: Merge pull request #42 from s-kostyaev/fix-compilation
Date: Mon, 25 Dec 2023 15:57:47 -0500 (EST)

branch: externals/ellama
commit 2a9ded036b896c68178409a567e2bc2af32905c1
Merge: 3b077c0842 4cff555e9b
Author: Sergey Kostyaev <s-kostyaev@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #42 from s-kostyaev/fix-compilation
    
    Fix compilation
---
 ellama.el | 83 ++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/ellama.el b/ellama.el
index 0bf1dec827..407c17e118 100644
--- a/ellama.el
+++ b/ellama.el
@@ -94,6 +94,48 @@
                      `(const ,(car type)))
                    spinner-types)))
 
+(defun ellama-setup-keymap ()
+  "Set up the Ellama keymap and bindings."
+  (interactive)
+  (when (boundp 'ellama-keymap-prefix)
+    (defvar ellama-keymap (make-sparse-keymap)
+      "Keymap for Ellama Commands")
+
+    (define-key global-map (kbd ellama-keymap-prefix) ellama-keymap)
+
+    (let ((key-commands
+          '(;; code
+            ("c c" ellama-code-complete "Code complete")
+            ("c a" ellama-code-add "Code add")
+            ("c e" ellama-code-edit "Code edit")
+            ("c i" ellama-code-improve "Code improve")
+            ("c r" ellama-code-review "Code review")
+            ;; summarize
+            ("s s" ellama-summarize "Summarize")
+            ("s w" ellama-summarize-webpage "Summarize webpage")
+            ;; improve
+            ("i w" ellama-improve-wording "Improve wording")
+            ("i g" ellama-improve-grammar "Improve grammar and spelling")
+            ("i c" ellama-improve-conciseness "Improve conciseness")
+            ;; make
+            ("m l" ellama-make-list "Make list")
+            ("m t" ellama-make-table "Make table")
+            ("m f" ellama-make-format "Make format")
+            ;; ask
+            ("a a" ellama-ask-about "Ask about")
+            ("a i" ellama-ask-interactive "Ask interactively")
+            ("a l" ellama-ask-line "Ask current line")
+            ("a s" ellama-ask-selection "Ask selection")
+            ;; text
+            ("t t" ellama-translate "Text translate")
+            ("t c" ellama-complete "Text complete")
+            ;; define
+            ("d w" ellama-define-word "Define word")
+            ;; provider
+            ("p s" ellama-provider-select "Provider select"))))
+      (dolist (key-command key-commands)
+       (define-key ellama-keymap (kbd (car key-command)) (cadr 
key-command))))))
+
 (defcustom ellama-keymap-prefix "C-c e"
   "Key sequence for Ellama Commands."
   :type 'string
@@ -130,47 +172,6 @@
   ;; Trim left first as `string-trim' trims from the right and ends up 
deleting all the code.
   (string-trim-right (string-trim-left text ellama--code-prefix) 
ellama--code-suffix))
 
-(defun ellama-setup-keymap ()
-  "Set up the Ellama keymap and bindings."
-  (interactive)
-  (defvar ellama-keymap (make-sparse-keymap)
-    "Keymap for Ellama Commands")
-
-  (define-key global-map (kbd ellama-keymap-prefix) ellama-keymap)
-
-  (let ((key-commands
-        '(;; code
-          ("c c" ellama-code-complete "Code complete")
-          ("c a" ellama-code-add "Code add")
-          ("c e" ellama-code-edit "Code edit")
-          ("c i" ellama-code-improve "Code improve")
-          ("c r" ellama-code-review "Code review")
-          ;; summarize
-          ("s s" ellama-summarize "Summarize")
-          ("s w" ellama-summarize-webpage "Summarize webpage")
-          ;; improve
-          ("i w" ellama-improve-wording "Improve wording")
-          ("i g" ellama-improve-grammar "Improve grammar and spelling")
-          ("i c" ellama-improve-conciseness "Improve conciseness")
-          ;; make
-          ("m l" ellama-make-list "Make list")
-          ("m t" ellama-make-table "Make table")
-          ("m f" ellama-make-format "Make format")
-          ;; ask
-          ("a a" ellama-ask-about "Ask about")
-          ("a i" ellama-ask-interactive "Ask interactively")
-          ("a l" ellama-ask-line "Ask current line")
-          ("a s" ellama-ask-selection "Ask selection")
-          ;; text
-          ("t t" ellama-translate "Text translate")
-          ("t c" ellama-complete "Text complete")
-          ;; define
-          ("d w" ellama-define-word "Define word")
-          ;; provider
-          ("p s" ellama-provider-select "Provider select"))))
-    (dolist (key-command key-commands)
-      (define-key ellama-keymap (kbd (car key-command)) (cadr key-command)))))
-
 (defcustom ellama-enable-keymap t
   "Enable or disable Ellama keymap."
   :type 'boolean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]