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

+2-4
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

+1-1
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

+5-5
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

+14-15
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

+7-7
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

+6-6
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

+2-2
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

+2-4
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

+2-4
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

+8-8
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."

haskell-indent.el

+3-4
Original file line numberDiff line numberDiff line change
@@ -1489,9 +1489,8 @@ One indentation cycle is used."
14891489

14901490
;;; haskell-indent-mode
14911491

1492-
(defvar haskell-indent-mode nil
1492+
(defvar-local haskell-indent-mode nil
14931493
"Non-nil if the semi-intelligent Haskell indentation mode is in effect.")
1494-
(make-variable-buffer-local 'haskell-indent-mode)
14951494

14961495
(defvar haskell-indent-map
14971496
(let ((map (make-sparse-keymap)))
@@ -1517,8 +1516,8 @@ One indentation cycle is used."
15171516
(fboundp 'haskell-indentation-mode))
15181517
(haskell-indentation-mode 0))
15191518

1520-
(set (make-local-variable 'indent-line-function) 'haskell-indent-cycle)
1521-
(set (make-local-variable 'indent-region-function) 'haskell-indent-region)
1519+
(setq-local indent-line-function 'haskell-indent-cycle)
1520+
(setq-local indent-region-function 'haskell-indent-region)
15221521
(setq haskell-indent-mode t)
15231522
;; Activate our keymap.
15241523
(let ((map (current-local-map)))

haskell-indentation.el

+2-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ set and deleted as if they were real tabs."
111111
(when (and (bound-and-true-p haskell-simple-indent-mode)
112112
(fboundp 'haskell-simple-indent-mode))
113113
(haskell-simple-indent-mode 0))
114-
(set (make-local-variable 'indent-line-function)
115-
'haskell-indentation-indent-line)
116-
(set (make-local-variable 'indent-region-function)
117-
'haskell-indentation-indent-region)))
114+
(setq-local indent-line-function 'haskell-indentation-indent-line)
115+
(setq-local indent-region-function 'haskell-indentation-indent-region)))
118116

119117
;;;###autoload
120118
(defun turn-on-haskell-indentation ()

haskell-interactive-mode.el

+6-13
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,12 @@
4242
(require 'cl-lib)
4343
(require 'etags)
4444

45-
(defvar haskell-interactive-mode-history-index)
46-
(make-variable-buffer-local 'haskell-interactive-mode-history-index)
45+
(defvar-local haskell-interactive-mode-history-index 0)
4746

48-
(defvar haskell-interactive-mode-history (list))
49-
(make-variable-buffer-local 'haskell-interactive-mode-history)
47+
(defvar-local haskell-interactive-mode-history (list))
5048

51-
(defvar haskell-interactive-mode-old-prompt-start
52-
nil
49+
(defvar-local haskell-interactive-mode-old-prompt-start nil
5350
"Mark used for the old beginning of the prompt.")
54-
(make-variable-buffer-local 'haskell-interactive-mode-old-prompt-start)
5551

5652
(defun haskell-interactive-prompt-regex ()
5753
"Generate a regex for searching for any occurence of the prompt\
@@ -111,11 +107,10 @@ Key bindings:
111107
"Mark used to figure out where the end of the current result output is.
112108
Used to distinguish betwen user input.")
113109

114-
(defvar haskell-interactive-previous-buffer nil
110+
(defvar-local haskell-interactive-previous-buffer nil
115111
"Records the buffer to which `haskell-interactive-switch-back' should jump.
116112
This is set by `haskell-interactive-switch', and should otherwise
117113
be nil.")
118-
(make-variable-buffer-local 'haskell-interactive-previous-buffer)
119114

120115
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
121116
;; Hooks
@@ -327,8 +322,7 @@ SESSION, otherwise operate on the current buffer."
327322
(insert (substring prompt 0 1)
328323
(propertize (substring prompt 1)
329324
'front-sticky t)))
330-
(let ((marker (set (make-local-variable 'haskell-interactive-mode-prompt-start)
331-
(make-marker))))
325+
(let ((marker (setq-local haskell-interactive-mode-prompt-start (make-marker))))
332326
(set-marker marker (point)))
333327
(when haskell-interactive-mode-scroll-to-bottom
334328
(haskell-interactive-mode-scroll-to-bottom))))
@@ -346,8 +340,7 @@ SESSION, otherwise operate on the current buffer."
346340
'rear-nonsticky t
347341
'result t)))
348342
(haskell-interactive-mode-handle-h)
349-
(let ((marker (set (make-local-variable 'haskell-interactive-mode-result-end)
350-
(make-marker))))
343+
(let ((marker (setq-local haskell-interactive-mode-result-end (make-marker))))
351344
(set-marker marker
352345
(point)
353346
(current-buffer)))

haskell-menu.el

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
Each line describes one session.
6262
Letters do not insert themselves; instead, they are commands."
6363
(setq buffer-read-only t)
64-
(set (make-local-variable 'revert-buffer-function)
65-
'haskell-menu-revert-function)
64+
(setq-local revert-buffer-function 'haskell-menu-revert-function)
6665
(setq truncate-lines t)
6766
(haskell-menu-revert-function nil t))
6867

haskell-mode-pkg.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(define-package "haskell-mode" "16.1-git" "A Haskell editing mode"
2-
'((emacs "24.1") (cl-lib "0.5"))
2+
'((emacs "24.3"))
33
:url "https://github.com/haskell/haskell-mode"
44
:keywords '("haskell" "cabal" "ghc" "repl"))
55
;; Local Variables:

0 commit comments

Comments
 (0)