|
|
|
@ -12,28 +12,60 @@ Define core mode package. |
|
|
|
(provide 'uno-mode)) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
* Program/Text Mode |
|
|
|
* Program Mode |
|
|
|
|
|
|
|
Define custom =prog-mode= and =text-mode= as there are some libraries that do not abide. |
|
|
|
Define custom =prog-mode= as there are some libraries that do not abide. |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(use-package emacs |
|
|
|
:after uno-mode |
|
|
|
:hook |
|
|
|
((conf-mode prog-mode) . uno/run-prog-mode-hook) |
|
|
|
(text-mode . uno/run-text-mode-hook) |
|
|
|
:init |
|
|
|
(defvar uno--prog-based-modes '(nxml-mode) |
|
|
|
(defvar uno-prog-based-modes '(nxml-mode) |
|
|
|
"List of prog based modes.") |
|
|
|
(defun uno/add-prog-mode (mode) |
|
|
|
"Consider MODE prog based." |
|
|
|
(push mode uno--prog-based-modes)) |
|
|
|
(push mode uno-prog-based-modes)) |
|
|
|
(defun uno/run-prog-mode-hook () |
|
|
|
"Configure program mode." |
|
|
|
(run-hooks 'uno-prog-mode-hook)) |
|
|
|
(run-hooks 'uno-prog-mode-hook))) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
* Text Mode |
|
|
|
|
|
|
|
Define custom =text-mode= as there are some libraries that do not abide. |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(use-package emacs |
|
|
|
:after uno-mode |
|
|
|
:hook |
|
|
|
(text-mode . uno/run-text-mode-hook) |
|
|
|
:init |
|
|
|
(defun uno/run-text-mode-hook () |
|
|
|
"Configure text mode, checking for prog mode." |
|
|
|
(if (member major-mode uno--prog-based-modes) |
|
|
|
(if (member major-mode uno-prog-based-modes) |
|
|
|
(uno/run-prog-mode-hook) |
|
|
|
(run-hooks 'uno-text-mode-hook)))) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
* Special Mode |
|
|
|
|
|
|
|
Define custom =special-mode= as there are some libraries that do not abide. |
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(use-package emacs |
|
|
|
:after uno-mode |
|
|
|
:hook |
|
|
|
(special-mode . uno/run-special-mode-hook) |
|
|
|
:init |
|
|
|
(defvar uno-non-special-based-modes nil |
|
|
|
"List of special based modes to exclude.") |
|
|
|
(defun uno/exclude-special-mode (mode) |
|
|
|
"Exclude MODE as special based." |
|
|
|
(push mode uno-non-special-based-modes)) |
|
|
|
(defun uno/run-special-mode-hook () |
|
|
|
"Configure program mode." |
|
|
|
(unless (member major-mode uno-non-special-based-modes) |
|
|
|
(run-hooks 'uno-special-mode-hook)))) |
|
|
|
#+END_SRC |