mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Something useful that I use all the time that I would like to give to others. It enables emacs compile-mode to be used like a standalone-ish application instead of one application with many modes, one of which is compile-mode.
18 lines
419 B
Bash
Executable File
18 lines
419 B
Bash
Executable File
#!/bin/bash
|
|
|
|
tmpfile=$(mktemp "/tmp/emacs-compile.XXXXXX")
|
|
|
|
cat <<EOF > $tmpfile
|
|
;; Turn off y-or-no-p
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
;; Set the skip threshold to 2 so that we jump only to errors, not warnings.
|
|
(setq compilation-skip-threshold 2)
|
|
|
|
;; Now that we are configured, call compile and set the main window.
|
|
(compile "$@")
|
|
(switch-to-buffer "*compilation*")
|
|
(delete-other-windows)
|
|
EOF
|
|
|
|
emacs -Q -l $tmpfile
|