Add emacs console helper scripts

This commit is contained in:
2025-09-08 21:16:56 +02:00
parent 7279a53bc0
commit 7cc80e8cf4
14 changed files with 385 additions and 16 deletions

25
bin/emacs-compare Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Launch Emacs in terminal mode for file comparison (ediff)
# Usage: emacs-compare file1 file2
if [ $# -ne 2 ]; then
echo "Usage: $0 file1 file2"
echo "Compare two files using Emacs ediff"
exit 1
fi
if [ ! -f "$1" ]; then
echo "Error: File $1 does not exist"
exit 1
fi
if [ ! -f "$2" ]; then
echo "Error: File $2 does not exist"
exit 1
fi
FILE1=$(realpath "$1")
FILE2=$(realpath "$2")
EMACS_NO_DESKTOP=1 emacs -nw --eval "(progn
(ediff-files \"$FILE1\" \"$FILE2\"))"