emacs-devel
[Top][All Lists]
Advanced

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

RE: default for read-face-name


From: Drew Adams
Subject: RE: default for read-face-name
Date: Tue, 29 Jun 2010 13:17:28 -0700

> I found another place that uses `read-face-name':
> `describe-face' calls
>   (read-face-name "Describe face" "= `default' face" t)
> so later it should compare `face' with `"= `default' face"' like
>     (unless (and face (not (equal face "= `default' face")))
>       (setq face 'default))
> 
> If this is ugly, we could call `read-face-name' with the real 
> face name (i.e. `default'), not with a string describing default:
>   (read-face-name "Describe face" 'default t)
> But in this case, the prompt is less descriptive:
>   Describe face (default default):
> Compare it with the current prompt:
>   Describe face (default = `default' face):

Either is OK by me.  Whether the code is a bit ugly is less important here than
serving the user.  (That ugliness does not represent fragility or imply a
maintenance headache.)

FWIW, anytime the default value is put into the prompt it should probably be
quoted: `...'.  At the very least, that increases clarity in cases like this and
when the value is a string with spaces (or a trailing colon or...).

In this case that would give "Describe face (default `default'):" which seems
clear in the context of choosing a face name.  That fix is probably a more
general than just for `read-face-name', however.




reply via email to

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