all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Lele Gaifax <lele@metapensiero.it>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Nicer confirmation prompt for package.el
Date: Sat, 18 Mar 2017 14:11:29 +0000	[thread overview]
Message-ID: <CAFyQvY3T9yJ-J_rnYPB=KU11w1wn8Tf=Q1f=Y9xfzM+5i1jX0A@mail.gmail.com> (raw)
In-Reply-To: <87mvcibvdw.fsf@metapensiero.it>

[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]

On Sat, Mar 18, 2017, 8:52 AM Lele Gaifax <lele@metapensiero.it> wrote:

> Hi all,
>
> when a transaction involves different operations, current
> `package-menu--prompt-transaction-p' shows prompts like
>
>   Delete package ‘x’; and Upgrade these 2 packages (y, z)?
>
> or
>
>   Delete package ‘x’; Install package ‘y’; 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 ‘x’ and upgrade these 2 packages (y, z)?
>
> or
>
>   Delete package ‘x’, install package ‘y’ 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 ‘x’, and upgrade these 2 packages (y, z)?

    Delete package ‘x’, install package ‘y’, 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

-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 3878 bytes --]

  reply	other threads:[~2017-03-18 14:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-18 12:51 Nicer confirmation prompt for package.el Lele Gaifax
2017-03-18 14:11 ` Kaushal Modi [this message]
2017-03-23  8:15   ` Richard Copley

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

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

  git send-email \
    --in-reply-to='CAFyQvY3T9yJ-J_rnYPB=KU11w1wn8Tf=Q1f=Y9xfzM+5i1jX0A@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=lele@metapensiero.it \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.