Skip to content

Instantly share code, notes, and snippets.

@swflint
swflint / dired-annex-integration.el
Created May 17, 2019 16:03
Git Annex and Dired Integration
;; Note: Requires dired-hacks, specifically dired-open
(defun my/in-annex-repo-p ()
(= 0 (call-process "git" nil nil nil "annex" "status")))
(defun my/dired-try-git-annex-get (filename)
(if (not (my/in-annex-repo-p))
(signal 'error "File is a symlink to a nonexistent target")
(with-help-window "*git-annex-get status*"
(call-process "git" nil (get-buffer "*git-annex-get status*") t "annex" "get" filename)