unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: wish: right alt/meta to switch keyboard layout while pressed
Date: Wed, 23 Nov 2005 08:07:14 +0200	[thread overview]
Message-ID: <87hda47x3i.fsf@jurta.org> (raw)
In-Reply-To: <200511222150.54248.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Tue, 22 Nov 2005 21:50:54 +0200")

> So, if I want to type an apostrophe from Russian keyboard layout, I
> have to type `C-\ ' C-\'.  If, however, the temporary-switching was
> implemented, I could do with `press-right-alt ' release-right-alt',
> which is obviously much easier.
>
> As far as I can tell, Emacs currently just ignores the right Alt.
>
> Can this be implemented easily?

I think the most natural way to do this in Emacs is to use C-q.
So to quote ' in an input method and not to translate it, you could
use C-q '.

However, this currently doesn't work.  C-q inserts a translated
character, and while C-q together with an input method read an input
sequence, the intermediate display in the echo area is quite messy.

It seems `quoted-insert' (C-q) attempts to do something with this
situation, and it let-binds `translation-table-for-input' to nil
before reading a quoted character, but this doesn't work for quoting
characters in input methods.  I propose the following patch to let-bind
`input-method-function' to nil as well.

Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.769
diff -c -r1.769 simple.el
*** lisp/simple.el	20 Nov 2005 18:08:55 -0000	1.769
--- lisp/simple.el	23 Nov 2005 06:04:04 -0000
***************
*** 609,615 ****
  digits are interpreted as a character code.  This is intended to be
  useful for editing binary files."
    (interactive "*p")
!   (let* ((char (let (translation-table-for-input)
  		 (if (or (not overwrite-mode)
  			 (eq overwrite-mode 'overwrite-mode-binary))
  		     (read-quoted-char)
--- 610,616 ----
  digits are interpreted as a character code.  This is intended to be
  useful for editing binary files."
    (interactive "*p")
!   (let* ((char (let (translation-table-for-input input-method-function)
  		 (if (or (not overwrite-mode)
  			 (eq overwrite-mode 'overwrite-mode-binary))
  		     (read-quoted-char)

-- 
Juri Linkov
http://www.jurta.org/emacs/

  parent reply	other threads:[~2005-11-23  6:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 19:50 wish: right alt/meta to switch keyboard layout while pressed Paul Pogonyshev
2005-11-22 22:31 ` Andreas Schwab
2005-11-23  5:14 ` Richard M. Stallman
2005-11-23 19:52   ` Paul Pogonyshev
2005-11-25 15:50     ` Richard M. Stallman
2005-11-25 18:00       ` Andreas Schwab
2005-11-23  6:07 ` Juri Linkov [this message]
2005-11-24 17:18 ` Stefan Monnier
2005-11-24 19:45   ` Paul Pogonyshev
2005-11-24 20:56     ` Stefan Monnier
2005-11-25 19:37       ` Paul Pogonyshev
2005-11-25 22:17         ` Stefan Monnier
2005-11-25 22:33           ` Paul Pogonyshev
2005-11-25 22:44             ` Aidan Kehoe
2005-11-26 16:43               ` Paul Pogonyshev
2005-11-27  5:26                 ` Tomas Zerolo
2005-11-26  8:15             ` Eugene Vlasov
2005-11-26 19:44               ` Paul Pogonyshev
2005-11-28 20:33                 ` Juri Linkov
2005-11-26 15:10             ` Stefan Monnier
2005-11-26 16:46               ` Paul Pogonyshev
2005-11-27 18:19                 ` Stefan Monnier
2005-11-27 21:39                   ` Paul Pogonyshev
2005-11-28  2:39                     ` Mode_switch in Emacs (was: wish: right alt/meta to switch keyboard layout while pressed) Stefan Monnier
2005-11-28 20:27                       ` Juri Linkov
2005-11-28 22:14                         ` Mode_switch in Emacs Stefan Monnier
2005-11-28 23:08                           ` Juri Linkov
2005-11-29 16:24                             ` Stefan Monnier
2005-11-29 19:54                               ` Paul Pogonyshev
2005-11-30  2:43                               ` Juri Linkov
2005-11-28 20:27               ` wish: right alt/meta to switch keyboard layout while pressed Juri Linkov
2005-11-28 23:14                 ` Juri Linkov
2005-11-26  4:22       ` Richard M. Stallman
     [not found] ` <200511261925.20191.pogonyshev@gmx.net>
     [not found]   ` <17288.41589.506361.323637@parhasard.net>
2005-11-26 23:01     ` thoughts on interaction of key bindings and input methods (was Re: wish: right alt/meta to switch keyboard layout while pressed) Paul Pogonyshev
2005-11-27  1:48       ` Ben Wing
2005-11-27  5:35         ` Tomas Zerolo
2005-11-27 11:29         ` thoughts on interaction of key bindings and input methods (was Re: wish: right alt/meta to switch keyboard layout while pressed ) Paul Pogonyshev
2005-11-28  5:25           ` thoughts on interaction of key bindings and input methods (was Re: wish: right alt/meta to switch keyboard layout while pressed) Ben Wing
2005-11-28 19:09             ` Paul Pogonyshev
2005-11-27 18:35         ` Aidan Kehoe
2005-11-28  2:39 ` wish: right alt/meta to switch keyboard layout while pressed Stefan Monnier
2005-11-28 20:28   ` Juri Linkov
2005-11-28 22:16     ` Stefan Monnier

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=87hda47x3i.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.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).