Add doom-ui-mode-names for renaming major-modes
This commit is contained in:
parent
5638f509a2
commit
e8d454a251
4 changed files with 16 additions and 5 deletions
3
TODO.org
3
TODO.org
|
@ -92,7 +92,7 @@
|
||||||
+ [ ] twitter
|
+ [ ] twitter
|
||||||
+ [ ] present
|
+ [ ] present
|
||||||
|
|
||||||
** 2.0.3 [53/81]
|
** 2.0.3 [54/82]
|
||||||
+ [2/3] Finish module :: feature/jump (go-to-definition that just works)
|
+ [2/3] Finish module :: feature/jump (go-to-definition that just works)
|
||||||
+ [ ] automatic tag generation
|
+ [ ] automatic tag generation
|
||||||
+ [X] global tags support
|
+ [X] global tags support
|
||||||
|
@ -133,6 +133,7 @@
|
||||||
+ [ ] Fix invisible buffer-info segment in modeline for terminal Emacs
|
+ [ ] Fix invisible buffer-info segment in modeline for terminal Emacs
|
||||||
+ [ ] ui/doom-modeline: fix ~0/0~ display in modeline (leftover anzu state)
|
+ [ ] ui/doom-modeline: fix ~0/0~ display in modeline (leftover anzu state)
|
||||||
+ [ ] lang/php: automatic+async rebuild of tags (phpctags)
|
+ [ ] lang/php: automatic+async rebuild of tags (phpctags)
|
||||||
|
+ [X] Extract ~mode-name~ setters to ~doom-ui-mode-names~ in core/core-ui
|
||||||
+ [X] nav-flash: blink on focus-in
|
+ [X] nav-flash: blink on focus-in
|
||||||
+ [X] Add ~:textobj~ keyword to ~map!~
|
+ [X] Add ~:textobj~ keyword to ~map!~
|
||||||
+ [X] Make ~doom-refresh-packages~ async
|
+ [X] Make ~doom-refresh-packages~ async
|
||||||
|
|
|
@ -95,6 +95,19 @@ local value, whether or not it's permanent-local. Therefore, we cycle
|
||||||
show-paren-when-point-inside-paren t)
|
show-paren-when-point-inside-paren t)
|
||||||
(show-paren-mode +1)
|
(show-paren-mode +1)
|
||||||
|
|
||||||
|
;; like diminish, but for major-modes. [pedantry intensifies]
|
||||||
|
(defvar doom-ui-mode-names
|
||||||
|
'((sh-mode . "sh")
|
||||||
|
(emacs-lisp-mode "Elisp"))
|
||||||
|
"An alist mapping major modes to alternative names, which will be set when the
|
||||||
|
mode is detected.")
|
||||||
|
|
||||||
|
(defun doom|set-mode-name ()
|
||||||
|
"Set the major mode's `mode-name', as dictated by `doom-ui-mode-names'."
|
||||||
|
(let ((name (assq major-mode doom-ui-mode-names)))
|
||||||
|
(if name (setq mode-name (cdr name)))))
|
||||||
|
(add-hook 'after-change-major-mode-hook #'doom|set-mode-name)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Bootstrap
|
;; Bootstrap
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
(set! :editorconfig :remove 'emacs-lisp-mode)
|
(set! :editorconfig :remove 'emacs-lisp-mode)
|
||||||
|
|
||||||
(defun +emacs-lisp|hook ()
|
(defun +emacs-lisp|hook ()
|
||||||
(setq mode-name "Elisp") ; [pedantry intensifies]
|
|
||||||
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
|
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
|
||||||
|
|
||||||
(eldoc-mode +1)
|
(eldoc-mode +1)
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
(set! :repl 'sh-mode #'+sh/repl)
|
(set! :repl 'sh-mode #'+sh/repl)
|
||||||
(setq sh-indent-after-continuation 'always)
|
(setq sh-indent-after-continuation 'always)
|
||||||
|
|
||||||
;; [pedantry intensifies]
|
;; sh-mode has file extensions checks for other shells, but not zsh, so...
|
||||||
(add-hook! sh-mode (setq mode-name "sh"))
|
|
||||||
|
|
||||||
(defun +sh|detect-zsh ()
|
(defun +sh|detect-zsh ()
|
||||||
(when (and buffer-file-name (string-match-p "\\.zsh\\'" buffer-file-name))
|
(when (and buffer-file-name (string-match-p "\\.zsh\\'" buffer-file-name))
|
||||||
(sh-set-shell "zsh")))
|
(sh-set-shell "zsh")))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue