diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-10 13:03:36 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-11 01:36:41 -0400 |
commit | a55986ab1887214c316d2d8ffebe38ae0b30483f (patch) | |
tree | 7d2b8014bf072b411b259535520ccbf01da4298e | |
parent | fb52b36bb545194ae25f69968a6374b68cd217bd (diff) |
Makefile: Avoid a bug in Emacs 24 sh-script.el indent
It screws up indent in an `if` block (but not the `then` block).
-rw-r--r-- | INSTALL | 7 | ||||
-rw-r--r-- | common.once.head.mk | 2 |
2 files changed, 7 insertions, 2 deletions
@@ -24,8 +24,11 @@ to cause issues. The "unusual" build-time dependencies are: - GNU Make -- other `make`s will not work. - - GNU sed -- must support `-r` for ERE; BSD sed uses `-E` for this purpose. - - Emacs -- `emacs --batch` is used to use Emacs Lisp to process some text. + - GNU sed -- must support `-r` for ERE; BSD sed uses `-E` for this + purpose. + - Emacs 24.4+ -- `emacs --batch` is used to use Emacs Lisp to process + some text. GNU Emacs 24.4 introduced a new `advice-add` system + which we depend on. - ronn -- A markdown-to-manpage converter At this time, the build system does not support not building the diff --git a/common.once.head.mk b/common.once.head.mk index d7faab8..33084fa 100644 --- a/common.once.head.mk +++ b/common.once.head.mk @@ -42,6 +42,8 @@ edit = sed \ indent = emacs --batch $1 \ --eval '(setq make-backup-files nil)' \ --eval '(setq sh-basic-offset 8)' \ + --eval '(defun sh-smie-sh-rules--fix (args) "fix bug in Emacs 24 sh-script.el" (if (equal args (list :after "then")) (list :after "if") args))' \ + --eval "(advice-add 'sh-smie-sh-rules :filter-args \#'sh-smie-sh-rules--fix)" \ --eval '(indent-region (point-min) (point-max) nil)' \ -f save-buffer &>/dev/null |