Matthieu Moy <[EMAIL PROTECTED]> writes:
> On that particular point, it's just because I didn't manage to get it
> right, but it'd be better to have some additional items in the same
> menu. That's not totally trivial to do, since you want to add the
> items for that particular instance of the menu, and not for the same
> menu in other back-ends (i.e. The DVC-Diff menu a *bzr-status*
> buffer).
Right. I think you have to recompute the menu each time it is
displayed (possible but inefficient) or make the menu buffer-local (I
don't know if that is possible).
Adding back-end specific stuff in a new top level menu is probably better.
Hmm. I don't understand how that avoids showing up in other
dvc-diff-mode buffers; I really don't understand how Emacs menus work
at this level.
>> I have other code that adds to the Ada-mode menu; it looks like this:
>>
>> (define-key-after (lookup-key ada-mode-map [menu-bar Ada Project]) [reload]
>> '("Reload" . ada-prj-reload-project-file) 'Load)
>>
>> much harder to understand.
>
> And incorrect AAUI. This would mutate dvc-diff-mode-map, and the
> changes would apply to other back-ends too.
Right.
>> So maybe if we have a policy that says:
>>
>> "<back-end>-dvc-diff-mode" should be derived from dvc-diff-mode
>> (via define-derived-mode), and only extend the menu and keymap
>> (see xgit.el for a good example).
>
> Why not.
Ok. Which leaves the question of where to put this statement.
I guess in a comment at the definition of dvc-diff-mode would be the
best place.
> But I can also imagine a mode for a totally weird (imaginary as of
> now) back-end that would actually need to totally override
> dvc-diff-mode. But, well, let's delay this case for the day we find
> such weird back-end ;-).
Right.
--
-- Stephe
_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev