jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: _jed_set_mode_hooks not called by compression mode


Hello G.,

"G. Milde" <g.milde@xxxxxx> wrote:
> On 10.04.06, Jörg Sommer wrote:
>> Hello G.,
>> 
>> "G. Milde" <g.milde@xxxxxx> wrote:
>> > There is no way a "find-file-before-hook" can mark it's success but request
>> > the _jed_find_file_after_hooks to be run.
>> >
>> > 2. Provide a function to run a "hook chain", say
>> >
>> >       run_hooks("_jed_find_file_after_hooks");
>> 
>> Where is the problem with _jed_run_hooks?
>
>  1. It is not mentioned in Help>Browse_Docs>hooks.
>  
>  2. It is not in the 'SEE ALSO' section of add_to_hook, append_to_hook,
>     and remove_from_hook.
>
>  3. _jed_run_hooks: intrinsic function  Undocumented

ACK. I've got my informations from the source.

> So, a line
>
>   _jed_run_hooks("_jed_find_file_after_hooks");
>
> at the right place in compress.sl would cure the bug?

Why do you use the _jed_find_file_after_hooks? Why not
_jed_set_mode_hooks? And this will not work, because
compressed_set_mode_hook() is also registered to _jed_set_mode_hooks,
which causes an endless loop. You must first unregister this function and
after all hooks are run, register it again.

>> > I would prefer the second solution, as it is more generic
>> > (i.e. could also be used outside of a hook).
>> 
>> I would prefer that find_file calls the hooks. This is more generic.
>
> We would need a third return value then, as in some cases it might be
> that a find-file-before-hook really wants the file-finding aborted and no
> find-file-after-hooks called (i.e. the current behaviour).

Why this? Why not throw an exception?

Regards, Jörg.
-- 
Manchmal denke ich, das sicherste Indiz dafür, daß anderswo im Universum
intelligentes Leben existiert, ist, daß niemand versucht hat, mit uns
Kontakt aufzunehmen.                           (Calvin und Hobbes)

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]