Created
April 11, 2023 14:36
-
-
Save woochica/d02b2f1b79d97cc35c6616fa897d48a7 to your computer and use it in GitHub Desktop.
Open file in new Emacs window (supports FILE:LINE:COL schema)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z "$1" ] ; then | |
echo "Open file in Emacs (create new frame)." | |
echo "Usage: $0 filename" | |
exit 1 | |
fi | |
FILE=$(echo $1 | cut -d : -f 1) | |
POS=$(echo $1 | cut -d : -f 2-) | |
if [ $FILE = $POS ] ; then | |
emacsclient -c $FILE | |
else | |
emacsclient +$POS -c $FILE | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment