From: Dmitry Gutov <dgutov@yandex.ru>
To: Paul Eggert <eggert@cs.ucla.edu>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master c4151eb: Improve the optional translation of quotes
Date: Thu, 25 Jun 2015 17:56:03 +0300 [thread overview]
Message-ID: <558C1683.3030302@yandex.ru> (raw)
In-Reply-To: <558C0A90.1040107@cs.ucla.edu>
On 06/25/2015 05:05 PM, Paul Eggert wrote:
> I didn't see any patch in that email, unfortunately -- perhaps you
> forgot to include it?
Sorry, it's attached now.
> True. But it's still a temptation we should strive to avoid.
Depends on what we call complicated. Like Richard mentioned, at least we
can try to leave unpaired quotes alone. Or not, I don't really care that
much personally.
>> - Like you said: "describe-variable should curve the quotes in the doc
>> string,
>> but not in the contents of the variable". The code that prints the
>> value will
>> need to add some text property to it ("verbatim"?
>> "font-lock-ignore"?), and the
>> font-lock rule can look it up and skip those regions. Nothing too hard.
>
> As you'll recall, I don't understand font-lock.
There's no requirement for you to implement all of it yourself. You can
take my patch, look for problems, and ask for them to be fixed.
You'll have to do the substitute-command-keys part, though.
> That being said, I
> worry that all this stuff would be complicated and would involve using
> undocumented or poorly-documented features (see Bug#20613).
I've enumerated practical considerations of having it implemented *not*
in font-lock. If some font-lock features lack documentation, demand it
to be added, then.
> Also, it's not clear how the overall approach would work on limited
> displays that don't have alternate fonts and/or colors. Suppose, for
> example, that the user is running 'emacs --color=never' on a character
> terminal?
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index f99e916..6256513 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -287,6 +287,13 @@ Commands:
\\{help-mode-map}"
(set (make-local-variable 'revert-buffer-function)
'help-mode-revert-buffer)
+ (setq font-lock-defaults '(nil t))
+ (font-lock-add-keywords
+ nil '(("`\\([^[:space:]'`‘’][^'`‘’]*\\)?'"
+ . (0 (progn (compose-region (match-beginning 0)
+ (1+ (match-beginning 0)) ?‘)
+ (compose-region (1- (match-end 0)) (match-end 0) ?’)
+ nil)))))
(set (make-local-variable 'bookmark-make-record-function)
'help-bookmark-make-record))
next prev parent reply other threads:[~2015-06-25 14:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150619073901.5856.32718@vcs.savannah.gnu.org>
[not found] ` <E1Z5qtC-0001Xe-1y@vcs.savannah.gnu.org>
2015-06-21 19:09 ` [Emacs-diffs] master c4151eb: Improve the optional translation of quotes Dmitry Gutov
2015-06-21 19:56 ` Paul Eggert
2015-06-21 19:57 ` Dmitry Gutov
2015-06-21 20:03 ` Paul Eggert
2015-06-21 20:29 ` Dmitry Gutov
2015-06-21 20:46 ` Paul Eggert
2015-06-21 23:52 ` Dmitry Gutov
2015-06-22 6:50 ` Paul Eggert
2015-06-22 15:09 ` Dmitry Gutov
2015-06-23 5:36 ` Paul Eggert
2015-06-23 10:55 ` Dmitry Gutov
2015-06-24 5:24 ` Paul Eggert
2015-06-25 12:52 ` Dmitry Gutov
2015-06-25 14:05 ` Paul Eggert
2015-06-25 14:56 ` Dmitry Gutov [this message]
2015-07-31 18:51 ` Paul Eggert
2015-07-31 19:24 ` Dmitry Gutov
2015-08-01 1:16 ` Paul Eggert
2015-08-01 1:28 ` Dmitry Gutov
2015-06-25 14:59 ` Dmitry Gutov
2015-06-25 15:11 ` Eli Zaretskii
2015-06-25 15:33 ` Dmitry Gutov
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=558C1683.3030302@yandex.ru \
--to=dgutov@yandex.ru \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@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.