Skip to content

Commit

Permalink
Make 3603ec2 compatible with Emacs <24.2
Browse files Browse the repository at this point in the history
A few compilation-related variables are not available in
Emacs version prior to 24.2
  • Loading branch information
hvr committed Sep 2, 2013
1 parent 3603ec2 commit ddeb6d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions haskell-compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ This is a child of `compilation-mode-map'.")

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

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

0 comments on commit ddeb6d9

Please sign in to comment.