From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: package.el strings Date: Sun, 17 Jun 2018 23:45:46 +0900 Message-ID: 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_768D3BE2-5D0A-4BB0-911D-AC15F6DC9657" X-Trace: blaine.gmane.org 1529246968 28736 195.159.176.226 (17 Jun 2018 14:49:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Jun 2018 14:49:28 +0000 (UTC) Cc: npostavs@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 17 16:49:24 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 1fUYzb-0007Mo-KX for ged-emacs-devel@m.gmane.org; Sun, 17 Jun 2018 16:49:24 +0200 Original-Received: from localhost ([::1]:55515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUZ1i-0002az-QP for ged-emacs-devel@m.gmane.org; Sun, 17 Jun 2018 10:51:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUYwG-00027g-QW for emacs-devel@gnu.org; Sun, 17 Jun 2018 10:45:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUYwF-0006Xb-BP for emacs-devel@gnu.org; Sun, 17 Jun 2018 10:45:56 -0400 Original-Received: from mail-pl0-x22f.google.com ([2607:f8b0:400e:c01::22f]:45912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUYwB-0006UY-Be; Sun, 17 Jun 2018 10:45:51 -0400 Original-Received: by mail-pl0-x22f.google.com with SMTP id c23-v6so7663537plz.12; Sun, 17 Jun 2018 07:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=U+jUrhGQaTZPmI17QgXLQUXeqrIk/3/y55So3z9K0IM=; b=JwPM/0+fE9ll6cXKG+vqdhxvQhNhFP/bfKueUJDhutzAbJRgqlloFvSsg6wCi3XynU u0UGOYvMveddHCjokFnDm1YSzc4v/PV1UacZ0oLX4p3QxUKsaTb9GU3bIacftNI2s6/3 B8Qs1nm79cM76Bg4MaiVHKWyLj8fx97aZMzl6CQ803pR/ciI+ZmboJ+CJDL8JrBqJLWB lUleU8UmVNmuSZKOmwQQyliAQzZ2yvZvkGG+Y0n/pk2/2UlxXj0z9RlgCZJEGtk+AVNZ UGf+QAgZJ62e8XPCWxL8jSgnJOnGwKi4zFycQ/gYj7+FIequlrOmhArWGZKXpsuGgwgn /jXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=U+jUrhGQaTZPmI17QgXLQUXeqrIk/3/y55So3z9K0IM=; b=YNUUXEHVEHYKnRr85IGZsPD0bh+IxEpB1jws0hljjEgKF/9noHoT46SF9IGaZ4JlI+ mp/4X78M8epWj3jlpGhb0vDMsLlfRFhzHJemXWiZmUXj+dzoem+1EY5wQ4T9vWZZXqR+ QrkWwH+z12mXlhrMlbjJFkqC/fm6poKbbHmJtrtXL5PiWejYHydIA/K9skfzuTs9EUCF z+AI8e2Wc0EhaOqtVu87hGVx/NpAUJGip7q/LGQQoyzy4FwEFhziKVgJ3/rCIu8usv1v q/Xvyd5OXYlvrN47Cz07rK3YBT3RlZ8BkSM5gK3qYs0rtv+1yiI7eHbVM89tKaUAAokj dA2A== X-Gm-Message-State: APt69E0GYFQCuLjfFWG5XcFXp5SIwMraFfl877DGBfwOKhHv9pDwUsWu efP9Vxw1mpotrzsTodPv6ZarUQ== X-Google-Smtp-Source: ADUXVKIXy86lBRor6NLjSyJpwPdNZeDieN/nZijze6pZ0nzxZd4tPtbVqWLN6B+4rIxf3Hc+/jCYig== X-Received: by 2002:a17:902:8497:: with SMTP id c23-v6mr10556851plo.124.1529246750185; Sun, 17 Jun 2018 07:45:50 -0700 (PDT) Original-Received: from [192.168.1.7] (pl31219.ag0304.nttpc.ne.jp. [111.89.224.243]) by smtp.gmail.com with ESMTPSA id c19-v6sm18656792pfn.182.2018.06.17.07.45.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 07:45:49 -0700 (PDT) In-Reply-To: <83fu1ltrdc.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.8.2) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22f X-Mailman-Approved-At: Sun, 17 Jun 2018 10:50:30 -0400 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:226408 Archived-At: --Apple-Mail=_768D3BE2-5D0A-4BB0-911D-AC15F6DC9657 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Eli, Thank you for the quick check. > On Jun 17, 2018, at 23:33, Eli Zaretskii wrote: >=20 >> From: Jean-Christophe Helary >> Date: Sun, 17 Jun 2018 23:02:08 +0900 >> Cc: Emacs developers >>=20 >> There is indeed another change I want to make but that can wait. It = involves removing some of the text decorations to be able to straighten = some strings. >>=20 >> If there is an agreement to proceed I can do that later. In the = meanwhile it would be nice if you could first commit the biggest part of = the modifications. >=20 > Thanks, but there are a couple of hunks I don't understand: >=20 >> (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)))) >> + >=20 > Why did you need this change? That's something we discussed last year: > On Jul 1, 2017, at 10:56, Jean-Christophe Helary = wrote: >=20 >=20 >> On Jun 22, 2017, at 10:57, Richard Stallman wrote: >>=20 >>>> (format "http%s://elpa.gnu.org/packages/" >>>> (if (gnutls-available-p) "s" = "")) >>=20 >>> Yes, it is. But obviously I think that, since I wrote it. >>=20 >> 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. >=20 > 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. >=20 > 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. >=20 > Also, considering the way %s is abused in other places package.el, for = ex in: >=20 > (message "%d package%s marked for upgrading." = =20 > (length upgrades) = =20 > (if (=3D (length upgrades) 1) "" "s")))))=20 >=20 > 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). >=20 > 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. >=20 > Jean-Christophe=20 >> - (dir (expand-file-name (format "archives/%s" name) = package-user-dir)) >> + (dir (expand-file-name (concat "archives/" name) = package-user-dir)) >=20 > Same question here. I don't remember. I wrote this part last year. I guess I was trying to = separate format and concat use: format for user visible strings and = concat for internal strings. But you can also read that as a reaction to = the format abuse in package.el... concat makes the string shorter = without compromise. >> - (message "No packages to upgrade.") >> + (message "No packages to upgrade") >=20 > I think our style is not to include a period in messages. I think I removed a period here. What are you referring to? Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune --Apple-Mail=_768D3BE2-5D0A-4BB0-911D-AC15F6DC9657 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Eli,

