1

I use describe-function command with SPC h f to get help on emacs functions. But I want to get documentation on Doom's own functions such as map!. describe-function doesn't list this function. How can I get documentation on this and other custom functions?

7
  • 3
    That's a macro, but you should be able to get help on macros with describe-function github.com/hlissner/doom-emacs/blob/… Maybe the macro isn't loaded? Not very familiar with loading, and not at all with doom, but I think often interactive functions and macros are autoloaded and that this one isn't, maybe because it's not interactive? Surprises me if it's not loaded though, given the filename Feb 26, 2021 at 19:33
  • 1
    If you evaluate this lisp in *scratch*, what does it say? (fboundp 'map!) Feb 26, 2021 at 19:38
  • @CroadLangshan It returns t Feb 26, 2021 at 20:00
  • Odd. In spacemacs, if I copy-paste that macro and evaluate it I can run describe-function on it and it shows up in the list (I think I'm actually getting counsel-describe-function that way, though -- maybe plain describe-function doesn't show macro help?? seems unlikely) Feb 26, 2021 at 20:13
  • 1
    This seems to be something to do with ivy / counsel. If I disable ivy-mode and copy the definition of describe-function to describe-function-2 and evaluate that (to avoid counsel messing with it via advice or whatever), then run that, it works. Also in spacemacs (but not doom), if I put point somewhere in a buffer that says map!, describe-function lists it -- but otherwise, it doesn't show up. In doom it never shows up unless I go to the lenghs above. Feb 26, 2021 at 20:39

1 Answer 1

1

If you are using Ivy, this is expected. Ivy's user manual states that Ivy uses the exclamation mark for regex negation:

Ivy supports regexp negation with "!". For example, "define key ! ivy quit" first selects everything matching "define.*key", then removes everything matching "ivy", and finally removes everything matching "quit". What remains is the final result set of the negation regexp.

Since Ivy treats minibuffer input as a regexp, the standard regexp identifiers work: "^", "$", "\b" or "[a-z]". The exceptions are spaces, which translate to ".*", and "!" that signal the beginning of a negation group.

You should get what you need if you escape the exclamation mark. In other words, when you use describe-function, search for

map\!
4
  • Can you please explain why? Is ! a special character that needs escaping? Or is this something else? Is that special to Doom? Is it something to do with ivy/counsel as a comment mentions or is that unrelated? Is it a Doom bug?
    – NickD
    Jan 21, 2022 at 12:51
  • I'm not sure I can, I'm relatively new to Emacs myself, but using the backslash does help finding "Doom's own functions" so I thought it answered the question. If you feel like this answer should be deleted or relegated to a comment I can do so. Jan 21, 2022 at 20:58
  • No, not at all: I'm just trying to make sure that it is as helpful as possible. It would help if the OP chimed in on whether it solved his problem.
    – NickD
    Jan 21, 2022 at 21:14
  • 1
    Hi @NickD I went ahead and added some information to my answer, hopefully it's more helpful now. Thank you for the input! Feb 9, 2022 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.