From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: package.el strings Date: Sun, 17 Jun 2018 17:50:13 +0300 Message-ID: <83efh5tql6.fsf@gnu.org> References: <83y3rpeubc.fsf@gnu.org> <07C02D08-66BB-4454-AA25-B512BFC39A2A@gmail.com> <83vamk965y.fsf@gnu.org> <84FCCBF3-F20F-48E2-B05E-F6DB218D8896@gmail.com> <87lgdarcwi.fsf@gmail.com> <87in8eqk93.fsf@gmail.com> <87wowroub1.fsf@gmail.com> <83fu1ltrdc.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1529246952 27313 195.159.176.226 (17 Jun 2018 14:49:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Jun 2018 14:49:12 +0000 (UTC) Cc: npostavs@gmail.com, emacs-devel@gnu.org To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 17 16:49:08 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUYzL-0006yU-Ep for ged-emacs-devel@m.gmane.org; Sun, 17 Jun 2018 16:49:07 +0200 Original-Received: from localhost ([::1]:55514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUZ1S-0002W0-F5 for ged-emacs-devel@m.gmane.org; Sun, 17 Jun 2018 10:51:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUZ0W-0002Vv-Jc for emacs-devel@gnu.org; Sun, 17 Jun 2018 10:50:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUZ0T-0008S9-Eb for emacs-devel@gnu.org; Sun, 17 Jun 2018 10:50:20 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUZ0T-0008S3-6d; Sun, 17 Jun 2018 10:50:17 -0400 Original-Received: from [176.228.60.248] (port=2925 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fUZ0S-0001bo-L5; Sun, 17 Jun 2018 10:50:17 -0400 In-reply-to: (message from Jean-Christophe Helary on Sun, 17 Jun 2018 23:45:46 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226407 Archived-At: > From: Jean-Christophe Helary > Date: Sun, 17 Jun 2018 23:45:46 +0900 > Cc: npostavs@gmail.com, > emacs-devel@gnu.org > > (defcustom package-archives `(("gnu" . > - ,(format "http%s://elpa.gnu.org/packages/" > - (if (gnutls-available-p) "s" "")))) > + ,(let ((https "https://elpa.gnu.org/packages/") > + (http "http://elpa.gnu.org/packages/")) > + (if (gnutls-available-p) https http)))) > + > > Why did you need this change? > > That's something we discussed last year: > > On Jul 1, 2017, at 10:56, Jean-Christophe Helary wrote: > > On Jun 22, 2017, at 10:57, Richard Stallman 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. I don't understand this discussion. To make things clear, I don't see why appending "s" to "http" in a format call would be bad in this case, since "https" is not a plural of "http". > - (message "No packages to upgrade.") > + (message "No packages to upgrade") > > I think our style is not to include a period in messages. > > I think I removed a period here. What are you referring to? Oops.