emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Case problem with menus


From: David Kastrup
Subject: Re: Case problem with menus
Date: Sat, 23 Oct 2004 17:03:06 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     The AUCTeX math menus contain a submenu "greek" as well as a submenu
>     "Greek".  When one tries clicking on subentries in the "greek" menu, a
>     message like
>
>     <menu-bar> <math> <greek> <? \alpha> is undefined
>
> I would guess that is a bug already, but I know nothing about AUCTeX
> except what you've said here.  Could you confirm it is a bug?
>
> If that much is a bug already, can you investigate?
> For instance, what names are used in the keymaps?

LaTeX-math-keymap's value is shown below.

Keymap used for `LaTeX-math-mode' commands.

Defined in `latex'.

Value:
(keymap
 (menu-bar keymap
     (math menu-item "Math"
     (keymap "Math"
       (cal-whatever menu-item "Cal-whatever" LaTeX-math-cal
               ([96 99]
          . "  (` c)"))
       (greek menu-item "Greek"
        (keymap "Greek"
          (γ\ \\gamma menu-item "Γ \\Gamma" LaTeX-math-Gamma
                ([96 71]
                 . "  (` G)"))
          (δ\ \\delta menu-item "Δ \\Delta" LaTeX-math-Delta
                ([96 68]
                 . "  (` D)"))
          (θ\ \\theta menu-item "Θ \\Theta" LaTeX-math-Theta

[...]
       (greek menu-item "greek"
        (keymap "greek"
          (α\ \\alpha menu-item "α \\alpha" LaTeX-math-alpha
                ([96 97]
                 . "  (` a)"))
          (β\ \\beta menu-item "β \\beta" LaTeX-math-beta
               ([96 98]
                . "  (` b)"))
          (γ\ \\gamma menu-item "γ \\gamma" LaTeX-math-gamma
                ([96 103]

[...]

Now it is obvious that the identifying symbols before the menu-items
are being downcased from their respective menu strings, and that we
get duplicate symbols this way.

Who is doing the downcasing?

We start from the variable LaTeX-math-menu defined as

LaTeX-math-menu's value is shown below.

Menu containing LaTeX math commands.
The menu entries will be generated dynamically, but you can specify
the sequence by initializing this variable.

Defined in `latex'.

Value:
("Math"
 ["Cal-whatever" LaTeX-math-cal t]
 ("Greek"
  ["Γ \\Gamma" LaTeX-math-Gamma t]
  ["Δ \\Delta" LaTeX-math-Delta t]
  ["Θ \\Theta" LaTeX-math-Theta t]
  ["Λ \\Lambda" LaTeX-math-Lambda t]
[...]
 ("greek"
  ["α \\alpha" LaTeX-math-alpha t]
  ["β \\beta" LaTeX-math-beta t]
  ["γ \\gamma" LaTeX-math-gamma t]

when creating the menu.  This menu gets added with

(easy-menu-define LaTeX-math-mode-menu
    LaTeX-math-keymap
    "Menu used in math minor mode."
  LaTeX-math-menu)

The symbols that easy-menu-define chooses obviously get downcased from
the respective menu strings, probably in order to provide a more
pleasing appearance or whatever.

Tracing this back in easymenu.el, we eventually arrive at

(defsubst easy-menu-intern (s)
  (if (stringp s) (intern (downcase s)) s))

Looking in the CVS logs, we arrive at

revision 1.47
date: 2002/04/24 23:18:42;  author: rms;  state: Exp;  lines: +38 -21
(easy-menu-intern): Downcase before interning.
(easy-menu-define-key-intern): Function deleted; callers intern
and then call easy-menu-define-key.
(easy-menu-do-add-item): Explicitly intern the key, but not BEFORE.
(easy-menu-define-key): Use easy-menu-name-match to match BEFORE.
(easy-menu-name-match): New function.
(add-submenu): New function.
(easy-menu-get-map-look-for-name): Use easy-menu-name-match.
----------------------------

So the main question is: what is the purpose of this change other than
the bad effects I am now experiencing?

If it should be disallowed to use menu entries that differ only in
case, then this needs to get documented somewhere.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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