emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add the archive name column in the list-packages table


From: Ted Zlatanov
Subject: Re: Add the archive name column in the list-packages table
Date: Fri, 25 Oct 2013 14:27:11 -0400
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

On Fri, 25 Oct 2013 12:09:05 -0400 Glenn Morris <address@hidden> wrote: 

GM> Darren Hoo wrote:
>> So How about adding a column in list-packages that specifies the archive
>> name where one package is from?

GM> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12775

Can you try this patch?  It seems to DTRT for me, leaving the archive to
an empty string for nil archives.  Sorting works too.  I could make a
new `package-desc-archive-print' function I guess, if you think the
hard-coded "" is ugly.

Ted

=== modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el  2013-10-03 07:11:27 +0000
+++ lisp/emacs-lisp/package.el  2013-10-25 18:24:44 +0000
@@ -1575,6 +1575,7 @@
   (setq tabulated-list-format [("Package" 18 package-menu--name-predicate)
                               ("Version" 12 nil)
                               ("Status"  10 package-menu--status-predicate)
+                              ("Archive" 10 package-menu--archive-predicate)
                               ("Description" 0 nil)])
   (setq tabulated-list-padding 2)
   (setq tabulated-list-sort-key (cons "Status" nil))
@@ -1697,6 +1698,8 @@
                                (package-desc-version pkg-desc))
                              'font-lock-face face)
                  (propertize status 'font-lock-face face)
+                 (propertize (or (package-desc-archive pkg-desc) "")
+                              'font-lock-face face)
                  (propertize (package-desc-summary pkg-desc)
                               'font-lock-face face)))))
 
@@ -1913,6 +1916,10 @@
   (string< (symbol-name (package-desc-name (car A)))
           (symbol-name (package-desc-name (car B)))))
 
+(defun package-menu--archive-predicate (A B)
+  (string< (or (package-desc-archive (car A)) "")
+          (or (package-desc-archive (car B)) "")))
+
 ;;;###autoload
 (defun list-packages (&optional no-fetch)
   "Display a list of packages.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]