[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: Tue, 25 Aug 2015 19:51:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Stefan Monnier wrote:

IOW, we don't need format-message at all.  Instead we can just have
a "prettify" function which can be used on the output of `format' (or on
any other string we like) and which uses some heuristic to turn `...'
into its ‘...’ equivalent.

I had already put something along those lines in master (the prettify function's name was ‘internal--text-restyle’), but despite hacking around with it for a while I didn’t find a good independent use for it.

Every use was of the form (format (prettify STRING) ARGS). The prettify function wasn't useful as postpass to ‘format’ because that would have typically mishandled examples like (prettify (format "Invalid `%s'" xxx)) where XXX contains quotes. Nor was it useful as a prepass or postpass to ‘substitute-command-keys’, for similar reasons.

Plus, even with prettify split out, we need a format-message function anyway, if only as a convenience, because it's so often needed in examples like (apply #'format-message fmt args). Since there was a demonstrated need for format-message but not for prettify (and before reading your abovequoted email) I redid the code to export the former and not the latter. The new implementation avoids burdening the GC with two copies of the string, which is a minor performance win.

If there's a use case for the prettify function I'll be happy to resurrect it, of course.

reply via email to

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