Take the buffer content if a buffer was chosen
This commit is contained in:
parent
4ab79511c9
commit
b9f47b194c
1 changed files with 3 additions and 1 deletions
4
kagi.el
4
kagi.el
|
@ -436,7 +436,9 @@ result is short, otherwise it is displayed in a new buffer."
|
|||
(list (if (use-region-p)
|
||||
(buffer-substring-no-properties (region-beginning) (region-end))
|
||||
(let ((buffer-or-text (read-buffer (format-prompt "Buffer name or text" nil))))
|
||||
(cond ((get-buffer buffer-or-text) (buffer-string))
|
||||
(cond ((get-buffer buffer-or-text)
|
||||
(with-current-buffer buffer-or-text
|
||||
(buffer-string)))
|
||||
((< 0 (length buffer-or-text)) buffer-or-text)
|
||||
(t (error "No buffer or text entered")))))
|
||||
(kagi--read-language (format-prompt "Target language" nil))
|
||||
|
|
Loading…
Reference in a new issue