[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key bindings proposal

From: Lennart Borgman
Subject: Re: Key bindings proposal
Date: Mon, 30 Aug 2010 18:06:26 +0200

On Mon, Aug 30, 2010 at 5:53 PM, Drew Adams <address@hidden> wrote:
>> > 3rd-party code will just have to adjust, providing two sets
>> > of menu items: one that works in old Emacs versions (no
>> > accelerator indication) and one that works in new versions.
>> > Ugh.  And code that dynamically generates menu items would
>> > need to be adapted to always DTRT.  Ugh.
>> Can't this be handled something like this:
>> - Provide a function in Emacs, say `menu-escape-underscore', that does
>> escaping of underscore so that it is shown as an underscore.
>> - Test for the presence of this function in external libraries.
> The point is that legacy 3rd-party code makes no provision for anything.  It
> simply includes `_' as an ordinary character.  Either the 3rd-party code must
> change to recognize Emacs's different treatment in different versions or the 
> new
> Emacs behavior will treat `_' differently from what was intended.
> If you mean that new Emacs would use (fboundp 'menu-escape-underscore) and 
> then
> handle the menu accordingly, that might make new Emacs DTRT with old 3rd-party
> code.  But it would not solve the reverse problem of old Emacs versions 
> handling
> code that creates menus that expect the new treatment.

No, I meant that 3rd party code must check for this. So yes, third
party code must change, but it is a simple change, something like

  (when (fboundp 'menu-escape-underscore)
      (setq my-menu-txt (menu-escape-underscore my-menu-txt)))

> Maybe there is a good, simple solution, but I don't see it yet.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]