Philippe M. Coatmeur <
philippe...@gmail.com> writes:
Hi Philippe,
> How can I find information about this special form ? When I ask emacs
> using C-h f with point over it, it acts like google and shows me the
> "plain eval" info page... :(
:eval is neither a function nor a special form, it is a keyword.
,----[ (info "(elisp)Symbol Type") ]
| A symbol whose name starts with a colon (`:') is called a "keyword
| symbol". These symbols automatically act as constants, and are
| normally used only by comparing an unknown symbol with a few specific
| alternatives.
`----
Some keywords have a special meaning for some variables such as
`global-mode-string', so let's check its docs instead of googling.
,----[ C-h v global-mode-string RET ]
| global-mode-string is a variable defined in `C source code'.
| Its value is ("" appt-mode-string)
|
| This variable is potentially risky when used as a file local variable.
|
| Documentation:
| String (or mode line construct) included (normally) in `mode-line-format'.
`----
Ah, so I might want to check out `mode-line-format'.
,----[ C-h v mode-line-format RET ]
| mode-line-format is a variable defined in `C source code'.
| Its value is shown below.
|
| Automatically becomes buffer-local when set in any fashion.
| This variable is potentially risky when used as a file local variable.
|
| Documentation:
| [...]
| For a list of the form `(:eval FORM)', FORM is evaluated and the result
| is used as a mode line element. Be careful--FORM should not load any files,
| because that can cause an infinite recursion.
| [...]
`----
So there's your :eval. Another way to find out about the meaning of
eval was to use the emacs info docs.
C-h i m elisp RET C-s :eval C-s [maybe repeatedly]
leads to:
,----[ (info "(elisp)Mode Line Data") ]
| A mode line construct may be as simple as a fixed string of text,
| but it usually specifies how to combine fixed strings with variables'
| values to construct the text. Many of these variables are themselves
| defined to have mode line constructs as their values.
|
| Here are the meanings of various data types as mode line constructs:
|
| [...]
|
| `(:eval FORM)'
| A list whose first element is the symbol `:eval' says to evaluate
| FORM, and use the result as a string to display. Make sure this
| evaluation cannot load any files, as doing so could cause infinite
| recursion.
`----
Bye,
Tassilo