all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Kenichi Handa <handa@m17n.org>
Cc: schwab@suse.de, christopher.ian.moore@gmail.com, rms@gnu.org,
	emacs-pretest-bug@gnu.org
Subject: Re: capslock changes control characters?
Date: Sun, 09 Mar 2008 23:26:42 -0400	[thread overview]
Message-ID: <jwv8x0ruva7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1JYWHq-0006Dq-RD@etlken.m17n.org> (Kenichi Handa's message of "Mon, 10 Mar 2008 09:54:42 +0900")

>> > I think the current Emacs doesn't have a clear view about
>> > when and how to resolve modifiers.  For instance, S-i is
>> > resolved to `I' by XLookupString, C-i is resolved to 9 in
>> > make_ctrl_char.  Then I think C-S-i should also be resolved
>> > somewher before it's given to Lisp, at least before it's
>> > given to Lisp as character.

>> It should still be possible to distinguish key-bindings to C-i
>> (i.e. TAB) and C-S-i (i.e. S-TAB), provided the underlying terminal
>> allows it, obviously.
>> Does your code still allow this distinction?

> No.  If one needs such distinction, he should use
> read-event.

I mean, can we usefully handle

  (define-key map [?\t] 'foo)
  (define-key map [?\S-\t] 'bar)

because I think it's important that we can distinguish them.
But now that I look at it, the matter is more complex than that: on X11
hitting shift+tab send something like S-iso-lefttab which is then
mapped to `backtab'.  Under an xterm I get an escape sequence that gets
decoded directly into `backtab'.  So I guess it's not that important to
preserve the ?\S-\t key.

>> > Resolving of M-i is surely questionable, but as Emacs has
>> > accepeted M-i upon (insert (read-char)) for long, I resolved
>> > them too for backward compatibility.

>> I think this was just an accidental misfeature and would should not
>> preserve this kind of backward compatibility.  I can't imagine how it
>> could break any existing elisp package, and if a user used that in the
>> past, there are plenty of alternative ways to get the same result in
>> a saner way.

> Ok.  But, currently Emacs allows this kind of string "\M-i"
> (same as "\351", note that "\H-i" signales the error
> "Invalid modifier in string").

Again, this is just an old feature that made sense back in the 7/8bit
tty days.  It's still accepted because a fair amount of code passes such
strings to define-key.  Any other use would count as a bug for me.

> It seems that this is also a misfeature.

Yes.  But one that's still used.

> If we disallow M-i upon (insert (read-char)), shouldn't we disallow
> "\M-i" too?

I don't think so.  One is used in elisp code, the other is used by
manual typing only.  So removing one will break elisp packages, while
removing the other will only make previously working key presses not
work as before, but with various alternative key-presses available.


        Stefan




  reply	other threads:[~2008-03-10  3:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18 18:45 capslock changes control characters? Chris Moore
2008-02-24 22:30 ` Richard Stallman
2008-03-03 10:38   ` David Reitter
2008-03-03 14:02     ` Stefan Monnier
2008-03-03 14:49       ` Andreas Schwab
2008-03-04 13:15         ` Chris Moore
2008-03-05  5:13   ` Kenichi Handa
2008-03-05 16:18     ` Stefan Monnier
2008-03-05 16:50       ` Andreas Schwab
2008-03-06 11:20         ` Kenichi Handa
2008-03-07 23:04           ` Stefan Monnier
2008-03-10  0:54             ` Kenichi Handa
2008-03-10  3:26               ` Stefan Monnier [this message]
2008-03-16  9:15     ` Andreas Schwab
2008-03-17  0:48       ` Kenichi Handa

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

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

  git send-email \
    --in-reply-to=jwv8x0ruva7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=christopher.ian.moore@gmail.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=handa@m17n.org \
    --cc=rms@gnu.org \
    --cc=schwab@suse.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.