emacs-devel
[Top][All Lists]
Advanced

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

Re: format use inquiry


From: Jean-Christophe Helary
Subject: Re: format use inquiry
Date: Wed, 21 Jun 2017 04:51:57 +0900

Thank you Yuri. I'm actually back to working on packages.el where there are 
some problematic string concatenations and I thought what you just proposed was 
a more acceptable way to handle such strings. Thank you for the confirmation.

Jean-Christophe 

> On Jun 21, 2017, at 0:02, Yuri Khan <address@hidden> wrote:
> 
> On Tue, Jun 20, 2017 at 3:48 PM, Jean-Christophe Helary
> <address@hidden> wrote:
>> I'd like to know if that kind of code is acceptable or not:
>> 
>> (format "http%s://elpa.gnu.org/packages/"
>>                                        (if (gnutls-available-p) "s" ""))
> 
> The standard localization argument against concatenating an "s" onto a
> word does not apply here. But, one day, someone is going to grep for
> occurrences of http:// to see if it’s still used anywhere.
> 
> That someone could be you.
> 
> Spell it out.
> 
>    (defvar …-elpa-root
>      (if (gnutls-available-p)
>          "https://elpa.gnu.org/packages/";
>        "http://elpa.gnu.org/packages/";)
>      "…some doc…. http and https schemes are supported;
>    https is conditional on GnuTLS.")




reply via email to

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