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

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

[elpa] externals/ellama f11b0c6896 6/9: Signal user error in ellama-cont


From: ELPA Syncer
Subject: [elpa] externals/ellama f11b0c6896 6/9: Signal user error in ellama-context-add-selection
Date: Wed, 3 Apr 2024 15:58:57 -0400 (EDT)

branch: externals/ellama
commit f11b0c68965c9fd8371f1fb3d65ba13022113899
Author: Roman Scherer <roman@burningswell.com>
Commit: Roman Scherer <roman@burningswell.com>

    Signal user error in ellama-context-add-selection
---
 ellama.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ellama.el b/ellama.el
index b0f253d6de..c1ca1ceedd 100644
--- a/ellama.el
+++ b/ellama.el
@@ -883,10 +883,11 @@ If EPHEMERAL non nil new session will not be associated 
with any file."
 (defun ellama-context-add-selection ()
   "Add file to context."
   (interactive)
-  ;; TODO: Use region-active-p
-  (let* ((content (buffer-substring-no-properties (region-beginning) 
(region-end)))
-         (element (ellama-context-element-text :content content)))
-    (ellama-context-element-add element)))
+  (if (region-active-p)
+      (let* ((content (buffer-substring-no-properties (region-beginning) 
(region-end)))
+             (element (ellama-context-element-text :content content)))
+        (ellama-context-element-add element))
+    (user-error "No active region")))
 
 ;;;###autoload
 (defun ellama-context-add-info-node (node)



reply via email to

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