help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple useful function


From: Andrea Crotti
Subject: Simple useful function
Date: Mon, 05 Jul 2010 23:19:18 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (darwin)

I write it here because I hope someone will find it useful...

I wrote this function to open all the files listed in my git repository

--8<---------------cut here---------------start------------->8---
(defun open-git-files ()
  "Visit all the files in the current git project"
  (interactive)
  (dolist
      (file (split-string (shell-command-to-string "git ls-files")))
    (message "Opening %s" file)
    ;; we have to keep the original position
    (find-file file)))
--8<---------------cut here---------------end--------------->8---

The problem is that if I understand well when I find the file I also
change the current directory, and then nothing works anymore...

I also tried to store the start point and concatenate it but it also
doesn't work.

Is there a smarter way to do it? (maybe not using git ls-files at all?)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]