From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: Nicer confirmation prompt for package.el Date: Sat, 18 Mar 2017 14:11:29 +0000 Message-ID: References: <87mvcibvdw.fsf@metapensiero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0bd9f8957d0a054b01df46 X-Trace: blaine.gmane.org 1489846317 18045 195.159.176.226 (18 Mar 2017 14:11:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Mar 2017 14:11:57 +0000 (UTC) To: Lele Gaifax , Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 18 15:11:52 2017 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 1cpF58-0003mh-2j for ged-emacs-devel@m.gmane.org; Sat, 18 Mar 2017 15:11:46 +0100 Original-Received: from localhost ([::1]:53513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpF5E-0000JT-4P for ged-emacs-devel@m.gmane.org; Sat, 18 Mar 2017 10:11:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpF56-0000Ht-Cx for emacs-devel@gnu.org; Sat, 18 Mar 2017 10:11:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpF55-0002vo-52 for emacs-devel@gnu.org; Sat, 18 Mar 2017 10:11:44 -0400 Original-Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]:35193) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cpF54-0002vb-TM for emacs-devel@gnu.org; Sat, 18 Mar 2017 10:11:43 -0400 Original-Received: by mail-pf0-x233.google.com with SMTP id 20so1228580pfk.2 for ; Sat, 18 Mar 2017 07:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=YAHWQnZdFZI2olkMo1PrPlqeCP5Sjmz9bsYrNJeHkD4=; b=RGN2j9r5PIK/kdc/WbCaZEdpsj0HrlfujDGXF432Nqb/Vt1GI8JmPITrbkZNoeoFb1 lYlSK5jqt729mNGp/in8KNptfxHruY7AAJrgBSK92Gme7G/y0yGOfiwluoGb/YCcSPiT oD/rYzOrlEENAGmRNrMI9VNg5dWIO2m6h7uWeACpz2JM+MUpd4LFJ20sgMKY7n8RRvpL BG//K8xrlt4Uln7jeljsW5xJ9G92MZ/MxQRht3fGCw0LjtdLqydape3MUN9Nft++QC/y vy/bmeicUsX+lO2Nnp1uMykeu8crKkyUn3NH33BSmgy1TxW49xPAk3lJezWrerYx42gQ 7dYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=YAHWQnZdFZI2olkMo1PrPlqeCP5Sjmz9bsYrNJeHkD4=; b=uVwHVGmpjpKl46Pyp0VFT6mpJp99tgBeKizJ9puXwTECXI1VFkNo5D1o1Z2nZtOUaD AUmySXlJpPEJ6+siStI97ZBTsR6+RtH2fVtBB6TOLwTKhFBL8LQXP15PgZeKbJEAWKA6 xQ/YZB+2FRnrKDFrPLWDM3hF1f0pZ75p4OTioW/3+ENSoq7cWngZoJfdZ613O26zbg1q CPTS7AMx3iBxAXyNRlo4aDDsJ2GelZSu8Kn6I6pua3xWCljELavWSdO61PeVF8oiSoub r5gX/3Nm2YavDw2iRKqmYbgEnS5rIC3kiF22eYE6+qHkTOzqfvGmKfrN24eJaU3GoVnT VBCA== X-Gm-Message-State: AFeK/H0DSP4LmuRaudHnvImZRlIDMqAnyBzwA8mPU0r2bEc3TySmdWNgC1f5rZGge/63ZXsyPR7sgVoGv9ACaA== X-Received: by 10.98.69.141 with SMTP id n13mr22640325pfi.216.1489846301718; Sat, 18 Mar 2017 07:11:41 -0700 (PDT) In-Reply-To: <87mvcibvdw.fsf@metapensiero.it> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::233 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:213119 Archived-At: --94eb2c0bd9f8957d0a054b01df46 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Mar 18, 2017, 8:52 AM Lele Gaifax wrote: > Hi all, > > when a transaction involves different operations, current > `package-menu--prompt-transaction-p' shows prompts like > > Delete package =E2=80=98x=E2=80=99; and Upgrade these 2 packages (y, z)= ? > > or > > Delete package =E2=80=98x=E2=80=99; Install package =E2=80=98y=E2=80=99= ; and Upgrade these 2 packages > (w, z)? > > that IMHO are a bit inelegant. > I actually like the current message, as the actions Delete, Install and Upgrade are capitalized. The user's attention is drawn to the fact that those 3 different actions are going to happen. The semi-colons are used so that those actions can be capitalized, I think. I hacked it to the following definition > > (defun package-menu--prompt-transaction-p (delete install upgrade) > "Prompt the user about DELETE, INSTALL, and UPGRADE. > DELETE, INSTALL, and UPGRADE are lists of `package-desc' objects. > Either may be nil, but not all." > (y-or-n-p > (concat > (when delete "Delete ") > (package-menu--list-to-prompt delete) > (if (and delete install) > (if upgrade ", install " " and install ") > (when install "Install ")) > (package-menu--list-to-prompt install) > (if (and upgrade (or install delete)) > " and upgrade " > (when upgrade "Upgrade ")) > (package-menu--list-to-prompt upgrade) > "? "))) > > that shows instead > > Delete package =E2=80=98x=E2=80=99 and upgrade these 2 packages (y, z)? > > or > > Delete package =E2=80=98x=E2=80=99, install package =E2=80=98y=E2=80=99= and upgrade these 2 packages (w, > z)? > > What do you think? This is another option where the actions are not capitalized, and so you can replace the semi-colons with commas. But I really miss the Oxford Commas here; below I have added those before the "and": Delete package =E2=80=98x=E2=80=99, and upgrade these 2 packages (y, z)= ? Delete package =E2=80=98x=E2=80=99, install package =E2=80=98y=E2=80=99= , and upgrade these 2 packages (w, z)? So my order of preference: 1. Current (no change) - Focus on the actions that are going to happen by capitalizing them. 2. Use of Oxford commas --=20 Kaushal Modi --94eb2c0bd9f8957d0a054b01df46 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sat, Mar 18, 2017, 8= :52 AM Lele Gaifax <lele@metapen= siero.it> wrote:
Hi all,

