Have written a minor mode that resets outline-regexp
, and outline-heading-alist
and adds additional keybindings for showing and hiding outline levels.
To get the corresponding major mode -map
variables I include the corresponding features where the map variables are defined.
The difficulty in whether to use
(add-hook 'outline-minor-mode-hook 'tika-minor-mode nil t)
or enable outline-minor-mode
within define-minor-mode
or perform both.
But I am getting an annoying error, namely
Debugger entered--Lisp error: (excessive-lisp-nesting)
(cons 'tika-minor-mode local-minor-modes)
(setq local-minor-modes (cons 'tika-minor-mode local-minor-modes))
I want that when an elisp file is loaded, tika-minor-mode
and outline-minor-mode
are enabled by default.
Where should such a call be placed in my minor made ?
Here is my implementation
(require 'emacs-lisp) ; for emacs-lisp-mode-map
(defun tika-tools ()
(add-hook 'outline-minor-mode-hook 'tika-minor-mode nil t))
;;;###autoload
(define-minor-mode tika-minor-mode
(if tika-minor-mode
(progn (outline-minor-mode 0)
(tika-tools)
(outline-minor-mode 1))
(outline-minor-mode 0)) )
(defun tika-addhook ()
"Activate minor-mode' automatically for specific major-modes."
(add-hook 'emacs-lisp-mode-hook #'tika-minor-mode))
(provide 'tika)