From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Alt+numpad to write special symbols Date: Tue, 29 Sep 2009 21:40:41 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1254274861 15560 80.91.229.12 (30 Sep 2009 01:41:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Sep 2009 01:41:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: juri@jurta.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 30 03:40:54 2009 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 1MsoBZ-0008T4-6n for ged-emacs-devel@m.gmane.org; Wed, 30 Sep 2009 03:40:53 +0200 Original-Received: from localhost ([127.0.0.1]:52828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsoBY-0006mA-Jk for ged-emacs-devel@m.gmane.org; Tue, 29 Sep 2009 21:40:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsoBT-0006lH-H4 for emacs-devel@gnu.org; Tue, 29 Sep 2009 21:40:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsoBP-0006l1-1F for emacs-devel@gnu.org; Tue, 29 Sep 2009 21:40:47 -0400 Original-Received: from [199.232.76.173] (port=51434 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsoBO-0006ky-VE for emacs-devel@gnu.org; Tue, 29 Sep 2009 21:40:42 -0400 Original-Received: from mail-pz0-f181.google.com ([209.85.222.181]:39558) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsoBO-00051Z-HE for emacs-devel@gnu.org; Tue, 29 Sep 2009 21:40:42 -0400 Original-Received: by pzk11 with SMTP id 11so3638420pzk.14 for ; Tue, 29 Sep 2009 18:40:41 -0700 (PDT) Original-Received: by 10.115.100.22 with SMTP id c22mr9393297wam.58.1254274841079; Tue, 29 Sep 2009 18:40:41 -0700 (PDT) X-Google-Sender-Auth: 903e90d85b04ae4f X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:115797 Archived-At: > Like in GTK+ `Ctrl+Shift+U hex RET' http://en.wikipedia.org/wiki/Unicode_= input > we could finish entering the number with RET, e.g. `M-2 M-7 M-0 M-f RET'. > Or expect a fixed-length four-digit number `M-2 M-7 M-0 M-f' where the la= st > fourth digit finishes the sequence. In any case, your up/down events cod= e > would be useful for other purposes as well. If I understand correctly what the goal is re: hex input and Unicode, following was written to accomplish just such task: (defun mon-test-keypresses (&optional first second third) "Used to test if additional optional args have been passed to interactive= .\n EXAMPLE:\nM-34 M-x mon-test-keypresses\n =3D> \(\(meta . 51\) \(meta . 52\) \(meta . 120\) mon-test-keypresses\)\n= =E2=96=BA=E2=96=BA=E2=96=BA" (interactive "P\nP\np") (let ((accum-string '()) (accum-event '()) (self 'mon-test-keypresses)) (mapc (lambda (x) (cond ((=3D x 13) nil) ((or (eql (car (event-modifiers x)) 'meta) (eql (car (event-modifiers x)) 'control)) (setq accum-event (cons (cons (car (event-modifiers x)) (event-basic-type x)) accum-event))) (t (setq accum-string (cons (char-to-string (event-basic-type x)) accum-string))))) (this-command-keys-vector)) (setq accum-event (reverse accum-event)) (setq accum-string (reverse accum-string)) (setq accum-string (apply 'concat accum-string)) (setq accum-string `(,@accum-event ,(if (string=3D accum-string self) self accum-string))) (prin1 accum-string))) s_P