Skip to content

Instantly share code, notes, and snippets.

@chriscauley
Created October 8, 2019 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriscauley/3784ee0a71609344c0dd55ec05419153 to your computer and use it in GitHub Desktop.
Save chriscauley/3784ee0a71609344c0dd55ec05419153 to your computer and use it in GitHub Desktop.
Loop through files and open sequentially in emacs
# Put this in .bash_aliases or .bashrc
# USAGE:
# eemacs a.py b.py c.py
# eemacs `grep SomeClass * -rl`
# grep SomeClass * -rl | grep -v migrations | grep models.py > SOME_CLASS
# eemacs `cat SOME_CLASS`
function eemacs {
DNE=()
for FILE in $*;
do
if test -f "$FILE"
then emacs $FILE;
else DNE+=($FILE)
fi
done
for FILE in $DNE;
do
echo "Missing: $FILE"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment