emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom-set-variables fails to set variable


From: Juri Linkov
Subject: Re: custom-set-variables fails to set variable
Date: Sat, 12 Nov 2005 23:19:52 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> Remember that all of this came about because the mode's docstring
> contains:
>
>     Entry to this mode calls the value of `lisp-mode-hook'
>     if that value is non-nil.
>
> And `C-h v' on lisp-mode-hook did not work.

Please note also that even when `C-h v' works correctly on a hook variable
(like it works now), an attempt to follow the link to the source code
(i.e. typing RET on the file name link in the Help buffer) fails.
That is because `find-function-search-for-symbol' tries to find a
definition of the variable whose name contains the suffix "-hook",
but it is defined in the macro without the suffix "-hook" (e.g.
`mh-letter-mode-hook' is defined as `define-derived-mode mh-letter-mode').

It is possible to specify the name of the definition explicitly by
setting the symbol's property `definition-name'.  `define-global-minor-mode'
already does this, so `define-derived-mode' could do the same.  This
means putting a line like

    (if (not (boundp ',map)) (put ',map 'definition-name ',child))

before every `defvar' in the body of `define-derived-mode'.

Checking the boundness is necessary for the case when the variable is
already defined before evaluating the body of `define-derived-mode'.

There are four variables defvar'ed currently in `define-derived-mode':
`-hook', `-map', `-syntax-table' and `-abbrev-table'.  The condition
above works for the first three variables, but not for `-abbrev-table'
which requires special treatment for the case when an abbrev table
is defined in ~/.abbrev_defs.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]