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: Avoiding CLI-emacs character suckage on OS X? Date: Fri, 23 Nov 2007 00:40:14 -0800 (PST) Organization: http://groups.google.com Message-ID: References: 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 1195807276 30565 80.91.229.12 (23 Nov 2007 08:41:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2007 08:41:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 23 09:41:23 2007 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.50) id 1IvU6E-00089q-OS for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2007 09:41:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvU60-0006RE-Dc for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2007 03:41:08 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s19g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 104 Original-NNTP-Posting-Host: 69.236.97.82 Original-X-Trace: posting.google.com 1195807215 7376 127.0.0.1 (23 Nov 2007 08:40:15 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 23 Nov 2007 08:40:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s19g2000prg.googlegroups.com; posting-host=69.236.97.82; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12 (KHTML, like Gecko) Version/3.0.4 Safari/523.12, gzip(gfe), gzip(gfe) Content-Disposition: inline Original-Xref: shelby.stanford.edu gnu.emacs.help:153996 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:49426 Archived-At: Moira (Phillip) wrote: > One thing with the countless emacs options is really bugging me. In > the OS X Terminal I can either choose to use Alt as the Meta key and > shed the means to insert such things as "\", "@", "=E2=82=AC" and so forth= > (German KB), or I can choose to leave it and then have to use Esc > whenever I do a single Meta action, which really sucks when scrolling > or doing other M intensive stuff. > > Is there any more or less standard/default way I can insert special > characters such as backslash, @. =E2=82=AC and others or should I build my= > own lisp-script for that? not quite sure precisely what's the prob.... i'd recommend that you use PC keyboard's Alt (or Apple keyboard's Cmd) as emacs's Meta, then define (global-set-key (kbd "M-i a") (lambda () (interactive) (insert "=CE=B1"))) enter any special char you need to type. Here's more detail Q: How to type this character =C3=A9 ? To type characters such as =C3=A9 =C3=A0 =C3=BC =C3=AE =C3=B1, type: character key press ------------------------------ =C3=A9 Ctrl+x 8 ' e =C3=A0 Ctrl+x 8 ` a =C3=BC Ctrl+x 8 " u =C3=AE Ctrl+x 8 ^ i =C3=B1 Ctrl+x 8 ~ n To see all the non-ascii characters you can type with Ctrl+x 8 prefix, type Ctrl+x 8 Ctrl+h. Here is a sample of characters you can type by the Ctrl+x 8 scheme: =C2=A1= =C3=A7 =C2=A3=C2=A2=C2=A5 =C2=A9=C2=AE=E2=84=A2 =E2=80=A2=C2=BA=E2=80=A0=E2=80=A1 = =E2=80=9C=E2=80=9D=E2=80=98=E2=80=99=C2=AB=C2=BB =C2=B1=CF=80=E2=88=9E. (If you are on a Mac, these characters can be typed by holding the option key in most applications. To see what characters are available, you can pull the Keyboard Viewer. To start Keyboard Viewer, go to System Preferences=E2=86=92International=E2=86=92Input Menu tab, the click a= t the bottom =C2=ABShow input menu in menu bar=C2=BB. Then, on the input menu on t= op right, there's a Show Keyboard Viewer menu.) Q: How to use abbrev to type unicode chars? A: Suppose you type a lot math and need math symbols such as: alpha =CE=B1, beta =CE=B2, gamma =CE=B3, theta =CE=B8, Infinity =E2=88=9E etc. You can set= up a abbrev- mode, so that, when you type =E2=80=9Calpha=E2=80=9D, it automatically becom= es =E2=80=9C=CE=B1=E2=80=9D. Here's what to do. Put the following in your emacs init file: (define-abbrev-table 'global-abbrev-table '( ("alpha" "=CE=B1" nil 0) ("beta" "=CE=B2" nil 0) ("gamma" "=CE=B3" nil 0) ("theta" "=CE=B8" nil 0) ("Infinity" "=E2=88=9E" nil 0) ("ar1" "=E2=86=92" nil 0) ("ar2" "=E2=87=92" nil 0) )) Then, turn on the abbrev-mode by =E2=80=9CAlt+x abbrev-mode=E2=80=9D. Then, = when you type alpha, it will become =CE=B1. Reference: (info "(emacs)Abbrevs"). Q: How to set a keystroke to type a unicode char? If you have some characters that you use often, you can make emacs inserting them with a single keypress. For example, put the following code in your ~/.emacs, then, each time you press the 6 key on the number pad, a arrow will be inserted. (global-set-key [kp-6] (lambda () (interactive) (insert "=E2=86=92")) ) You can also set shortcut by key sequence. In the following, typing =E2=80=9CAlt+i a=E2=80=9D will insert =CE=B1. (global-set-key (kbd "M-i a") (lambda () (interactive) (insert "=CE=B1"))) (global-set-key (kbd "M-i b") (lambda () (interactive) (insert "=CE=B2"))) (global-set-key (kbd "M-i t") (lambda () (interactive) (insert "=CE=B8"))) above from Emacs and Unicode Tips http://xahlee.org/emacs/emacs_n_unicode.html Xah xah@xahlee.org =E2=88=91 http://xahlee.org/