Skip to content

Commit ddeb6d9

Browse files
committed
Make 3603ec2 compatible with Emacs <24.2
A few compilation-related variables are not available in Emacs version prior to 24.2
1 parent 3603ec2 commit ddeb6d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

haskell-compile.el

+6-3
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ This is a child of `compilation-mode-map'.")
9393

9494
(when haskell-compile-ghc-filter-linker-messages
9595
(delete-matching-lines "^Loading package [^ \t\r\n]+ [.]+ linking [.]+ done\\.$"
96-
(save-excursion (goto-char compilation-filter-start)
97-
(line-beginning-position))
96+
(if (boundp 'compilation-filter-start) ;; available since Emacs 24.2
97+
(save-excursion (goto-char compilation-filter-start)
98+
(line-beginning-position))
99+
(point-min))
98100
(point))))
99101

100102
(define-compilation-mode haskell-compilation-mode "HsCompilation"
@@ -135,7 +137,8 @@ derived from `compilation-mode'. See Info
135137
node `(haskell-mode)compilation' for more details."
136138
(interactive "P")
137139
(save-some-buffers (not compilation-ask-about-save)
138-
compilation-save-buffers-predicate)
140+
(if (boundp 'compilation-save-buffers-predicate) ;; since Emacs 24.1(?)
141+
compilation-save-buffers-predicate))
139142
(let* ((cabdir (haskell-cabal-find-dir))
140143
(command1 (if (eq edit-command '-)
141144
haskell-compile-cabal-build-alt-command

0 commit comments

Comments
 (0)