[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagno

From: Paul Eggert
Subject: Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagnostics
Date: Mon, 17 Aug 2015 16:55:41 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Dmitry Gutov wrote:

It's a bit more complicated and it would not
address all the uses of curved quotes in diagnostics, but it would
address many of them.

The other uses, which currently don't employ a formatting sequence, can be
changed to use %qs as well. It'll just be less of a mechanical conversion.

Do you mean replacing this sort of thing:

  (message "Press ‘?’ or ‘h’ for help, ‘q’ to quit")

with this?

  (message "Press %qs or %qs for help, %qs to quit" "?" "h" "q")

If so, this doesn't sound like a good idea, as it would make the code harder to read. Also, it wouldn't suffice for code like this:

    (insert (symbol-name type)
            (format " is a type (of kind ‘"))
    (help-insert-xref-button (symbol-name metatype)
                             'cl-help-type metatype)
    (insert (format "’)"))

which formats the matching quotes separately. Of course in general one could rewrite even the latter example to use %qs (if only to grab the quote characters out of the result string and reuse them individually!) but the rewritten version would be significantly harder to read and maintain.

As we need to support formatting individual curved quotes anyway, there is an argument for keeping it simple and omitting the attached patch for paired quotes. With all this in mind, do you still think the complexity of the attached draft patch is a good idea?

Attachment: 0001-New-q-flag-for-format.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]