From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: elisp question:keyboard-translate with hyper fail? Date: Fri, 11 Mar 2011 23:22:14 -0800 (PST) Organization: http://groups.google.com Message-ID: <70e1c1e8-81b6-474e-b1ba-c9b94b697258@22g2000prx.googlegroups.com> References: <86aa8db7-62db-478d-940d-82609c8dde34@18g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299915654 30949 80.91.229.12 (12 Mar 2011 07:40:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2011 07:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 12 08:40:50 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PyJRR-0001Zq-M0 for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Mar 2011 08:40:49 +0100 Original-Received: from localhost ([127.0.0.1]:48071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyJRR-0007FR-1p for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Mar 2011 02:40:49 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!22g2000prx.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 70 Original-NNTP-Posting-Host: 76.126.112.84 Original-X-Trace: posting.google.com 1299914534 22013 127.0.0.1 (12 Mar 2011 07:22:14 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 12 Mar 2011 07:22:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 22g2000prx.googlegroups.com; posting-host=76.126.112.84; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:185871 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80016 Archived-At: ugh, just tried this and still doesn't work. (define-key key-translation-map [?\H-8] ?\=E2=97=87) am giving up at this point. in case anyone's interested, i'm trying to make hyper key do unicode symbols. =CE=99 have it all working by (global-set-key (kbd "H-3") (lambda () (interactive) (insert "=E2=80=A2")))= ; bullet but yesterday i got smart and thought i'll re-write them using keyboard-translate instead. (just had a major refactoring of my .emacs.) possibly i'll file a bug report. Thanks for the helpful answers. Xah On Mar 11, 11:07=C2=A0pm, Xah Lee wrote: > On Mar 11, 6:54=C2=A0pm, Stefan Monnier wrote: > > > > ;; Swap =E2=80=9CCtrl+x=E2=80=9D and =E2=80=9CCtrl+t=E2=80=9D, so it'= s easier to type on Dvorak layout > > > (keyboard-translate ?\C-t ?\C-x) > > > (keyboard-translate ?\C-x ?\C-t) > > > There are 32 Ctrl+letter combinations which are characters, and the > > above two are among them. =C2=A0These are exceptional special cases due > > to history. =C2=A0My general recommendation is to not use keyboard-tran= slate > > but key-translation-map or function-key-map, which work on arbitrary > > key sequences rather only on single-char events. > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan > > thanks to all. > > perhaps the doc can be improved. > > i just read up the elisp doc and it actually gives a C- example. > > =C2=A0-- Function: keyboard-translate from to > =C2=A0 =C2=A0 =C2=A0This function modifies `keyboard-translate-table' to = translate > =C2=A0 =C2=A0 =C2=A0character code FROM into character code TO. =C2=A0It = creates the > =C2=A0 =C2=A0 =C2=A0keyboard translate table if necessary. > > =C2=A0 =C2=A0Here's an example of using the `keyboard-translate-table' to= make > `C-x', `C-c' and `C-v' perform the cut, copy and paste operations: > > =C2=A0 =C2=A0 =C2=A0(keyboard-translate ?\C-x 'control-x) > =C2=A0 =C2=A0 =C2=A0(keyboard-translate ?\C-c 'control-c) > =C2=A0 =C2=A0 =C2=A0(keyboard-translate ?\C-v 'control-v) > =C2=A0 =C2=A0 =C2=A0(global-set-key [control-x] 'kill-region) > =C2=A0 =C2=A0 =C2=A0(global-set-key [control-c] 'kill-ring-save) > =C2=A0 =C2=A0 =C2=A0(global-set-key [control-v] 'yank) > > also note it uses the syntax =E3=80=8C'control-x=E3=80=8D. I don't quite = understand > it... > > should it be a bug report? > > =C2=A0Xah