Skip to content

Instantly share code, notes, and snippets.

@vvuk
Created November 29, 2013 01:32
Show Gist options
  • Save vvuk/7700393 to your computer and use it in GitHub Desktop.
Save vvuk/7700393 to your computer and use it in GitHub Desktop.
(require 'filecache)
(defun file-cache-add-from-file (file &optional prefix)
"Read filenames from FILE, one line per file, and add them to
the file cache. If prefix is given, stick that prefix at the
start of every line before adding to file cache."
(interactive "fAdd files from file: ")
(set-buffer (get-buffer-create file-cache-buffer))
(erase-buffer)
(insert-file file)
(if (not (eq prefix nil))
(progn (goto-char 0)
(replace-regexp "^" prefix)))
(file-cache-add-from-file-cache-buffer))
(defun file-cache-file-for-dir (file dir)
(if (file-exists-p file)
(file-cache-add-from-file file dir)))
(file-cache-file-for-dir "c:/proj/moz/mozilla-central/.git/emacs-file-list"
"c:/proj/moz/mozilla-central/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment