8

I was reading through the Changelog for emacs 24.4 (C-hn) and was trying to see what the File Notification feature is. I tried doing C-hv of a related variable auto-revert-use-notify but nothing showed up.

I then grepped for that variable name in the emacs source code and found that it was used in lisp/autorevert.el. After doing (require 'autorevert), all the underlying functions and variables got defined.

Question: How do I know if and what I need to require if I want to use a then-inactive emacs built-in feature? Is there a list of such packages available?

1
  • I often use helm apropos to find out what types of commands/functions/variables are available to me. It turns out that sometimes the exact setting that I want is "built-in", but I have to require its package first. – nispio Oct 21 '14 at 16:07
6

The answer, as far as I know, to your questions are "You cannot know" and "There is no such list of libraries."

apropos and similar commands are based only on what is currently loaded or autoloaded, not what is distributed with Emacs. Unless something is (a) built in (i.e., in C code), (b) available from an already loaded library, or (c) autoloaded, it is not picked by such commands.

In that case, your only resort is to search the source code (as far as I know). Grepping is one way to do that.

If a variable such as auto-revert-use-notify (which is a user option) is explicitly mentioned in the Emacs NEWS (C-h N), then it would be great if that mention were linked to the source library that defines it, so you could just hit RET or click mouse-2 on its name to open the library file to its definition. You might want to use M-x report-emacs-bug to file that as an enhancement request.

(It might also be useful to have a command to do that in general: look up a variable's or a functions's definition in the distributed source code, without the library needing to be loaded. In this case, you knew the exact variable name, but had to grep to find where it is defined.)

2
  • Sounds like it is time for a require+ package that lets you browse the symbols of packages that have not yet been loaded. ;-) – nispio Oct 21 '14 at 16:53
  • @nispio: Go for it! With optional behaviors to search either (1) libraries provided with the Emacs distribution or (2) libraries in your load-path. ;-) (But a library named apropos+.el already exists, however minimal, and this is not really about require.) – Drew Oct 21 '14 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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