all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#41436: 26.1; How to list upgradable packages only
@ 2020-05-21 14:00 Eduardo Mercovich
  2020-08-23 16:16 ` Marcin Włodarczak
  2020-08-23 16:43 ` Stefan Kangas
  0 siblings, 2 replies; 8+ messages in thread
From: Eduardo Mercovich @ 2020-05-21 14:00 UTC (permalink / raw)
  To: 41436

Dear Emacs Devs.

Along with my thanks, I'd like to report a feature request, as per the
discussion in the Emacs Reddit group
(https://www.reddit.com/r/emacs/comments/gnci5o/how_to_list_upgradable_packages_only/)
and the suggestion from https://www.reddit.com/user/cpitclaudel/

Here is the case: 

--8<---------------cut here---------------start------------->8---

Upon refreshing the repos, the emacs package manager (PM) tells us
if/how many packages we have to upgrade. With U we can mark them all,
and with X let the PM do it's job (uninstall old versions, install the
new ones). Up to here, everything is great. 

However, being a rookie, I' afraid of upgrading 28 packages at once
since some things may break, so I prefer to upgrade them in small groups
in a more controlled way. 

But, for my life, even after quite some searching and reading I can't
find how to filter the list by that status (the command
package-menu-filter does something different or I don't understand how
to use it for this), so I can see only the packages that can be
upgraded. With that list in front of me, I can pick which ones to
upgrade, slowly and in a more controlled path. 

I'm sure something like that exists, but obviously I'm not finding the
right keywords.

--8<---------------cut here---------------end--------------->8---

Again, thanks a lot for sharing your work with all of us. :)

What follows is part of my local install, although it's probably useless
in this case.

In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2019-09-23, modified by Debian built on x86-grnet-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description:	Debian GNU/Linux 10 (buster)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-StqULU/emacs-26.1+1=.
 -fstack-protector-strong -Wformat -Werror=format-security -Wall'
 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2
Important settings:
  value of $LANG: es_AR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  auto-image-file-mode: t
  flyspell-mode: t
  org-indent-mode: t
  org-roam-mode: t
  display-time-mode: t
  desktop-save-mode: t
  pdf-occur-global-minor-mode: t
  wrap-region-mode: t
  async-bytecomp-package-mode: t
  helm-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  electric-pair-mode: t
  delete-selection-mode: t
  savehist-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  org-bullets-mode: t
  beacon-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Memory information:
((conses 16 2194798 1708575)
 (symbols 48 68434 188)
 (miscs 40 1962 3428)
 (strings 32 296075 153673)
 (string-bytes 1 9977187)
 (vectors 16 84246)
 (vector-slots 8 2071025 227004)
 (floats 8 1245 490)
 (intervals 56 271031 239055)
 (buffers 992 38))

-- 
eduardo mercovich

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación. 
 (Anónimo)





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-05-21 14:00 bug#41436: 26.1; How to list upgradable packages only Eduardo Mercovich
@ 2020-08-23 16:16 ` Marcin Włodarczak
  2020-08-23 16:43 ` Stefan Kangas
  1 sibling, 0 replies; 8+ messages in thread
From: Marcin Włodarczak @ 2020-08-23 16:16 UTC (permalink / raw)
  To: Eduardo Mercovich; +Cc: 41436


Eduardo Mercovich <eduardo@mercovich.net> writes:

>
> Upon refreshing the repos, the emacs package manager (PM) tells us
> if/how many packages we have to upgrade. With U we can mark them all,
> and with X let the PM do it's job (uninstall old versions, install the
> new ones). Up to here, everything is great.
>
> However, being a rookie, I' afraid of upgrading 28 packages at once
> since some things may break, so I prefer to upgrade them in small groups
> in a more controlled way. 
>
> But, for my life, even after quite some searching and reading I can't
> find how to filter the list by that status (the command
> package-menu-filter does something different or I don't understand how
> to use it for this), so I can see only the packages that can be
> upgraded. With that list in front of me, I can pick which ones to
> upgrade, slowly and in a more controlled path.

I too think such a feature would be useful. The following would get us
part of the way but it has two problems:

1. It lists both the installed packages and the upgrade candidates.
2. As far as I can see, there is no mechanism for marking individual
packages for upgrading.

As a matter of fact, I think an even more general filtering mechanism
would be useful, which would allow us to show, say, all installed
packages or all dependencies, etc. but it does indeed seem that at the
moment only keyword filtering is supported. I could try to add it if
people think this makes sense.

