Adrian Aichner wrote:
Hi All, I'd like to solicit your feedback on this issue.
Yesterday I found the cause for mouse-track-insert not to work between
buffers, at least under native Windows, today I found more:
buff-meu.el, compile.el, info.el all incorrectly make
`mouse-track-click-hook' local via `make-local-variable'.
mouse-track-insert between buffers works fine until either of
C-x C-b (list-buffers),
M-x compile, or
C-h i (info)
are executed.
According to documentation of `add-hook', `make-local-hook' should be
used for hook variables instead.
Documentation of `make-local-hook' has a worrying, uninformative hint
about non-normal hooks, which will have to be changed one by one.
Can anyone here elaborate on this hint?
what make-local-hook and add-local-hook do in addition to calling
`make-local-variable' is put in a `t' somewhere in the hook, which will cause
the global hooks to be run as well. otherwise, you get *only* the local hooks
run, which is obviously wrong. the thing is, the routine that calls the hook
has to know about this `t' business. there are different routines out there to
do this, and each one has to be modified. that's what the hint means. in point
of fact, there are a number of standard routines
`run-hook-with-args-till-success' and so on that implement common hook
semantics, so most if not all hooks already works correctly with
`make-local-hook'. mouse-track hooks have their own function to run the hook
[mouse-track-run-hook], which also handles the `t' correctly. [although probably
we should fix this to use a standard hook.]
A few questions arise:
1. Does mouse-track-insert work between buffers under X, after running
any of the offenders above?
2. Should mouse-track-click-hook be used as a local hook by
buff-meu.el, compile.el, info.el?
3. Should all instances of
(make-local-variable A)
(add-hook A B)
be converted to
(make-local-hook A)
(add-hook A B)
yes. remember that you need some special args in `add-hook' to actually get a
local hook.
i made a better function add-local-hook to do this, but it's 21.4 and up only.
Here is what I found in core lisp:
--------------------------------------------------------------------------------
igrep-make-local-variable--hook.errName: igrep-make-local-variable--hook.err
Type: Plain Text (text/plain)
--------------------------------------------------------------------------------
This is what I found in xemacs-packages lisp:
--------------------------------------------------------------------------------
igrep-make-local-variable--hook.errName: igrep-make-local-variable--hook.err
Type: Plain Text (text/plain)
igrep-mouse-track-click-hook.errName: igrep-mouse-track-click-hook.err
Type: Plain Text (text/plain)
--------------------------------------------------------------------------------
--
Adrian Aichner Teradyne GmbH, European Design Center
Integra Test Division Telephone +49/89/41861(0)-208
Dingolfinger Strasse 2 Fax +49/89/41861-115
D-81673 MUENCHEN E-mail adrian.aichner(a)teradyne.com
--
ben
I'm sometimes slow in getting around to reading my mail, so if you
want to reach me faster, call 520-661-6661.
See
http://www.666.com/ben/chronic-pain/ for the hell I've been
through.