[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc stri
From: |
Dmitry Gutov |
Subject: |
Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings |
Date: |
Wed, 20 May 2015 04:16:46 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 |
On 05/20/2015 02:18 AM, Paul Eggert wrote:
The problem they're trying to address is that one can't reasonably
expect a regular expression to handle cases where grave accent or
apostrophe is itself being quoted `like this'.
Those two cases look simple (replace ` and the first matching ', the
second ` would be skipped), but if the apostrophe were quoted, it'd have
to be escaped: `\''.
And it's not very simple, but a regular expression can distinguish
between an escaped and an unescaped character. Examples:
https://github.com/emacs-mirror/emacs/blob/9d35bb8d6518bb913ab08bace2af08963c003177/lisp/progmodes/js.el#L1698
https://github.com/emacs-mirror/emacs/blob/9d35bb8d6518bb913ab08bace2af08963c003177/lisp/progmodes/xref.el#L757
Though granted, that's a lot of backslashes.
Another possibility, which would also be fine and would be simpler,
would be to replace all curved double quotes in doc strings with
straight double-quotes. I could easily do that if you prefer; it's no
big deal either way.
Not a big deal indeed, but consistency would be preferable IMHO.
- Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Dmitry Gutov, 2015/05/19
- Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Paul Eggert, 2015/05/19
- Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Stefan Monnier, 2015/05/20
- Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Paul Eggert, 2015/05/21
- Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Dmitry Gutov, 2015/05/21
- Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Paul Eggert, 2015/05/21
Re: [Emacs-diffs] master 9d35bb8: Fix minor quoting problems in doc strings, Yuri Khan, 2015/05/20