Remove doom-major-mode-names & doom|set-mode-name
And replace it with buffer-local mode-name setters. This is more explicit and less magical, which is easier for users to discover and change, if they'd like.
This commit is contained in:
parent
e80f5e4c85
commit
4067c8937e
4 changed files with 6 additions and 36 deletions
|
@ -2,27 +2,6 @@
|
|||
;;; ../core/test/test-core-ui.el
|
||||
|
||||
(describe "core/ui"
|
||||
(describe "doom|set-mode-name"
|
||||
:var (doom-major-mode-names after-change-major-mode-hook)
|
||||
(before-all
|
||||
(setq doom-major-mode-names
|
||||
'((text-mode . "abc")
|
||||
(lisp-mode . (lambda () "xyz"))
|
||||
(js-mode . t))
|
||||
after-change-major-mode-hook '(doom|set-mode-name)))
|
||||
|
||||
(it "changes `mode-name' to match a given string"
|
||||
(text-mode)
|
||||
(expect mode-name :to-equal "abc"))
|
||||
|
||||
(it "changes `mode-name' to the result of a function"
|
||||
(lisp-mode)
|
||||
(expect mode-name :to-equal "xyz"))
|
||||
|
||||
(it "should fail if given an invalid name"
|
||||
(expect (js-mode) :to-throw 'error)))
|
||||
|
||||
|
||||
(describe "doom|protect-visible-buffer"
|
||||
:var (kill-buffer-query-functions wconf a b)
|
||||
(before-each
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue