unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: 2179@debbugs.gnu.org, Gerard Brunick <gbrunick@math.utexas.edu>
Subject: bug#2179: 23.0.60; define-key vs define-key-after key syntax
Date: Sun, 11 Sep 2011 23:48:49 +0200	[thread overview]
Message-ID: <m2ehzmeon2.fsf@igel.home> (raw)
In-Reply-To: <m3litulqw3.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Sun, 11 Sep 2011 23:18:20 +0200")

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Gerard Brunick <gbrunick@math.utexas.edu> writes:
>
>> (define-key my-map [(control l)] 'do-something)
>>
>> works as expected, but
>>
>> (define-key-after my-map [(control l)] 'do-something)
>>
>> does not.  The reason is that define-key does a lot of work to allow
>> for a wide range of key syntaxes, but define-key-after just does:
>>
>> (setq key
>>      (if (<= (length key) 1) (aref key 0) ...
>>
>> and (control l) must get mapped to ?\C-l = 12 to be useful in a keymap.
>
> Yes, you'd expect both key's to allow the same syntax.  However, as far
> as I can see, all the magic to translate from the `define-key' key
> syntax is inside that C function, so that would have to be refactored
> out first.  I think.

Since define-key-after is only useful for menu-bar bindings which don't
use characters in keys this doesn't look like a serious restriction.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





  reply	other threads:[~2011-09-11 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03  7:31 bug#2179: 23.0.60; define-key vs define-key-after key syntax Gerard Brunick
2011-09-11 21:18 ` Lars Magne Ingebrigtsen
2011-09-11 21:48   ` Andreas Schwab [this message]
2011-09-11 22:22     ` Lars Magne Ingebrigtsen
2011-09-12  7:48       ` Andreas Schwab
2011-09-12  7:59         ` Lars Magne Ingebrigtsen
2011-09-12  8:14           ` Andreas Schwab
2011-10-05  5:08           ` Glenn Morris
2011-10-06 19:16             ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ehzmeon2.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=2179@debbugs.gnu.org \
    --cc=gbrunick@math.utexas.edu \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).