all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20545@debbugs.gnu.org
Subject: bug#20545: New minor mode Electric Punct
Date: Wed, 13 May 2015 23:32:57 -0700	[thread overview]
Message-ID: <55544199.3040704@cs.ucla.edu> (raw)
In-Reply-To: <83iobwjt3s.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

Eli Zaretskii wrote:
> I fear it will just be a source of confusion.

Well, 8-bit terminals are no longer that common (at least when developing Emacs) 
so it's no big deal either way, and as it's easier to do it without highlighting 
let's try it that way.  A proposed patch is attached; it worked for me.

Stefan Monnier wrote:
> The real test is when the environment
> uses utf-8 but the terminal's font fails to include the glyphs.

That can easily happen with other characters, but in practice nowadays I think 
everybody has glyphs for curved quotes.  This is in part due to Microsoft 
Windows putting curved quotes in their most-popular 8-bit character set starting 
with MS-Windows 1.0 in 1985.  This put a lot of pressure on everybody else to 
support these glyphs one way or another, and it has been thirty years now....

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Work-better-on-terminals-sans-curved-single-quotes.patch --]
[-- Type: text/x-patch; name="0001-Work-better-on-terminals-sans-curved-single-quotes.patch", Size: 1302 bytes --]

From dd42a7ba816df0d209c0f1e965ee036c62c0337a Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 13 May 2015 23:15:23 -0700
Subject: [PATCH] Work better on terminals sans curved single quotes

* lisp/international/mule-cmds.el (set-locale-environment):
If single quotation marks are not displayable,
show ASCII approximations instead.
---
 lisp/international/mule-cmds.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index fd892aa..2805671 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2708,6 +2708,13 @@ See also `locale-charset-language-names', `locale-language-names',
 	(set-terminal-coding-system 'utf-8)
 	(set-keyboard-coding-system 'utf-8)))
 
+    ;; If single quotation marks don't work, display ASCII approximations.
+    (dolist (char-repl '((?‘ . [?\`]) (?’ . [?\'])))
+      (when (not (char-displayable-p (car char-repl)))
+        (or standard-display-table
+            (setq standard-display-table (make-display-table)))
+        (aset standard-display-table (car char-repl) (cdr char-repl))))
+
     ;; Default to A4 paper if we're not in a C, POSIX or US locale.
     ;; (See comments in Flocale_info.)
     (unless frame
-- 
2.1.0


  parent reply	other threads:[~2015-05-14  6:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 23:55 bug#20545: New minor mode Electric Punct Paul Eggert
2015-05-11 15:00 ` Eli Zaretskii
2015-05-13  7:48   ` Paul Eggert
2015-05-13 13:10     ` Stefan Monnier
2015-05-13 14:49       ` Paul Eggert
2015-05-13 17:05         ` Eli Zaretskii
2015-05-14  3:52         ` Stefan Monnier
2015-05-14 14:54           ` Eli Zaretskii
2015-05-13 16:54       ` Eli Zaretskii
2015-05-13 16:38     ` Eli Zaretskii
2015-05-13 16:56       ` Paul Eggert
2015-05-13 17:16         ` Eli Zaretskii
2015-05-13 18:10           ` Eli Zaretskii
2015-05-14  6:32           ` Paul Eggert [this message]
2015-05-16 21:20             ` Paul Eggert
2015-05-17 14:33               ` Eli Zaretskii
2015-05-17 16:58                 ` Paul Eggert
2015-05-17 19:04                   ` Eli Zaretskii
2015-06-01  3:06                     ` bug#20545: Transliterating curved to straight quotes in 8-bit environments Paul Eggert
2015-06-01 14:31                       ` Eli Zaretskii
2015-05-11 15:57 ` bug#20545: New minor mode Electric Punct Stefan Monnier
2015-05-13  7:33   ` Paul Eggert
2015-05-11 16:48 ` Artur Malabarba
2015-05-26 11:24 ` bug#20545: New minor mode Electric Quote Paul Eggert
2015-05-27 14:24   ` Eli Zaretskii
2015-05-27 15:27     ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55544199.3040704@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=20545@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.