From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Problem with viper-replace-char and Swedish characters on w32 Date: Wed, 29 Mar 2006 16:01:14 -0500 Message-ID: References: <4423DA03.2040503@student.lu.se> <442AE207.6000802@student.lu.se> <442AF208.6090705@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143666104 27092 80.91.229.2 (29 Mar 2006 21:01:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 29 Mar 2006 21:01:44 +0000 (UTC) Cc: Michael Kifer , Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 29 23:01:40 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FOhnK-0008Se-LG for ged-emacs-devel@m.gmane.org; Wed, 29 Mar 2006 23:01:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FOhnK-0006Zc-9z for ged-emacs-devel@m.gmane.org; Wed, 29 Mar 2006 16:01:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FOhn9-0006ZF-Ih for emacs-devel@gnu.org; Wed, 29 Mar 2006 16:01:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FOhn9-0006YY-3E for emacs-devel@gnu.org; Wed, 29 Mar 2006 16:01:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FOhn8-0006YG-VK for emacs-devel@gnu.org; Wed, 29 Mar 2006 16:01:22 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FOhpA-0003eu-GX for emacs-devel@gnu.org; Wed, 29 Mar 2006 16:03:28 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id D93492CE9AD; Wed, 29 Mar 2006 16:01:20 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id B6A92445C; Wed, 29 Mar 2006 16:01:14 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id A26387152F; Wed, 29 Mar 2006 16:01:14 -0500 (EST) Original-To: Lennart Borgman In-Reply-To: <442AF208.6090705@student.lu.se> (Lennart Borgman's message of "Wed, 29 Mar 2006 22:46:00 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52198 Archived-At: > Thanks, Stefan. Is something like this what should be done then: > (let* ((ch (read-char "cs:"))) > (insert (decode-coding-string (char-to-string ch) > (keyboard-coding-system)))) This also has its share of problems since keyboard-coding-system may be multibyte, in which case you might need to read more than 1 char ;-) (insert (aref (read-key-sequence) 0)) is another approch which will correctly solve those problems, but will suffer from yet others: typically after hitting things like C-c or C-x Emacs will just sit still, waiting for more input before processing it. You can get closer with (insert (let ((overriding-terminal-local-map (make-sparse-keymap))) (aref (read-key-sequence) 0))) but C-x will still hang because of the C-x 8 prefix in key-translation-map, and similarly for ESC because of the bindings in function-key-map. I'm not really sure what should be the right answer... I'm not even sure what should be the right behavior. Stefan