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

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

[nongnu] elpa/focus 3fafdc7947 62/82: Allow explicitly setting derived m


From: ELPA Syncer
Subject: [nongnu] elpa/focus 3fafdc7947 62/82: Allow explicitly setting derived modes in focus-mode-to-thing
Date: Tue, 6 Sep 2022 04:58:58 -0400 (EDT)

branch: elpa/focus
commit 3fafdc79475957a770832df5a757201e7df867b2
Author: dieggsy <diegoamundo@protonmail.com>
Commit: dieggsy <diegoamundo@protonmail.com>

    Allow explicitly setting derived modes in focus-mode-to-thing
    
    Previously, a value for focus-mode-to-thing like:
    
    '((prog-mode . defun)
      (text-mode . sentence)
      (org-mode . paragraph))
    
    Wouldn't work, since org-mode is dervied from text-mode. Now
    focus-get-thing checks if the current mode is explicitly in
    focus-mode-to-thing before checking if it's a derived mode.
---
 focus.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/focus.el b/focus.el
index 80cda30f5e..008da69173 100644
--- a/focus.el
+++ b/focus.el
@@ -108,7 +108,8 @@ The timer calls `focus-read-only-hide-cursor' after
   "Return the current thing, based on `focus-mode-to-thing'."
   (or focus-current-thing
       (let* ((modes (mapcar 'car focus-mode-to-thing))
-             (mode  (focus-any 'derived-mode-p modes)))
+             (mode  (or (cl-find major-mode modes)
+                        (focus-any 'derived-mode-p modes))))
         (if mode (cdr (assoc mode focus-mode-to-thing)) 'sentence))))
 
 (defun focus-bounds ()



reply via email to

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