Function: majutsu-jjdescription-mode

majutsu-jjdescription-mode is an interactive and natively compiled function defined in majutsu-jjdescription.el.

Signature

(majutsu-jjdescription-mode &optional ARG)

Documentation

Minor mode for JJ description buffers.

This is a minor mode. If called interactively, toggle the Majutsu-JJDescription mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable majutsu-jjdescription-mode(var)/majutsu-jjdescription-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-jjdescription.el
(define-minor-mode majutsu-jjdescription-mode
  "Minor mode for JJ description buffers."
  :lighter " JJDesc"
  :keymap majutsu-jjdescription-mode-map
  (if majutsu-jjdescription-mode
      (progn
        (setq-local majutsu-jjdescription--summary-range nil
                    majutsu-jjdescription--summary-tick nil
                    majutsu-jjdescription--summary-last-range nil
                    majutsu-jjdescription--ignore-rest-pos nil
                    majutsu-jjdescription--ignore-rest-tick nil)
        (add-hook 'font-lock-extend-region-functions
                  #'majutsu-jjdescription--extend-region-summary-line nil t)
        (add-hook 'font-lock-extend-region-functions
                  #'majutsu-jjdescription--extend-region-ignore-rest nil t)
        (setq-local font-lock-extra-managed-props
                    (if (memq 'font-lock-face font-lock-extra-managed-props)
                        font-lock-extra-managed-props
                      (cons 'font-lock-face font-lock-extra-managed-props)))
        (setq-local font-lock-multiline t)
        (font-lock-mode 1)
        (majutsu-jjdescription--refresh-font-lock))
    (remove-hook 'font-lock-extend-region-functions
                 #'majutsu-jjdescription--extend-region-summary-line t)
    (remove-hook 'font-lock-extend-region-functions
                 #'majutsu-jjdescription--extend-region-ignore-rest t)
    (when majutsu-jjdescription--font-lock-keywords
      (font-lock-remove-keywords nil majutsu-jjdescription--font-lock-keywords))
    (setq-local majutsu-jjdescription--font-lock-keywords nil)
    (font-lock-flush)))