GNU bug report logs - #43983
[PATCH] Improve package install/delete button action

Previous Next

Package: emacs;

Reported by: tsuucat <tsuucat <at> icloud.com>

Date: Tue, 13 Oct 2020 19:47:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: tsuucat <tsuucat <at> icloud.com>
To: 43983 <at> debbugs.gnu.org
Subject: bug#43983: [PATCH] Improve package install/delete button action
Date: Wed, 14 Oct 2020 04:46:42 +0900
[Message part 1 (text/plain, inline)]
Hi, current package-install-button-action and package-delete-button-action have
some problems so I made a patch.

If user clicks [Install] button, the *Help* buffer is reverted and shows the package is
"available obsolete" in first line.
(steps)
1. emacs -Q
2. M-x list-packages
3. M-x package-refresh-contents
3. Click “ztree” package
4. Click [Install]
(steps end)
I think this is not good for user experience. The buffer shoud shows the package is
“installed” in first line.

And then if user clicks [Delete] button an error happens.
(steps)
1. (Install ztree like above)
2. Type q
3. Click “ztree” package which is marked as installed
4. Click [Delete]
(steps end)
(backstace)
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\`https?:" nil nil)
  package--with-response-buffer-1(nil #f(compiled-function () #<bytecode 0x1fe0b74a2895>) :file "ztree-readme.txt" :async nil :error-function #f(compiled-function () #<bytecode 0x1fe0b589df81>) :noerror t)
  describe-package-1(#s(package-desc :name ztree :version (20191108 2234) :summary "Text mode directory tree" :reqs ((cl-lib (0))) :kind nil :archive nil :dir "/(path/to)/test-home/.emacs...." :extras ((:url . "https://github.com/fourier/ztree") (:maintainer "Alexey Veretennikov" . "alexey.veretennikov <at> gmail.com") (:authors ("Alexey Veretennikov" . "alexey.veretennikov <at> gmail.com")) (:keywords "files" "tools") (:commit . "0a5b25f364490a58ef7371534a39c75d11f54132")) :signed nil))
  describe-package(#s(package-desc :name ztree :version (20191108 2234) :summary "Text mode directory tree" :reqs ((cl-lib (0))) :kind nil :archive nil :dir "/(path/to)/test-home/.emacs...." :extras ((:url . "https://github.com/fourier/ztree") (:maintainer "Alexey Veretennikov" . "alexey.veretennikov <at> gmail.com") (:authors ("Alexey Veretennikov" . "alexey.veretennikov <at> gmail.com")) (:keywords "files" "tools") (:commit . "0a5b25f364490a58ef7371534a39c75d11f54132")) :signed nil))
  apply(describe-package #s(package-desc :name ztree :version (20191108 2234) :summary "Text mode directory tree" :reqs ((cl-lib (0))) :kind nil :archive nil :dir "/(path/to)/test-home/.emacs...." :extras ((:url . "https://github.com/fourier/ztree") (:maintainer "Alexey Veretennikov" . "alexey.veretennikov <at> gmail.com") (:authors ("Alexey Veretennikov" . "alexey.veretennikov <at> gmail.com")) (:keywords "files" "tools") (:commit . "0a5b25f364490a58ef7371534a39c75d11f54132")) :signed nil))
  help-mode-revert-buffer(nil t)
  revert-buffer(nil t)
  package-delete-button-action(#<marker (moves after insertion) at 483 in *Help*>)
  button-activate(#<marker (moves after insertion) at 483 in *Help*> t)
  push-button(94 t)
  push-button((mouse-2 (#<window 99 on *Help*> 94 (452 . 42) 1086759856 nil 94 (64 . 2) nil (2 . 10) (7 . 20))))
a  funcall-interactively(push-button (mouse-2 (#<window 99 on *Help*> 94 (452 . 42) 1086759856 nil 94 (64 . 2) nil (2 . 10) (7 . 20))))  call-interactively(push-button nil nil)
  command-execute(push-button)
(backstace end)
This is because package-delete-button-action’s revert-buffer runs describe-package 
with old package-desc which archive field is nil.

Running describe-package with just package name instead of revert-buffer fixes 
these problems.

Thanks.

--
tsuucat

[0001-Improve-package-install-delete-button-action.patch (application/octet-stream, attachment)]

This bug report was last modified 4 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.