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


On  8.04.06, John E. Davis wrote:
> Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
> 
> I will try to solve it at the C-level in the upcoming patch.

I suppose the problem to be related to:

  _jed_find_file_before_hooks
  ----------------------------
  
    Each of the hooks in this list will be passed the name of the file
    to be found.  The hooks in this list are called until one returns a
    value of 1, which indicates that the file has been found and read
    into a buffer. Otherwise, the hook must return 0 to allow the rest
    of the hooks in the chain to run.  If a hook indicates that the file
    has been found, then the related hooks _jed_find_file_after_hooks
    will _not_ be run.

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.

To solutions spring to my mind:

1. Allow a third return value (e.g. -1) to indicate: 
 
    + the file has been found and read into a buffer
    + please run _jed_find_file_after_hooks
    
2. Provide a function to run a "hook chain", say

      run_hooks("_jed_find_file_after_hooks");

   would run the list of hooks associated with
   `_jed_find_file_after_hooks'.


I would prefer the second solution, as it is more generic
(i.e. could also be used outside of a hook).


Guenter

-- 
Milde ife.et.tu-dresden.de

--------------------------
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]