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

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

bug#7631: 24.0.50; inconsistency in event-convert-list and event-basic-t


From: Don March
Subject: bug#7631: 24.0.50; inconsistency in event-convert-list and event-basic-type
Date: Mon, 13 Dec 2010 01:22:32 -0500

The definition for `event-convert-list' in keyboard.c has the
following code, which causes symbols consisting of a single character
to be interpreted as the character itself:

  /* Let the symbol A refer to the character A.  */
  if (SYMBOLP (base) && SCHARS (SYMBOL_NAME (base)) == 1)
    XSETINT (base, SREF (SYMBOL_NAME (base), 0));

I see how this is well-intentioned but I don't think that it's useful,
particularly because of the case where the symbol is `t'.

(event-convert-list '(t)) ; => 116

There's good reason to want this to eval to t (i.e. the symbol, not
the char).  For example, I found this interesting behavior when using
`map-keymap' to automate remapping commands from C- with M-.  It also
seems to produce inconsistent results:

(event-convert-list '(nil)) ; => nil
(event-convert-list '(t)) ; => 116
(event-convert-list '(tt)) ; => tt
(event-convert-list '(control t)) ; => 20
(event-convert-list '(control tt)) ; => C-tt

If, however, this the Right Thing for some reason I don't see, the
documentation for `event-convert-list' needs to be changed:

"The return value is an event type (a character or symbol) ***which
has the same base event type*** and all the specified modifiers"
(emphasis added).

(event-convert-list '(t)) ; => 116
(event-basic-type t) ; => t

In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0)
 of 2010-12-12 on lappy
Windowing system distributor `The X.Org Foundation', version 11.0.10900000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t





reply via email to

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