diff --git a/gptel-transient.el b/gptel-transient.el index 3d8634e..b4bbef2 100644 --- a/gptel-transient.el +++ b/gptel-transient.el @@ -101,7 +101,9 @@ Or is it the other way around?" "Set a generic refactor/rewrite message for the buffer." (if (derived-mode-p 'prog-mode) (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."))) (defvar gptel--crowdsourced-prompts-url