(defun package-menu-show-upgradable ()
  (interactive)
  (let ((upgrades (mapcar 'car (package-menu--find-upgrades))))
    (package-show-package-list upgrades)))





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-05-21 14:00 bug#41436: 26.1; How to list upgradable packages only Eduardo Mercovich
  2020-08-23 16:16 ` Marcin Włodarczak
@ 2020-08-23 16:43 ` Stefan Kangas
  2020-08-23 16:58   ` Marcin Włodarczak
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2020-08-23 16:43 UTC (permalink / raw)
  To: Eduardo Mercovich, 41436

Eduardo Mercovich <eduardo@mercovich.net> writes:

> But, for my life, even after quite some searching and reading I can't
> find how to filter the list by that status (the command
> package-menu-filter does something different or I don't understand how
> to use it for this), so I can see only the packages that can be
> upgraded.

This feature is already in master and will be part of Emacs 28.1.
Unfortunately, the patch wasn't merged in time for Emacs 27.

commit aea12d4903136c057bb14d3fd7683bf7a4e1eff6
Author: Stefan Kangas <stefankangas@gmail.com>
Date:   Wed Feb 5 13:12:01 2020 +0100

    Add new filter commands to Package Menu (Bug#38424)

    * lisp/emacs-lisp/package.el (package-menu-filter-by-version)
    (package-menu-filter-by-status, package-menu-filter-by-archive):
    New filter commands.

Please try it out and see if it works for you.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-08-23 16:43 ` Stefan Kangas
@ 2020-08-23 16:58   ` Marcin Włodarczak
  2020-08-23 17:55     ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Marcin Włodarczak @ 2020-08-23 16:58 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eduardo Mercovich, 41436

Stefan Kangas <stefankangas@gmail.com> writes:

> Eduardo Mercovich <eduardo@mercovich.net> writes:
>
>> But, for my life, even after quite some searching and reading I can't
>> find how to filter the list by that status (the command
>> package-menu-filter does something different or I don't understand how
>> to use it for this), so I can see only the packages that can be
>> upgraded.
>
> This feature is already in master and will be part of Emacs 28.1.
> Unfortunately, the patch wasn't merged in time for Emacs 27.

Oh, great. This is precisely what I had in mind but to come back to the
problem at hand the way to show upgradable packages would be to first
mark them (package-menu-mark-upgrades) and then filter marked?

I wonder whether it would not be nice to be able to list all upgradable
packages and then give the user an option of marking them one by one.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-08-23 16:58   ` Marcin Włodarczak
@ 2020-08-23 17:55     ` Stefan Kangas
  2020-08-23 21:01       ` Eduardo Mercovich
  2020-09-08 12:53       ` Stefan Kangas
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-23 17:55 UTC (permalink / raw)
  To: Marcin Włodarczak; +Cc: Eduardo Mercovich, 41436

Marcin Włodarczak <marcin@wlodarczak.org> writes:

> Oh, great. This is precisely what I had in mind but to come back to the
> problem at hand the way to show upgradable packages would be to first
> mark them (package-menu-mark-upgrades) and then filter marked?

Yes.

> I wonder whether it would not be nice to be able to list all upgradable
> packages and then give the user an option of marking them one by one.

I think it sounds useful.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-08-23 17:55     ` Stefan Kangas
@ 2020-08-23 21:01       ` Eduardo Mercovich
  2020-09-08 12:53       ` Stefan Kangas
  1 sibling, 0 replies; 8+ messages in thread
From: Eduardo Mercovich @ 2020-08-23 21:01 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Marcin Włodarczak, 41436

Hello. :)

[...]

>> I wonder whether it would not be nice to be able to list all upgradable
>> packages and then give the user an option of marking them one by one.

> I think it sounds useful.

Me too.
Does it helps to make a brief activity diagram to show the task flux?

Here, simplified, in text and linealized:

1. See the list.
2. There is a notice about new packages.
  a. Wanna see them?
    1. If no, let's keep in the list.
    2. If yes, go to new list (only upgradable)

In the ugradable list:
1. mark some or none.
2. upgrade or...
3. ... go to the full list.

Thanks for your effort... :)

-- 
eduardo mercovich

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación. 
 (Anónimo)





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-08-23 17:55     ` Stefan Kangas
  2020-08-23 21:01       ` Eduardo Mercovich
@ 2020-09-08 12:53       ` Stefan Kangas
  2020-10-19 18:42         ` Stefan Kangas
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2020-09-08 12:53 UTC (permalink / raw)
  To: Marcin Włodarczak; +Cc: Eduardo Mercovich, 41436

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

tags 41436 + patch
thanks

Stefan Kangas <stefankangas@gmail.com> writes:

>> I wonder whether it would not be nice to be able to list all upgradable
>> packages and then give the user an option of marking them one by one.
>
> I think it sounds useful.

Could you please try the attached patch and see if it works for you?
It should be applied to the master branch.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Add-command-package-menu-filter-upgradable.patch --]
[-- Type: text/x-diff, Size: 2718 bytes --]

