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

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

[elpa] externals/ellama 9677839c08 05/11: feat: keymap with new entries/


From: ELPA Syncer
Subject: [elpa] externals/ellama 9677839c08 05/11: feat: keymap with new entries/aliases, add doc on new features
Date: Mon, 18 Dec 2023 00:57:44 -0500 (EST)

branch: externals/ellama
commit 9677839c08e729a180f68d43962a168d6e0e41f0
Author: Rahul Martim Juliato <rahul.juliato@gmail.com>
Commit: Rahul Martim Juliato <rahul.juliato@gmail.com>

    feat: keymap with new entries/aliases, add doc on new features
---
 README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ellama.el | 78 +++++++++++++++++++++++++++++++++++++++++++--------------------
 2 files changed, 121 insertions(+), 24 deletions(-)

diff --git a/README.md b/README.md
index 1f168519cc..02f3ab0793 100644
--- a/README.md
+++ b/README.md
@@ -145,11 +145,78 @@ Create a markdown table from the active region or the 
current buffer using Ellam
 
 Summarize a webpage fetched from a URL using Ellama.
 
+### ellama-code-complete
+
+Alias to the `ellama-complete-code` function.
+
+### ellama-code-add
+
+Alias to the `ellama-add-code` function.
+
+### ellama-code-edit
+
+Alias to the `ellama-change-code` function.
+
+### ellama-code-improve
+
+Alias to the `ellama-enhance-code` function.
+
+### ellama-improve-wording
+
+Alias to the `ellama-enhance-wording` function.
+
+### ellama-improve-grammar
+
+Alias to the `ellama-enhance-grammar-spelling` function.
+
+### ellama-improve-conciseness
+
+Alias to the `ellama-make-concise` function.
+
+### ellama-make-format
+
+Alias to the `ellama-render` function.
+
+### ellama-ask-interactive
+Alias to the `ellama-ask` function.
+
+
+## Keymap
+
+Here is a table of keybindings and their associated functions in
+Ellama, using the `C-x e` prefix:
+
+| Keymap | Function                   | Description                        |
+|--------|----------------------------|------------------------------------|
+| "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                        |
+| "s s"  | ellama-summarize           | Summarize                          |
+| "s w"  | ellama-summarize-webpage   | Summarize webpage                  |
+| "i w"  | ellama-improve-wording     | Improve wording                    |
+| "i g"  | ellama-improve-grammar     | Improve grammar and spelling       |
+| "i c"  | ellama-improve-conciseness | Improve conciseness                |
+| "m l"  | ellama-make-list           | Make list                          |
+| "m t"  | ellama-make-table          | Make table                         |
+| "m f"  | ellama-make-format         | Make format                        |
+| "a a"  | ellama-ask-about           | Ask about                          |
+| "a i"  | ellama-ask-interactive     | Chat with ellama (Interactive)     |
+| "t"    | ellama-translate           | Translate the selected region      |
+| "d"    | ellama-define-word         | Define selected word               |
+
+
 ## Configuration
 
 The following variables can be customized for the Ellama client:
 
 - `ellama-buffer`: The default Ellama buffer name.
+- `ellama-enable-break-lines`: Enable visual-mode to \*\*ellama\*\*
+  buffers, hence avoiding the need of horizontal scrolling on long
+  lines.
+- `ellama-enable-keymap`: Enable the Ellama keymap.
+- `ellama-keymap-prefix`: The keymap prefix for Ellama.
 - `ellama-user-nick`: The user nick in logs.
 - `ellama-assistant-nick`: The assistant nick in logs.
 - `ellama-buffer-mode`: The major mode for the Ellama logs buffer.
diff --git a/ellama.el b/ellama.el
index 3301ea0d8c..378fe326ce 100644
--- a/ellama.el
+++ b/ellama.el
@@ -121,27 +121,33 @@
   (define-key global-map (kbd ellama-keymap-prefix) ellama-keymap)
 
   (let ((key-commands
-         '(("a a"   ellama-ask-about "Ask about selected region")
-           ("m c"   ellama-make-concise "Better text")
-           ("c h"   ellama-chat "Chat with Ellama")
-           ("d w"   ellama-define-word "Define selected word")
-           ("c r"   ellama-code-review "Code-review selected code")
-           ("s m"   ellama-summarize "Summarize selected region")
-           ("s w"   ellama-summarize-webpage "Summarize a web page")
-           ("t"     ellama-translate "Translate the selected region")
-           ("r"     ellama-render "Convert text to a specified format")
-           ("e g s" ellama-enhance-grammar-spelling "Enhance grammar and 
spelling")
-           ("e w"   ellama-enhance-wording "Enhance wording")
-           ("e c"   ellama-enhance-code "Enhance selected code")
-           ("c c"   ellama-change-code "Replace selected code")
-           ("m l"   ellama-make-list "Create a markdown list")
-           ("m t"   ellama-make-table "Generate a markdown table")
-           ("c o"   ellama-complete-code "Complete selected code")
-           ("a c"   ellama-add-code "Add new code based on description"))))
-    (dolist (key-command key-commands)
-      (let ((key (car key-command))
-            (function (cadr key-command)))
-        (eval `(define-key ellama-keymap (kbd ,key) ',function))))))
+          '(
+             ;; 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 "Chat with ellama")
+                  ;; other
+                  ("t"   ellama-translate "Translate the selected region")
+                  ("d"   ellama-define-word "Define selected word"))))
+            (dolist (key-command key-commands)
+            (define-key ellama-keymap (kbd (car key-command)) (cadr 
key-command)))))
+
 
 (defcustom ellama-keymap-prefix "C-x e"
   "Key sequence for Ellama Commands."
@@ -159,9 +165,6 @@
            ;; If ellama-enable-keymap is nil, remove the key bindings
            (define-key global-map (kbd ellama-keymap-prefix) nil))))
 
-
-
-
 (defun ellama-stream (prompt &rest args)
   "Query ellama for PROMPT.
 ARGS contains keys for fine control.
@@ -301,6 +304,33 @@ In BUFFER at POINT will be inserted result between PREFIX 
and SUFFIX."
 ;;;###autoload
 (defalias 'ellama-ask 'ellama-chat)
 
+;;;###autoload
+(defalias 'ellama-code-complete 'ellama-complete-code)
+
+;;;###autoload
+(defalias 'ellama-code-add 'ellama-add-code)
+
+;;;###autoload
+(defalias 'ellama-code-edit 'ellama-change-code)
+
+;;###autoload
+(defalias 'ellama-code-improve 'ellama-enhance-code)
+
+;;;###autoload
+(defalias 'ellama-improve-wording 'ellama-enhance-wording)
+
+;;;###autoload
+(defalias 'ellama-improve-grammar 'ellama-enhance-grammar-spelling)
+
+;;;###autoload
+(defalias 'ellama-improve-conciseness 'ellama-make-concise)
+
+;;;###autoload
+(defalias 'ellama-make-format 'ellama-render)
+
+;;;###autoload
+(defalias 'ellama-ask-interactive 'ellama-ask)
+
 ;;;###autoload
 (defun ellama-ask-about ()
   "Ask ellama about selected region or current buffer."



reply via email to

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