>>>> "Ben" == Ben Wing <ben(a)666.com>
writes:
Ben> 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?
Ben> what make-local-hook and add-local-hook do in addition to calling
Ben> `make-local-variable' is put in a `t' somewhere in the hook, which
will cause
Ben> the global hooks to be run as well. otherwise, you get *only* the local
hooks
Ah, I read that in the docs.
Ben> run, which is obviously wrong. the thing is, the routine that calls the hook
Ben> has to know about this `t' business. there are different routines out
there to
Ben> do this, and each one has to be modified. that's what the hint means. in
point
Ben> of fact, there are a number of standard routines
Ben> `run-hook-with-args-till-success' and so on that implement common hook
Ben> semantics, so most if not all hooks already works correctly with
Ben> `make-local-hook'. mouse-track hooks have their own function to run the
hook
Ah, so these are the "normal" hooks?
So it's more like standard vs. non-standard hook implementation?
Ben> [mouse-track-run-hook], which also handles the `t' correctly. [although
probably
Ben> we should fix this to use a standard hook.]
Thanks for the details!
Ben, I could not get correct behavior of mouse-track-insert between
buffers, even when I make the hook local correctly in buff-menu.el.
Do you also see this broken behavior?
Should `Buffer-menu-maybe-mouse-select' work correctly as a local
mouse-track-insert-click-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)
Ben> yes. remember that you need some special args in `add-hook' to actually
get a
Ben> local hook.
Yep, I played with this yesterday, also tried to append (instead of
prepend) the hook, to no avail.
I had to add `Buffer-menu-maybe-mouse-select' to the global hook value
of mouse-track-insert-click-hook to get correct mouse-track-insert
behavior. Do you understand this?
Ben> i made a better function add-local-hook to do this, but it's 21.4 and up
only.
OK, I will convert to
arguments: (hook function &optional append local)
semantics for compatibility with 21.1, if we come to an agreement what should be done.
Best regards,
Adrian
>
> 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> --
Ben> ben
Ben> I'm sometimes slow in getting around to reading my mail, so if you
Ben> want to reach me faster, call 520-661-6661.
Ben> See
http://www.666.com/ben/chronic-pain/ for the hell I've been
Ben> through.
--
Adrian Aichner
mailto:adrianï¼ xemacs.org
http://www.xemacs.org/