From 4c553e41bb26c34bb13c0172833ab84737336099 Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Wed, 1 Jan 2025 18:49:59 -0800 Subject: [PATCH] gptel: Support gptel-mode in text-derived modes (#454) * gptel.el (gptel-mode): gptel-mode can now be used in all modes derived from `text-mode'. This does not make sense for many modes, like yaml-mode (which is derived from text), but it is up to the user to handle these cases. No changes to the defaults. --- gptel.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gptel.el b/gptel.el index 2a06f114..32aa073b 100644 --- a/gptel.el +++ b/gptel.el @@ -1162,8 +1162,7 @@ file." map) (if gptel-mode (progn - (unless (or (derived-mode-p 'org-mode 'markdown-mode) - (eq major-mode 'text-mode)) + (unless (derived-mode-p 'org-mode 'markdown-mode 'text-mode) (gptel-mode -1) (user-error (format "`gptel-mode' is not supported in `%s'." major-mode))) (add-hook 'before-save-hook #'gptel--save-state nil t)