From 89d0a1d7f1b6f3e243edfd2df7ac720540535f66 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Tue, 8 Sep 2020 14:50:29 +0200
Subject: [PATCH] Add command package-menu-filter-upgradable

* lisp/emacs-lisp/package.el (package-menu-filter-upgradable):
New command.  (Bug#41436)
(package-menu-mode-map): Bind the new command.
* doc/emacs/package.texi (Package Menu): Document the new command.
---
 doc/emacs/package.texi     |  6 ++++++
 etc/NEWS                   |  1 +
 lisp/emacs-lisp/package.el | 10 ++++++++++
 3 files changed, 17 insertions(+)

diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index 453d9eb401..56e8ee1363 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -222,6 +222,12 @@ Package Menu
 Filter package list by non-empty mark (@code{package-menu-filter-marked}).
 This shows only the packages that have been marked to be installed or deleted.
 
+@item / u
+@kindex / u @r{(Package Menu)}
+@findex package-menu-filter-upgradable
+Filter package list to show only packages for which there are
+available upgrades (@code{package-menu-filter-upgradable}).
+
 @item / /
 @kindex / / @r{(Package Menu)}
 @findex package-menu-filter-clear
diff --git a/etc/NEWS b/etc/NEWS
index aa3acc26b3..de57e559ba 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -554,6 +554,7 @@ key             binding
 / s             package-menu-filter-by-status
 / v             package-menu-filter-by-version
 / m             package-menu-filter-marked
+/ u             package-menu-filter-upgradable
 / /             package-menu-filter-clear
 
 ---
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index a173fc060a..803bae2ece 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2710,6 +2710,7 @@ package-menu-mode-map
     (define-key map (kbd "/ s") 'package-menu-filter-by-status)
     (define-key map (kbd "/ v") 'package-menu-filter-by-version)
     (define-key map (kbd "/ m") 'package-menu-filter-marked)
+    (define-key map (kbd "/ u") 'package-menu-filter-upgradable)
     map)
   "Local keymap for `package-menu-mode' buffers.")
 
@@ -3906,6 +3907,15 @@ package-menu-filter-marked
 	      (tabulated-list-put-tag (char-to-string mark) t)))
 	(user-error "No packages found")))))
 
+(defun package-menu-filter-upgradable ()
+  "Filter \"*Packages*\" buffer to show only upgradable packages."
+  (interactive)
+  (let ((pkgs (mapcar #'car (package-menu--find-upgrades))))
+    (package-menu--filter-by
+     (lambda (pkg)
+       (memql (package-desc-name pkg) pkgs))
+     "upgradable")))
+
 (defun package-menu-clear-filter ()
   "Clear any filter currently applied to the \"*Packages*\" buffer."
   (interactive)
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#41436: 26.1; How to list upgradable packages only
  2020-09-08 12:53       ` Stefan Kangas
@ 2020-10-19 18:42         ` Stefan Kangas
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-10-19 18:42 UTC (permalink / raw)
  To: Marcin Włodarczak; +Cc: Eduardo Mercovich, 41436

close 41436 28.1
thanks

Stefan Kangas <stefan@marxist.se> writes:

> Could you please try the attached patch and see if it works for you?
> It should be applied to the master branch.

No comments within 5 weeks, so I've now pushed this to master as commit
8c96c720fa.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-19 18:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-21 14:00 bug#41436: 26.1; How to list upgradable packages only Eduardo Mercovich
2020-08-23 16:16 ` Marcin Włodarczak
2020-08-23 16:43 ` Stefan Kangas
2020-08-23 16:58   ` Marcin Włodarczak
2020-08-23 17:55     ` Stefan Kangas
2020-08-23 21:01       ` Eduardo Mercovich
2020-09-08 12:53       ` Stefan Kangas
2020-10-19 18:42         ` Stefan Kangas

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.