When using outshine's imenu functionality (from either `outshine-imenu` or
`outshine-imenu-with-navi-regexp`), the variables that configure imenu behavior
are locally overwritten in a `let*` form. However, it's important to also restore
the default setting of `imenu-create-index-function` (which should be
`imenu-default-create-index-function`).
I noticed this bug when editing `R` files in `spacemacs`: the `lsp`
configuration involves changing the value of `imenu-create-index-function`,
which makes changes to the other variables inconsequential, and then outshine's
attempt to change the way imenu works by binding `imenu-generic-expression` has
no effect.
Interns a named function with appropriate docstring instead of a lambda,
so that calling describe-key (eg. C-h k TAB)
gives a more informative result instead of throwing up a lambda byte code
object.
Pass the command to call as a quoted symbol instead of an unquoted function
call, matching the signature of `define-key'.
Also remove the unhygenic variable capture of "arg" in the macro, since the
command is now being called interactively.
Note: this is a breaking change if the macro was used to define personal
keybindings outside of outshine.el
Last reference to this function was somewhere back in 2014, it is currently
unused anywhere else even in commented out code and should be safe to remove.
- Collapse some nested cond forms
- Simplify condition for global cycling
- Remove redundant calls to (outline-back-to-heading) and
(looking-at outline-regexp)
- Remove unused vars
- modify some docstrings and comments
It is conventional to have a preceding space before lighter strings so that all minor mode lighters do not squish together. There are many such examples in Emacs cores. To list to few, look at the definitions of `hs-minor-mode` and `eldoc-mode`.
Introduce a new function outshine--cycle-message that does log messages in
the *Messages* buffer (taken from org-unlogged-message)
Change docstring of outshine-toggle-silent-cycling to reflect this change
Third attempt of solving the problem of what to do whenever the user
tries to activate Outshine when Outline isn't activated. Just
calling (outline-minor-mode 1) enters an endless hook
loop (outline-minor-mode-hook calls outshine which calls
outline-minor-mode which runs its hook etc). (error)ing raises error
in strange circumstances, like changing the major mode. This seems to work.
This looks like a good idea (to me at least), but it makes it very
easy to introduce confusing bugs. Consider the obvious configuration
line:
(add-hook 'outline-minor-mode-hook 'outshine-minor-mode)
this actually triggers a Lisp stack overflow, since
outshine-minor-mode will call outline-minor-mode, which will run its
hooks, calling back `outshine-minor-mode`, and so on. Since hooks are
run when the mode is activated *or* deactivated, there's no simple way
to make this predictible and safe.