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: Sat, 16 May 2015 14:20:39 -0700 [thread overview]
Message-ID: <5557B4A7.9070604@cs.ucla.edu> (raw)
In-Reply-To: <55544199.3040704@cs.ucla.edu>
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
Paul Eggert wrote:
> A proposed patch is attached; it worked for me.
On further thought, the code affects global settings so it should be done only
if FRAME is nil. Also, it should treat double-quotes like single-quotes, and
the ASCII approximations should use straight quotes. This code is separable
from Bug#20545, and is also separable from the issue of how to quote in doc
strings, as the code is useful whenever text with English quotes appears on an
obsolescent display lacking them. So I installed the attached patch.
[-- Attachment #2: 0001-ASCIIfy-curved-quotes-on-displays-lacking-them.txt --]
[-- Type: text/plain, Size: 1357 bytes --]
From a92e964a9809ada92b29b23ab6191fc7f3faad4d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 16 May 2015 13:47:36 -0700
Subject: [PATCH] ASCIIfy curved quotes on displays lacking them
* lisp/international/mule-cmds.el (set-locale-environment):
If curved quotes don't work, display straight ASCII approximations
(Bug#20545).
---
lisp/international/mule-cmds.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index fd892aa..4b63cb8 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2708,6 +2708,14 @@ See also `locale-charset-language-names', `locale-language-names',
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)))
+ ;; If curved quotes don't work, display straight ASCII approximations.
+ (unless frame
+ (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
next prev parent reply other threads:[~2015-05-16 21:20 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
2015-05-16 21:20 ` Paul Eggert [this message]
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=5557B4A7.9070604@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.