Skip to content

Commit 40b1df7

Browse files
committed
Merge pull request #1277 from fice-t/24.3
Officially support only Emacs 24.3 and later
2 parents 599d0d9 + 8f300f6 commit 40b1df7

22 files changed

+114
-518
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ EMACS := $(shell which "$${EMACS}" || which "emacs")
2727
EMACS_VERSION := $(shell "$(EMACS)" -Q --batch --eval '(princ emacs-version)')
2828

2929
EFLAGS = --eval "(add-to-list 'load-path (expand-file-name \"tests/compat\") 'append)" \
30-
--eval "(when (< emacs-major-version 24) \
31-
(setq byte-compile-warnings '(not cl-functions)))" \
3230
--eval '(setq byte-compile-error-on-warn t)' \
3331
--eval '(when (not (version< emacs-version "24.4")) (setq load-prefer-newer t))' \
3432
--eval '(defun byte-compile-dest-file (filename) \
@@ -50,8 +48,8 @@ PKG_DIST_FILES = $(ELFILES) logo.svg NEWS haskell-mode.info dir
5048
all: check-emacs-version compile $(AUTOLOADS) info
5149

5250
check-emacs-version :
53-
@$(BATCH) --eval "(when (< emacs-major-version 23) \
54-
(message \"Error: haskell-mode requires Emacs 23 or later\") \
51+
@$(BATCH) --eval "(when (version< emacs-version \"24.3\") \
52+
(message \"Error: haskell-mode requires Emacs 24.3 or later\") \
5553
(message \"Your version of Emacs is %s\" emacs-version) \
5654
(message \"Found as '$(EMACS)'\") \
5755
(message \"Use one of:\") \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ for setup and user guide.
6767

6868
## Installation - more information
6969

70-
`haskell-mode` supports GNU Emacs version 24 or later.
70+
`haskell-mode` supports GNU Emacs version 24.3 or later.
7171

7272
`haskell-mode` is available from [melpa-stable](http://stable.melpa.org) (releases) and [melpa](http://melpa.org)
7373
(git snapshots).

doc/haskell-mode.texi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Front-Cover Texts and no Back-Cover Texts.
4242
@top Haskell Mode
4343

4444
Haskell Mode is an Haskell development Environment for GNU Emacs version
45-
24 or later. It provides syntax-based indentation, font locking,
45+
24.3 or later. It provides syntax-based indentation, font locking,
4646
editing cabal files, and supports running an inferior Haskell
4747
interpreter (e.g. GHCi).
4848

@@ -167,7 +167,7 @@ The above steps should result in the following snippet in your @file{.emacs}:
167167

168168
@section Installation - more information
169169

170-
@code{haskell-mode} supports GNU Emacs versions 24 and upcoming 25
170+
@code{haskell-mode} supports GNU Emacs versions 24.3+, including 25
171171
(snapshot).
172172

173173
@code{haskell-mode} is available from
@@ -178,9 +178,9 @@ Other means of obtaining @code{haskell-mode} include
178178
@uref{https://github.com/dimitri/el-get, el-get},
179179
@uref{https://github.com/bbatsov/prelude, Emacs Prelude} and @uref{https://packages.debian.org/search?keywords=haskell-mode, Debian package}.
180180

181-
Last version of @code{haskell-mode} that supported Emacs 23 is
182-
@code{haskell-mode} 13.18 available at
183-
@uref{https://github.com/haskell/haskell-mode/releases/tag/v13.18}.
181+
Last version of @code{haskell-mode} that supported Emacs 23, 24.1, and 24.2 is
182+
@code{haskell-mode} 13.16 available at
183+
@uref{https://github.com/haskell/haskell-mode/releases/tag/v13.16}.
184184

185185
@section Customizing
186186

ghci-script-mode.el

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,22 @@
3030
;;;###autoload
3131
(define-derived-mode ghci-script-mode text-mode "GHCi-Script"
3232
"Major mode for working with .ghci files."
33-
(set (make-local-variable 'adaptive-fill-mode) nil)
34-
(set (make-local-variable 'comment-start) "-- ")
35-
(set (make-local-variable 'comment-padding) 0)
36-
(set (make-local-variable 'comment-start-skip) "[-{]-[ \t]*")
37-
(set (make-local-variable 'comment-end) "")
38-
(set (make-local-variable 'comment-end-skip) "[ \t]*\\(-}\\|\\s>\\)")
39-
(set (make-local-variable 'indent-line-function) 'haskell-mode-suggest-indent-choice)
40-
(set (make-local-variable 'font-lock-defaults)
41-
'(ghci-script-mode-keywords t t nil nil))
42-
(set (make-local-variable 'indent-tabs-mode) nil)
43-
(set (make-local-variable 'tab-width) 8)
33+
(setq-local adaptive-fill-mode nil)
34+
(setq-local comment-start "-- ")
35+
(setq-local comment-padding 0)
36+
(setq-local comment-start-skip "[-{]-[ \t]*")
37+
(setq-local comment-end "")
38+
(setq-local comment-end-skip "[ \t]*\\(-}\\|\\s>\\)")
39+
(setq-local indent-line-function 'haskell-mode-suggest-indent-choice)
40+
(setq-local font-lock-defaults '(ghci-script-mode-keywords t t nil nil))
41+
(setq-local indent-tabs-mode nil)
42+
(setq-local tab-width 8)
4443
(when (boundp 'electric-indent-inhibit)
4544
(setq electric-indent-inhibit t))
46-
(set (make-local-variable 'dabbrev-case-fold-search) nil)
47-
(set (make-local-variable 'dabbrev-case-distinction) nil)
48-
(set (make-local-variable 'dabbrev-case-replace) nil)
49-
(set (make-local-variable 'dabbrev-abbrev-char-regexp) "\\sw\\|[.]")
45+
(setq-local dabbrev-case-fold-search nil)
46+
(setq-local dabbrev-case-distinction nil)
47+
(setq-local dabbrev-case-replace nil)
48+
(setq-local dabbrev-abbrev-char-regexp "\\sw\\|[.]")
5049
(setq haskell-literate nil))
5150

5251
;;;###autoload

haskell-cabal.el

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,16 @@ it from list if one of the following conditions are hold:
145145
;;;###autoload
146146
(define-derived-mode haskell-cabal-mode fundamental-mode "Haskell-Cabal"
147147
"Major mode for Cabal package description files."
148-
(set (make-local-variable 'font-lock-defaults)
149-
'(haskell-cabal-font-lock-keywords t t nil nil))
148+
(setq-local font-lock-defaults
149+
'(haskell-cabal-font-lock-keywords t t nil nil))
150150
(add-to-list 'haskell-cabal-buffers (current-buffer))
151151
(add-hook 'change-major-mode-hook 'haskell-cabal-unregister-buffer nil 'local)
152152
(add-hook 'kill-buffer-hook 'haskell-cabal-unregister-buffer nil 'local)
153-
(set (make-local-variable 'comment-start) "-- ")
154-
(set (make-local-variable 'comment-start-skip) "\\(^[ \t]*\\)--[ \t]*")
155-
(set (make-local-variable 'comment-end) "")
156-
(set (make-local-variable 'comment-end-skip) "[ \t]*\\(\\s>\\|\n\\)")
157-
(set (make-local-variable 'indent-line-function) 'haskell-cabal-indent-line)
153+
(setq-local comment-start "-- ")
154+
(setq-local comment-start-skip "\\(^[ \t]*\\)--[ \t]*")
155+
(setq-local comment-end "")
156+
(setq-local comment-end-skip "[ \t]*\\(\\s>\\|\n\\)")
157+
(setq-local indent-line-function 'haskell-cabal-indent-line)
158158
(setq indent-tabs-mode nil)
159159
)
160160

haskell-checkers.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ name - user visible name for this mode"
154154
;;;###autoload
155155
(define-compilation-mode ,(intern (concat nm "-mode")) ,name
156156
,(concat "Mode to check Haskell source code using " name)
157-
(set (make-local-variable 'compilation-process-setup-function)
158-
',(intern (concat nm "-process-setup")))
159-
(set (make-local-variable 'compilation-disable-input) t)
160-
(set (make-local-variable 'compilation-scroll-output) nil)
161-
(set (make-local-variable 'compilation-finish-functions)
162-
(list ',(intern (concat nm "-finish-hook")))))
157+
(setq-local compilation-process-setup-function
158+
',(intern (concat nm "-process-setup")))
159+
(setq-local compilation-disable-input t)
160+
(setq-local compilation-scroll-output nil)
161+
(setq-local compilation-finish-functions
162+
(list ',(intern (concat nm "-finish-hook")))))
163163
;;;###autoload
164164
(defun ,(intern nm) ()
165165
,(concat "Run " name " for current buffer with haskell source")

haskell-compile.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ format is supported, as well as info-locations within compile
106106
messages pointing to additional source locations.
107107
108108
See Info node `(haskell-mode)compilation' for more details."
109-
(set (make-local-variable 'compilation-error-regexp-alist)
110-
haskell-compilation-error-regexp-alist)
109+
(setq-local compilation-error-regexp-alist
110+
haskell-compilation-error-regexp-alist)
111111

112112
(add-hook 'compilation-filter-hook
113113
'haskell-compilation-filter-hook nil t)

haskell-decl-scan.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,8 @@ Invokes `haskell-decl-scan-mode-hook' on activation."
604604
(local-set-key [menu-bar index] nil)))
605605

606606
(when haskell-decl-scan-mode
607-
(set (make-local-variable 'beginning-of-defun-function)
608-
'haskell-ds-backward-decl)
609-
(set (make-local-variable 'end-of-defun-function)
610-
'haskell-ds-forward-decl)
607+
(setq-local beginning-of-defun-function 'haskell-ds-backward-decl)
608+
(setq-local end-of-defun-function 'haskell-ds-forward-decl)
611609
(haskell-ds-imenu)))
612610

613611

haskell-doc.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
:prefix "haskell-doc-")
316316

317317

318-
(defvar haskell-doc-mode nil
318+
(defvar-local haskell-doc-mode nil
319319
"*If non-nil, show the type of the function near point or a related comment.
320320
321321
If the identifier near point is a Haskell keyword and the variable
@@ -343,17 +343,15 @@ in the alist `haskell-doc-user-defined-ids' and the variable
343343
`haskell-doc-show-user-defined' is non-nil show the type of the function.
344344
345345
This variable is buffer-local.")
346-
(make-variable-buffer-local 'haskell-doc-mode)
347346

348347
(defvar haskell-doc-mode-hook nil
349348
"Hook invoked when entering `haskell-doc-mode'.")
350349

351-
(defvar haskell-doc-index nil
350+
(defvar-local haskell-doc-index nil
352351
"Variable holding an alist matching file names to fct-type alists.
353352
The function `haskell-doc-make-global-fct-index' rebuilds this variables
354353
\(similar to an `imenu' rescan\).
355354
This variable is buffer-local.")
356-
(make-variable-buffer-local 'haskell-doc-index)
357355

358356
(defcustom haskell-doc-show-global-types nil
359357
"If non-nil, search for the types of global functions by loading the files.

haskell-font-lock.el

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,14 @@ like ::, class, instance, data, newtype, type."
544544

545545
(defun haskell-font-lock-defaults-create ()
546546
"Locally set `font-lock-defaults' for Haskell."
547-
(set (make-local-variable 'font-lock-defaults)
548-
'((haskell-font-lock-keywords)
549-
nil nil nil nil
550-
(font-lock-syntactic-face-function
551-
. haskell-syntactic-face-function)
552-
;; Get help from font-lock-syntactic-keywords.
553-
(parse-sexp-lookup-properties . t)
554-
(font-lock-extra-managed-props . (composition)))))
547+
(setq-local font-lock-defaults
548+
'((haskell-font-lock-keywords)
549+
nil nil nil nil
550+
(font-lock-syntactic-face-function
551+
. haskell-syntactic-face-function)
552+
;; Get help from font-lock-syntactic-keywords.
553+
(parse-sexp-lookup-properties . t)
554+
(font-lock-extra-managed-props . (composition)))))
555555

556556
(defun haskell-fontify-as-mode (text mode)
557557
"Fontify TEXT as MODE, returning the fontified text."

0 commit comments

Comments
 (0)