Function: majutsu-jjdescription--set-global-hooks

majutsu-jjdescription--set-global-hooks is a natively compiled function defined in majutsu-jjdescription.el.

Signature

(majutsu-jjdescription--set-global-hooks ENABLE)

Documentation

Add or remove hooks and advice for global-majutsu-jjdescription-mode(var)/global-majutsu-jjdescription-mode(fun).

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-jjdescription.el
(defun majutsu-jjdescription--set-global-hooks (enable)
  "Add or remove hooks and advice for `global-majutsu-jjdescription-mode'."
  (let ((action (if enable #'add-hook #'remove-hook)))
    (funcall action 'find-file-hook #'majutsu-jjdescription-setup-check-buffer)
    (funcall action 'after-change-major-mode-hook
             #'majutsu-jjdescription-setup-font-lock-in-buffer))
  (if enable
      (advice-add 'server-visit-files :before
                  #'majutsu-jjdescription--remember-server-visit-roots)
    (advice-remove 'server-visit-files
                   #'majutsu-jjdescription--remember-server-visit-roots)))