From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: .emacs poser Date: 17 Dec 2013 21:15:00 GMT Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1387316067 8345 80.91.229.3 (17 Dec 2013 21:34:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Dec 2013 21:34:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 17 22:34:31 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vt2Hf-0005lR-IZ for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Dec 2013 22:34:31 +0100 Original-Received: from localhost ([::1]:35791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vt2Hf-00018l-7J for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Dec 2013 16:34:31 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 60 Original-X-Trace: individual.net Rm3ai6vJ2/PppLnpslNV6gMX/4D+zf6tNGqKec44/g1gqGEAu7 Cancel-Lock: sha1:M/LU7wNyWS3tEtKEgu9wvNIwXKs= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:202796 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95065 Archived-At: Doug Lewan wrote: > I'm surprised that there's only one mention of input methods and so > much about composing characters, which is, as you point out, a little > clumsy. Yeah, my thoughts exactly. > It's easy to extend an input method with new rules. I frequently use > the latin-1-prefix mode for a handful of special characters that I > use. The lisp to add my rules looks like this: > > (setq default-input-method "latin-1-prefix") > (let ((quail-setup-buf (get-buffer-create "*Quail setup*"))) > (save-excursion (set-buffer quail-setup-buf) > (toggle-input-method) > ;; MAINTENANCE Look for SYMBOLS > (quail-defrule ":A" ?∀) > (quail-defrule ":E" ?∃) > (quail-defrule ":e" ?∈) > ...)) It's also possible to define completely new input methods. I load the following code from my init.el: (quail-define-package "arabic-trans" "Ar-trans" "A>" t "Input method for Arabic transcription." nil t nil nil nil nil nil nil nil nil t) (quail-define-rules (".-" ?ʔ) ;; U0294 # IPA GLOTTAL STOP ("-A" ?Ā) ;; U0100 # LATIN CAPITAL LETTER A WITH MACRON ("-a" ?ā) ;; U0101 # LATIN SMALL LETTER A WITH MACRON ("-D" ?Ḏ) ;; U1E0E # LATIN CAPITAL LETTER D WITH LINE BELOW ("-d" ?ḏ) ;; U1E0F # LATIN SMALL LETTER D WITH LINE BELOW ...) > I also notice this comment near that code: > ;; This seems rather a bit of a hack. > That was my sense long ago; I don't know if that's really a fair sentiment anymore. Well, one thing that I find strange about defining input methods is that the functions to define rules do not say to which input method the new rule should be added. Apparently, quail-defrule adds the rule to the current input method, while quail-define-rules seems to add them to the most recently defined one. Another thing that I find mildly annoying about input methods is that even though you can set default-input-method, you still need to switch input methods yourself. Every new buffer starts out without an input method, so you need to do `C-\` first. Other than that, I think they're the best way to input non-ASCII characters. -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)