emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: please use ?\u2014 instead of the unicode character inbuff-menu.el


From: Juanma Barranquero
Subject: Re: please use ?\u2014 instead of the unicode character inbuff-menu.el
Date: Tue, 20 Feb 2007 02:07:23 +0100

On 2/19/07, Drew Adams <address@hidden> wrote:

Please explain why 1) is more readable than 2):

1) ;; Use U+2014 (EM DASH) to underline if possible, else U+002D
(HYPHEN-MINUS)
   (if (char-displayable-p ?-) ?- ?-)))

2) (if (char-displayable-p ?\u2014) ?\u2014 ?-)))

In 1), the code is straightforward (a fact obscured in the e-mail
because em dash got changed to hyphen-minus), and the comment clearly
says what's happening, and even identifies *both* characters involved.

In 2), \u2014 does not mean anything per se, so the user hasn't the
foggiest idea why some random unicode char would be used instead of -.
You'll need the same comment as before to clarify that (and, in fact,
Stefan didn't remove the comment when changing the code).

You can convince me that 2) will get less trouble than 1) for people
with broken tools; but not that 2) is more legible.

            Juanma




reply via email to

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