[137649] users/chunyang/port.el/port.el

chunyang at macports.org chunyang at macports.org
Tue Jun 16 00:48:51 PDT 2015


Revision: 137649
          https://trac.macports.org/changeset/137649
Author:   chunyang at macports.org
Date:     2015-06-16 00:48:50 -0700 (Tue, 16 Jun 2015)
Log Message:
-----------
users/chunyang: port.el: Create port-menu-mode

Modified Paths:
--------------
    users/chunyang/port.el/port.el

Modified: users/chunyang/port.el/port.el
===================================================================
--- users/chunyang/port.el/port.el	2015-06-16 06:59:09 UTC (rev 137648)
+++ users/chunyang/port.el/port.el	2015-06-16 07:48:50 UTC (rev 137649)
@@ -2,7 +2,9 @@
 
 ;; Copyright (C) 2015  Chunyang Xu
 
-;; Author: Chunyang Xu <xuchunyang56 at gmail.com>
+;; Author: Chunyang Xu <chunyang at macports.org>
+;; Version: 0.01
+;; Package-Requires: ((emacs "24.1"))
 ;; Keywords: MacPorts
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -20,11 +22,34 @@
 
 ;;; Commentary:
 
-;;
+;; Latest version can be found at:
+;; https://svn.macports.org/repository/macports/users/chunyang/port.el/
 
 ;;; Code:
 
+(require 'tabulated-list)
 
+(define-derived-mode port-menu-mode tabulated-list-mode "MacPorts Port Menu"
+  "Major mode browsing a list of ports.
+Letters do not insert themselves; instead, they are commands. "
+  (setq tabulated-list-format `[("Package" 18 t)
+                                ("Version" 13 nil)
+                                ("Status"  10 t)
+                                ("Description" 0 nil)])
+  (setq tabulated-list-padding 2)
+  (setq tabulated-list-sort-key (cons "Status" nil))
+  (tabulated-list-init-header))
 
+;;;###autoload
+(defun port-list-ports ()
+  (interactive)
+  (let ((buf (get-buffer-create "*Ports*")))
+    (with-current-buffer buf
+      (port-menu-mode)
+      (setq tabulated-list-entries
+            (list (list "1" ["emacs" "24.5" "installed" "The GNU Emacs text editor"])))
+      (tabulated-list-print t)
+      (switch-to-buffer buf))))
+
 (provide 'port)
 ;;; port.el ends here
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150616/59c58b44/attachment.html>


More information about the macports-changes mailing list