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

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

[nongnu] elpa/spell-fu 9180a77865 48/86: Fix #15: don't enable (when use


From: ELPA Syncer
Subject: [nongnu] elpa/spell-fu 9180a77865 48/86: Fix #15: don't enable (when used globally) for application buffers
Date: Thu, 7 Jul 2022 12:03:42 -0400 (EDT)

branch: elpa/spell-fu
commit 9180a778655a4ba80fdc696551ef43c5e172d426
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Fix #15: don't enable (when used globally) for application buffers
    
    Skip all buffers that use a mode derived from 'special-mode',
    which is used for application buffers (not text).
    
    (spell-fu-mode) can still be enabled explicitly, it just won't be turned
    on for special modes by default when `global-spell-fu-mode` is used.
---
 changelog.rst |  2 ++
 spell-fu.el   | 11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/changelog.rst b/changelog.rst
index 3b49e7244d..f0e50bb759 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -5,6 +5,8 @@ Change Log
 
 - In development.
 
+  - ``global-spell-fu-mode`` no longer enables spell-fu for modes derived from 
``special-mode``
+    such as package list for example (fixes ``#15``).
   - Support conditionally disabling ``global-spell-fu-mode`` via
     ``global-spell-fu-ignore-buffer`` & ``global-spell-fu-ignore-modes``.
 
diff --git a/spell-fu.el b/spell-fu.el
index 5ea269a8fb..8100e231cf 100644
--- a/spell-fu.el
+++ b/spell-fu.el
@@ -1079,7 +1079,16 @@ Return t when the word is removed."
   "Enable the option `spell-fu-mode' where possible."
   (when
     (and
-      (not spell-fu-mode) (not (minibufferp)) (not (memq major-mode 
spell-fu-ignore-modes))
+      ;; Not already enabled.
+      (not spell-fu-mode)
+      ;; Not in the mini-buffer.
+      (not (minibufferp))
+      ;; Not a special mode (package list, tabulated data ... etc)
+      ;; Instead the buffer is likely derived from `text-mode' or `prog-mode'.
+      (not (derived-mode-p 'special-mode))
+      ;; Not explicitly ignored.
+      (not (memq major-mode spell-fu-ignore-modes))
+      ;; Optionally check if a function is used.
       (or
         (null global-spell-fu-ignore-buffer)
         (if (functionp global-spell-fu-ignore-buffer)



reply via email to

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