Thank = you for the quick check.

On Jun 17, 2018, at 23:33, Eli = Zaretskii <eliz@gnu.org> wrote:

From: Jean-Christophe = Helary <jean.christophe.helary@gmail.com>
Date: = Sun, 17 Jun 2018 23:02:08 +0900
Cc: Emacs developers = <emacs-devel@gnu.org>

There = is indeed another change I want to make but that can wait. It involves = removing some of the text decorations to be able to straighten some = strings.

If there is an agreement to = proceed I can do that later. In the meanwhile it would be nice if you = could first commit the biggest part of the modifications.

Thanks, but there are a couple of = hunks I don't understand:

(defcustom package-archives `(("gnu" .
- =             &n= bsp;           &nbs= p;     ,(format "http%s://elpa.gnu.org/packages/"
- =             &n= bsp;           &nbs= p;            =   (if (gnutls-available-p) "s" ""))))
+ =             &n= bsp;           &nbs= p;     ,(let ((https "https://elpa.gnu.org/packages/")
+ =             &n= bsp;           &nbs= p;            = (http   "http://elpa.gnu.org/packages/"))
+ =             &n= bsp;           &nbs= p;        (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 <jean.christophe.helary@gmail.com> wrote:


On Jun 22, 2017, at = 10:57, Richard Stallman <rms@gnu.org> wrote:

(format "http%s://elpa.gnu.org/packages/"
          &nb= sp;            = ;            &= nbsp;  (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." =             &n= bsp;           &nbs= p;            =             &n= bsp;           &nbs= p;
       (length = upgrades) =             &n= bsp;           &nbs= p;            =             &n= bsp;           &nbs= p;            =             &n= bsp;  
       (if (=3D (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 


- =           (dir = (expand-file-name (format "archives/%s" name) package-user-dir))
+ =           (dir = (expand-file-name (concat "archives/" name) package-user-dir))

Same question here.

I = don't remember. I wrote this part last year. I guess I was trying to = separate format and concat use: format for user visible strings and = concat for internal strings. But you can also read that as a reaction to = the format abuse in package.el... concat makes the string shorter = without compromise.

-        (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?


Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune


= --Apple-Mail=_768D3BE2-5D0A-4BB0-911D-AC15F6DC9657--