Subject: bug#20499: C-x 8 shorthands for curved quotes, Euro, etc.

From: Ivan Shmakov <[email-masked]>
Date: Wed, 06 May 2015 22:20:54 +0000

>>>>> Paul Eggert <[email-masked]> writes:

 >>> How about also adding s, t, S, T with cedilla, dotless i, and I
 >>> with dot.  Also c and C with a hacek.

 >> Sure, I can look into that.  Also the slashed L and l, perhaps, so
 >> that we can spell names like Łukasiewicz.

 > Attached is a revised patch that adds support for the abovementioned
 > characters, plus other Latin characters that might be encountered by
 > people mentioning foreign names.  It makes room by rejiggering three
 > of the less-commonly used entries in the C-x 8 table.

 > --------------090904020002020306060104
 > Content-Type: text/x-patch;
 >  name="0001-C-x-8-shorthands-for-curved-quotes-Euro-etc.patch"

	This MIME part sure wants ‘; charset=UTF-8’.  Otherwise, Gnus
	does no decoding, and Emacs shows the contents with the likes of
	\304\260.

 > Content-Transfer-Encoding: 8bit
 > Content-Disposition: attachment;
 >  filename="0001-C-x-8-shorthands-for-curved-quotes-Euro-etc.patch"

 > From aafde36c45bd0341b07707409873fb93cbbb33f1 Mon Sep 17 00:00:00 2001
 > From: Paul Eggert <[email-masked]>
 > Date: Mon, 4 May 2015 22:41:20 -0700
 > Subject: [PATCH] C-x 8 shorthands for curved quotes, Euro, etc.
 > MIME-Version: 1.0
 > Content-Type: text/plain; charset=UTF-8
 > Content-Transfer-Encoding: 8bit

	I presume that /this/ was intended to be the MIME part /header/,
	yet it ended up being in the part /body./

 > +    withdrawn  still works   character
 > +    C-x 8 .    C-x 8 . SPC   · U+00B7 MIDDLE DOT
 > +    C-x 8 =    C-x 8 = SPC   ¯ U+00AF SPACING MACRON
 > +    C-x 8 u    C-x 8 m       µ U+00B5 MICRO SIGN

	I believe that both C-x 8 . and C-x 8 u are too convenient to be
	dropped without more discussion.  For one thing, · seems more
	“common” a character than İ.  Other than that, C-x 8 . . feels
	easier to type than C-x 8 SPC.

 > -;;; iso-transl.el --- keyboard input definitions for ISO 8859-1  -*- coding: utf-8 -*-
 > +;;; iso-transl.el --- keyboard input for ISO characters -*- coding: utf-8 -*-

	I guess we may safely state “ISO 10646” here.

 > +;; This package supports all characters defined by ISO 8859-1,
 > +;; along with many other Latin characters and a few other characters
 > +;; commonly used in English and basic math.

	… And may also mention it here.

 >      ("-"    . [?])
 > -    ("*."   . [?·])

	The removal above doesn’t seem to be strictly necessary.  The
	same for the *= and *u ones.

 >      ("~~"   . [?¬])
 > +    ("=A"   . [?Ā])
 > +    ("=a"   . [?ā])
 > +    ("uA"   . [?Ă])
 > +    ("ua"   . [?ă])
 > +    ("gA"   . [?Ą])

	… Also, did you consider generating this list automatically,
	based on the codepoint properties already known to Emacs?
	Something along the lines of the function MIMEd, which readily
	produces a list of entries for the following 133 characters.
	(Three spaces added for symmetry purposes.)

    À Á Â Ã Ä È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ù Ú Û Ü Ý
    à á â ã ä è é ê ë ì í î ï ñ ò ó ô õ ö ù ú û ü ý
    ÿ   Ā ā Ć ć Ĉ ĉ Č č Ď ď Ē ē Ě ě Ĝ ĝ Ĥ ĥ Ĩ ĩ Ī ī Ĵ ĵ Ĺ ĺ
    Ľ ľ Ń ń Ň ň Ō ō Ŕ ŕ Ř ř Ś ś Ŝ ŝ Š š Ť ť Ũ ũ Ū ū Ŵ ŵ Ŷ ŷ
    Ÿ   Ź ź Ž ž Ǎ ǎ Ǐ ǐ Ǒ ǒ Ǔ ǔ Ǧ ǧ Ǩ ǩ   ǰ Ǵ ǵ Ǹ ǹ Ș ș Ț ț
    Ȟ ȟ Ȳ ȳ

-- 
FSF associate member #7257  http://am-1.org/~ivan/      … 3013 B6A0 230E 334A
(defun code-decomposition-to-iso-transl-map (&optional from to)
  (unless from (setq from #xa8))
  (unless to   (setq to   #x2b0))
  (let ((acc nil)
	(i   from))
    (while (< i to)
      (let* ((deco (get-char-code-property i 'decomposition))
             ;; FIXME: handle the (eq 'compat (car deco)) case here
	     (str (pcase deco
		    (`(,c #x300) (string ?` c))
		    (`(,c #x301) (string ?' c))
		    (`(,c #x302) (string ?^ c))
		    (`(,c #x303) (string ?~ c))
		    (`(,c #x304) (string ?= c))
		    (`(,c #x308) (string 34 c))
		    (`(,c #x30c) (string ?v c))
		    (`(,c #x326) (string 59 c))
		    (`(,c #x326) (string ?, c)))))
	(when (and str (< (aref str 1) #x7f)) ; Is an ASCII character?
	  (setq acc (cons (cons str (vector i)) acc))))
      (setq i (+ 1 i)))
    ;; .
    acc))