when a transaction involves different operations, current
`package-menu--prompt-transaction-p' shows prompts like

=C2=A0 Delete package =E2=80=98x=E2=80=99; and Upgrade these 2 packages (y,= z)?

or

=C2=A0 Delete package =E2=80=98x=E2=80=99; Install package =E2=80=98y=E2=80= =99; and Upgrade these 2 packages (w, z)?

that IMHO are a bit inelegant.

I actually like the current message, as the actions Delet= e, Install and Upgrade are capitalized. The user's attention is drawn t= o the fact that those 3 different actions are going to happen.=C2=A0 The se= mi-colons are used so that those actions can be capitalized, I think.=C2=A0=

I hacked it to the following definition

=C2=A0 (defun package-menu--prompt-transaction-p (delete install upgrade) =C2=A0 =C2=A0 "Prompt the user about DELETE, INSTALL, and UPGRADE.
=C2=A0 DELETE, INSTALL, and UPGRADE are lists of `package-desc' objects= .
=C2=A0 Either may be nil, but not all."
=C2=A0 =C2=A0 (y-or-n-p
=C2=A0 =C2=A0 =C2=A0(concat
=C2=A0 =C2=A0 =C2=A0 (when delete "Delete ")
=C2=A0 =C2=A0 =C2=A0 (package-menu--list-to-prompt delete)
=C2=A0 =C2=A0 =C2=A0 (if (and delete install)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if upgrade ", install " "= ; and install ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when install "Install "))
=C2=A0 =C2=A0 =C2=A0 (package-menu--list-to-prompt install)
=C2=A0 =C2=A0 =C2=A0 (if (and upgrade (or install delete))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " and upgrade "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when upgrade "Upgrade "))
=C2=A0 =C2=A0 =C2=A0 (package-menu--list-to-prompt upgrade)
=C2=A0 =C2=A0 =C2=A0 "? ")))

that shows instead

=C2=A0 Delete package =E2=80=98x=E2=80=99 and upgrade these 2 packages (y, = z)?

or

=C2=A0 Delete package =E2=80=98x=E2=80=99, install package =E2=80=98y=E2=80= =99 and upgrade these 2 packages (w, z)?

What do you think?

This is another op= tion where the actions are not capitalized, and so you can replace the semi= -colons with commas. But=C2=A0I really miss = the Oxford Commas here; below I have added those before the "and"= :

=C2=A0 =C2=A0 Delete package =E2=80=98x= =E2=80=99, and upgrade these 2 packages (y, z)?

= =C2=A0 =C2=A0 Delete package =E2=80=98x=E2=80=99, install package =E2=80=98= y=E2=80=99, and upgrade these 2 packages (w, z)?

<= br>
So my order of preference:

1. Curren= t (no change) - Focus on the actions that are going to happen by capitalizi= ng them.=C2=A0
2.=C2=A0 Use of Oxford commas

=
--

Kaushal Modi

--94eb2c0bd9f8957d0a054b01df46--