mirror of
https://github.com/larstvei/Focus.git
synced 2024-11-26 03:28:32 +00:00
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.
This commit is contained in:
parent
a84ade00a2
commit
3fafdc7947
3
focus.el
3
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 ()
|
||||
|
Loading…
Reference in New Issue
Block a user