From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Add the archive name column in the list-packages table Date: Fri, 25 Oct 2013 14:27:11 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87wql1w6io.fsf@flea.lifelogs.com> References: Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382725641 10492 80.91.229.3 (25 Oct 2013 18:27:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Oct 2013 18:27:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 25 20:27:26 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VZm6T-0002dh-N6 for ged-emacs-devel@m.gmane.org; Fri, 25 Oct 2013 20:27:21 +0200 Original-Received: from localhost ([::1]:60382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZm6T-0000yR-Aj for ged-emacs-devel@m.gmane.org; Fri, 25 Oct 2013 14:27:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZm6E-0000nk-5Y for emacs-devel@gnu.org; Fri, 25 Oct 2013 14:27:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZm63-0001vt-KD for emacs-devel@gnu.org; Fri, 25 Oct 2013 14:27:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZm63-0001vk-DW for emacs-devel@gnu.org; Fri, 25 Oct 2013 14:26:55 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VZm62-0002Hn-6X for emacs-devel@gnu.org; Fri, 25 Oct 2013 20:26:54 +0200 Original-Received: from c-98-229-61-72.hsd1.ma.comcast.net ([98.229.61.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Oct 2013 20:26:54 +0200 Original-Received: from tzz by c-98-229-61-72.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Oct 2013 20:26:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-229-61-72.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:XXZSqU1Gjf8G29Dr8ua1eo0oDEs= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164541 Archived-At: On Fri, 25 Oct 2013 12:09:05 -0400 Glenn Morris 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.