[137507] users/chunyang/helm-ls-svn.el/helm-ls-svn.el
chunyang at macports.org
chunyang at macports.org
Sat Jun 13 04:10:11 PDT 2015
Revision: 137507
https://trac.macports.org/changeset/137507
Author: chunyang at macports.org
Date: 2015-06-13 04:10:11 -0700 (Sat, 13 Jun 2015)
Log Message:
-----------
users/chunyang: helm-ls-svn.el: Add actions for helm-ls-svn-status-source class
Modified Paths:
--------------
users/chunyang/helm-ls-svn.el/helm-ls-svn.el
Modified: users/chunyang/helm-ls-svn.el/helm-ls-svn.el
===================================================================
--- users/chunyang/helm-ls-svn.el/helm-ls-svn.el 2015-06-13 10:40:29 UTC (rev 137506)
+++ users/chunyang/helm-ls-svn.el/helm-ls-svn.el 2015-06-13 11:10:11 UTC (rev 137507)
@@ -49,6 +49,11 @@
"Helm completion for svn repos."
:group 'helm)
+(defcustom helm-ls-svn-status-command 'vc-dir
+ "Favorite svn-status command for emacs."
+ :group 'helm-ls-svn
+ :type 'symbol)
+
(defvar helm-ls-svn-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map helm-generic-files-map)
@@ -87,6 +92,13 @@
"svn" nil t nil
(list "status")))))))
+(defun helm-ls-svn-status-transformer (candidates _source)
+ (let ((root (helm-ls-svn-root-dir)))
+ (mapcar (lambda (candidate)
+ (cons candidate
+ (expand-file-name (cadr (split-string candidate)) root)))
+ candidates)))
+
(defclass helm-ls-svn-source (helm-source-in-buffer)
((header-name :initform 'helm-ls-svn-header-name)
(init :initform 'helm-ls-svn-init)
@@ -101,7 +113,14 @@
(lambda ()
(helm-init-candidates-in-buffer 'global
(helm-ls-svn-status))))
- (keymap :initform helm-ls-svn-map)))
+ (keymap :initform helm-ls-svn-map)
+ (filtered-candidate-transformer :initform 'helm-ls-svn-status-transformer)
+ (action :initform
+ (helm-make-actions
+ "Find file" 'helm-find-many-files
+ "svn status" (lambda (_candidate)
+ (funcall helm-ls-svn-status-command
+ (helm-default-directory)))))))
;;;###autoload
(defun helm-ls-svn-ls ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150613/60193feb/attachment-0001.html>
More information about the macports-changes
mailing list