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: kbd vs read-key-sequence Date: Mon, 12 Mar 2007 11:19:19 -0400 Message-ID: References: <45E8657D.4080202@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1173712796 24734 80.91.229.12 (12 Mar 2007 15:19:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Mar 2007 15:19:56 +0000 (UTC) Cc: lekktu@gmail.com, jasonr@gnu.org, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 12 16:19:50 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HQmJQ-0003sc-SZ for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2007 16:19:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQmK5-0001Rh-Su for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2007 10:20:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQmJv-0001Rc-Mq for emacs-devel@gnu.org; Mon, 12 Mar 2007 11:20:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQmJu-0001RQ-0O for emacs-devel@gnu.org; Mon, 12 Mar 2007 11:20:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQmJt-0001RN-Td for emacs-devel@gnu.org; Mon, 12 Mar 2007 10:20:17 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HQmJ5-0007xs-QP; Mon, 12 Mar 2007 11:19:28 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E63DD2CF2F5; Mon, 12 Mar 2007 11:19:26 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 11FDF3FE0; Mon, 12 Mar 2007 11:19:20 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id F1C506CB0F; Mon, 12 Mar 2007 11:19:19 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Sun\, 11 Mar 2007 16\:01\:26 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (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-detected-kernel: Linux 2.6 (newer, 3) 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:67794 Archived-At: > Off the top of my head: > - saving may change the char thanks to unify-8859-on-encoding > (e.g. you copy a iso-8859-15 char to your .emacs which you then save > in iso-8859-1). > Is there a procedure we can recommend for the user to avoid this? I guess "only ever use one and only one encoding". E.g. don't mix latin-1 and latin-9. (with-silly-mode "use utf-8" or better yet "use emacs-unicode") (although, maybe utf-8 won't solve it all either, because we may end up with similar problem where one side uses the single char =E9 while the other uses a composed "e" and "'"). > - the coding-system may not be properly detected, especially if you > configure your auto-dtection in your .emacs: the configuration will > apply to all files you open but not to the loading of .emacs > Can you avoid this by specifying the coding-system explicitly in .emacs? > We could recommend that users do so. Yes, with -*- coding -*-. It should also work correctly as long as they *don't* specify the encoding via elisp code in their .emacs (with calls to set-language-environment, for example). >> Anyway, if you want to bind a character with modifiers, you can just use >> a construct in .emacs that applies the modifier to the desired base >> character, such as \M- in a string, or (meta CHAR). >> Is there a case where that doesn't work? > Because the way the event is decoded through read-key-sequence is not > necessarily the same. E.g. while ? may get turned into ??= , it > may be the case that ?\M- stays unchanged. > How does that happen? See the OP. It seems that encoded-kb.el has such a limitation (it should probably be considered as a bug, but there may be good reasons for it, I don't know). > Maybe that is a bug; if so, we should fix it. That's what this thread is about supposedly. > We could recommend that people write (meta ?). > That would eliminate this particular problem, right? No. It would make it work on those systems which have the bug (e.g. w32 right now), but would not work on systems where read-key-sequence correctly decodes such a key-combination into ?\M-=E9. > These do not make things perfect, but I think they might be enough > to enable users to get reliable results. What do you think? I don't think it'll really be reliable, but we can definitely provide guidelines and hints. Stefan