gptel-transient: Remove "-ts" suffix from major mode (#259)

gptel-transient (gptel--rewrite-message): Remove "-ts" suffix from
major mode.
This commit is contained in:
Fredrik Bergroth 2024-03-20 02:06:48 +01:00 committed by GitHub
parent 5d069cfca8
commit 9bc54bed9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,7 +101,9 @@ Or is it the other way around?"
"Set a generic refactor/rewrite message for the buffer." "Set a generic refactor/rewrite message for the buffer."
(if (derived-mode-p 'prog-mode) (if (derived-mode-p 'prog-mode)
(format "You are a %s programmer. Refactor the following code. Generate only code, no explanation." (format "You are a %s programmer. Refactor the following code. Generate only code, no explanation."
(substring (symbol-name major-mode) nil -5)) (thread-last (symbol-name major-mode)
(string-remove-suffix "-mode")
(string-remove-suffix "-ts")))
(format "You are a prose editor. Rewrite the following text to be more professional."))) (format "You are a prose editor. Rewrite the following text to be more professional.")))
(defvar gptel--crowdsourced-prompts-url (defvar gptel--crowdsourced-prompts-url