GNU bug report logs - #15201
24.2; extensions/enhancements to package.el

Previous Next

Package: emacs;

Reported by: Ryan Davis <zenspider <at> gmail.com>

Date: Wed, 28 Aug 2013 00:38:03 UTC

Severity: wishlist

Found in version 24.2

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15201 in the body.
You can then email your comments to 15201 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15201; Package emacs. (Wed, 28 Aug 2013 00:38:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Davis <zenspider <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 28 Aug 2013 00:38:09 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ryan Davis <zenspider <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; extensions/enhancements to package.el
Date: Tue, 27 Aug 2013 16:37:49 -0700
I know that using cl is frowned upon... but I'm writing this code to be
compatible with 24.2 so I can't rely on cl-lib (since this is an
extension to the system used to install cl-lib). I'm only using it for
set-difference and am open to modifications to make it more
portable/acceptable. You can see this code in:

https://github.com/zenspider/package/blob/master/package%2B.el#L70-L104

  (require 'cl)

  (defun package-version-for (name)
    "Returns the installed version for a package with a given NAME."
    (package-desc-vers (cdr (assoc name package-alist))))

  (defun package-delete-by-name (name)
    "Deletes a package by NAME"
    (message "Removing %s" name)
    (package-delete (symbol-name name)
                    (package-version-join (package-version-for name))))

  (defun package-maybe-install (name)
    "Installs a package by NAME, but only if it isn't already installed."
    (unless (package-installed-p name)
      (message "Installing %s" name)
      (package-install name)))

  (defun package-deps-for (pkg)
    "Returns the dependency list for PKG or nil if none or the PKG doesn't exist."
    (let ((v (cdr (assoc pkg package-alist))))
      (and v (package-desc-reqs v))))

  (defun package-transitive-closure (pkgs)
    (let ((deps '()))
      (dolist (pkg pkgs deps)
        (add-to-list 'deps pkg)
        (dolist (new-pkg (mapcar 'car (package-deps-for pkg)))
          (add-to-list 'deps new-pkg)))))

  (defun package-cleanup (packages)
    "Delete installed packages not explicitly declared in PACKAGES."
    (let ((removes (set-difference (mapcar 'car package-alist)
                                   (package-transitive-closure packages))))
      (mapc 'package-delete-by-name removes)))

;;; finis

In GNU Emacs 24.2.1 (x86_64-apple-darwin12.2.0, NS apple-appkit-1187.34)
of 2012-09-20 on greed.local
Windowing system distributor `Apple', version 10.3.1187
Configured using:
`configure '--prefix=/usr/local/Cellar/emacs/24.2' '--without-dbus'
'--enable-locallisppath=/usr/local/share/emacs/site-lisp'
'--infodir=/usr/local/Cellar/emacs/24.2/share/info/emacs' '--with-ns'
'--disable-ns-self-contained''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
s-x <escape> x r e p <tab> o <tab> r <tab> <return
>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
kill-region: The mark is not set now, so there is no region
Quit
Making completion list... [2 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode easymenu view time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15201; Package emacs. (Wed, 28 Aug 2013 01:15:01 GMT) Full text and rfc822 format available.

Message #8 received at 15201 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ryan Davis <zenspider <at> gmail.com>
Cc: 15201 <at> debbugs.gnu.org
Subject: Re: bug#15201: 24.2; extensions/enhancements to package.el
Date: Tue, 27 Aug 2013 21:12:54 -0400
> I know that using cl is frowned upon... but I'm writing this code to be
> compatible with 24.2 so I can't rely on cl-lib (since this is an
> extension to the system used to install cl-lib). I'm only using it for
> set-difference and am open to modifications to make it more
> portable/acceptable. You can see this code in:

Use of CL is generally discouraged, and is not allowed at run-time for
packages included in Emacs.  IOW As long as your code is not meant to be
included in Emacs you don't need to worry too much about it.

OTOH, the code you sent doesn't work with the package.el that's in
Emacs's current trunk (e.g. package-delete now only takes a single argument).

One more thing: I like the idea of having a declarative list of
"packages that should be installed" so as to be able to delete packages
that were installed as dependencies but aren't needed any more.  So I'd
welcome patches that add such functionality to package.el.


        Stefan




Removed tag(s) patch. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 24 Mar 2018 02:19:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15201; Package emacs. (Thu, 15 Jul 2021 06:01:02 GMT) Full text and rfc822 format available.

Message #13 received at 15201 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ryan Davis <zenspider <at> gmail.com>
Cc: 15201 <at> debbugs.gnu.org
Subject: Re: bug#15201: 24.2; extensions/enhancements to package.el
Date: Thu, 15 Jul 2021 08:00:26 +0200
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

It seems like the conclusion here was that the proposed helper functions
didn't seem very vital to add, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





bug closed, send any further explanations to 15201 <at> debbugs.gnu.org and Ryan Davis <zenspider <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Jul 2021 06:01:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Aug 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 250 days ago.

Previous Next


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