unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jean-Christophe Helary <jean.christophe.helary@gmail.com>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: format use inquiry
Date: Sat, 1 Jul 2017 10:56:49 +0900	[thread overview]
Message-ID: <2FDCF579-44BC-49AD-985F-14AE5C654645@gmail.com> (raw)
In-Reply-To: <E1dNrNO-0002Dq-ES@fencepost.gnu.org>


> On Jun 22, 2017, at 10:57, Richard Stallman <rms@gnu.org> wrote:
> 
>>> (format "http%s://elpa.gnu.org/packages/"
>>>                                        (if (gnutls-available-p) "s" ""))
> 
>> Yes, it is. But obviously I think that, since I wrote it.
> 
> I agree it is acceptable, but this looks like something that might be
> needed in a number of places, so perhaps we should make a nicer
> interface to do it.

There is only one instance of such a query in package.el and no other package in the emacs distribution seems to use gnutls-available-p to add an "s" to http.

Paul suggested that it would be a maintenance hassle to keep 2 almost identical urls if we spelled them out as Yuri suggested but I checked other source packages and for ex auth-source-pass-tests.el explicitly spells out all the urls without resorting to smart formatting to save a few characters.

Also, considering the way %s is abused in other places package.el, for ex in:

 (message "%d package%s marked for upgrading."                                                               
        (length upgrades)                                                                                          
        (if (= (length upgrades) 1) "" "s"))))) 

I don't think it is good to keep the above code because it gives bad incentives to authors especially if work on i18n/l10n proceeds (even though http/https is not related to l10n).

So, I'm going to spell out the urls as I proceed with untangling code and translatable strings in package.el. I'll send a diff here when I'm done for evaluation.

Jean-Christophe 


  reply	other threads:[~2017-07-01  1:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20  8:48 format use inquiry Jean-Christophe Helary
2017-06-20 11:20 ` Thien-Thi Nguyen
2017-06-20 15:02 ` Yuri Khan
2017-06-20 19:51   ` Jean-Christophe Helary
2017-06-20 22:53 ` Glenn Morris
2017-06-21  0:20   ` Jean-Christophe Helary
2017-06-21  1:23     ` Paul Eggert
2017-06-21  3:38       ` Jean-Christophe Helary
2017-06-22  1:57   ` Richard Stallman
2017-07-01  1:56     ` Jean-Christophe Helary [this message]
2017-07-01  2:32       ` Drew Adams
2017-07-01  4:38         ` Jean-Christophe Helary
2017-07-01 15:43           ` Drew Adams
2017-07-02  1:35             ` Jean-Christophe Helary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2FDCF579-44BC-49AD-985F-14AE5C654645@gmail.com \
    --to=jean.christophe.helary@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).