Skip to content

Officially support only Emacs 24.3 and later #1277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ EMACS := $(shell which "$${EMACS}" || which "emacs")
EMACS_VERSION := $(shell "$(EMACS)" -Q --batch --eval '(princ emacs-version)')

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

check-emacs-version :
@$(BATCH) --eval "(when (< emacs-major-version 23) \
(message \"Error: haskell-mode requires Emacs 23 or later\") \
@$(BATCH) --eval "(when (version< emacs-version \"24.3\") \
(message \"Error: haskell-mode requires Emacs 24.3 or later\") \
(message \"Your version of Emacs is %s\" emacs-version) \
(message \"Found as '$(EMACS)'\") \
(message \"Use one of:\") \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ for setup and user guide.

## Installation - more information

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

`haskell-mode` is available from [melpa-stable](http://stable.melpa.org) (releases) and [melpa](http://melpa.org)
(git snapshots).
Expand Down
10 changes: 5 additions & 5 deletions doc/haskell-mode.texi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Front-Cover Texts and no Back-Cover Texts.
@top Haskell Mode

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

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

@section Installation - more information

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

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

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

@section Customizing

Expand Down
29 changes: 14 additions & 15 deletions ghci-script-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@
;;;###autoload
(define-derived-mode ghci-script-mode text-mode "GHCi-Script"
"Major mode for working with .ghci files."
(set (make-local-variable 'adaptive-fill-mode) nil)
(set (make-local-variable 'comment-start) "-- ")
(set (make-local-variable 'comment-padding) 0)
(set (make-local-variable 'comment-start-skip) "[-{]-[ \t]*")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-end-skip) "[ \t]*\\(-}\\|\\s>\\)")
(set (make-local-variable 'indent-line-function) 'haskell-mode-suggest-indent-choice)
(set (make-local-variable 'font-lock-defaults)
'(ghci-script-mode-keywords t t nil nil))
(set (make-local-variable 'indent-tabs-mode) nil)
(set (make-local-variable 'tab-width) 8)
(setq-local adaptive-fill-mode nil)
(setq-local comment-start "-- ")
(setq-local comment-padding 0)
(setq-local comment-start-skip "[-{]-[ \t]*")
(setq-local comment-end "")
(setq-local comment-end-skip "[ \t]*\\(-}\\|\\s>\\)")
(setq-local indent-line-function 'haskell-mode-suggest-indent-choice)
(setq-local font-lock-defaults '(ghci-script-mode-keywords t t nil nil))
(setq-local indent-tabs-mode nil)
(setq-local tab-width 8)
(when (boundp 'electric-indent-inhibit)
(setq electric-indent-inhibit t))
(set (make-local-variable 'dabbrev-case-fold-search) nil)
(set (make-local-variable 'dabbrev-case-distinction) nil)
(set (make-local-variable 'dabbrev-case-replace) nil)
(set (make-local-variable 'dabbrev-abbrev-char-regexp) "\\sw\\|[.]")
(setq-local dabbrev-case-fold-search nil)
(setq-local dabbrev-case-distinction nil)
(setq-local dabbrev-case-replace nil)
(setq-local dabbrev-abbrev-char-regexp "\\sw\\|[.]")
(setq haskell-literate nil))

;;;###autoload
Expand Down
14 changes: 7 additions & 7 deletions haskell-cabal.el
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ it from list if one of the following conditions are hold:
;;;###autoload
(define-derived-mode haskell-cabal-mode fundamental-mode "Haskell-Cabal"
"Major mode for Cabal package description files."
(set (make-local-variable 'font-lock-defaults)
'(haskell-cabal-font-lock-keywords t t nil nil))
(setq-local font-lock-defaults
'(haskell-cabal-font-lock-keywords t t nil nil))
(add-to-list 'haskell-cabal-buffers (current-buffer))
(add-hook 'change-major-mode-hook 'haskell-cabal-unregister-buffer nil 'local)
(add-hook 'kill-buffer-hook 'haskell-cabal-unregister-buffer nil 'local)
(set (make-local-variable 'comment-start) "-- ")
(set (make-local-variable 'comment-start-skip) "\\(^[ \t]*\\)--[ \t]*")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-end-skip) "[ \t]*\\(\\s>\\|\n\\)")
(set (make-local-variable 'indent-line-function) 'haskell-cabal-indent-line)
(setq-local comment-start "-- ")
(setq-local comment-start-skip "\\(^[ \t]*\\)--[ \t]*")
(setq-local comment-end "")
(setq-local comment-end-skip "[ \t]*\\(\\s>\\|\n\\)")
(setq-local indent-line-function 'haskell-cabal-indent-line)
(setq indent-tabs-mode nil)
)

Expand Down
12 changes: 6 additions & 6 deletions haskell-checkers.el
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ name - user visible name for this mode"
;;;###autoload
(define-compilation-mode ,(intern (concat nm "-mode")) ,name
,(concat "Mode to check Haskell source code using " name)
(set (make-local-variable 'compilation-process-setup-function)
',(intern (concat nm "-process-setup")))
(set (make-local-variable 'compilation-disable-input) t)
(set (make-local-variable 'compilation-scroll-output) nil)
(set (make-local-variable 'compilation-finish-functions)
(list ',(intern (concat nm "-finish-hook")))))
(setq-local compilation-process-setup-function
',(intern (concat nm "-process-setup")))
(setq-local compilation-disable-input t)
(setq-local compilation-scroll-output nil)
(setq-local compilation-finish-functions
(list ',(intern (concat nm "-finish-hook")))))
;;;###autoload
(defun ,(intern nm) ()
,(concat "Run " name " for current buffer with haskell source")
Expand Down
4 changes: 2 additions & 2 deletions haskell-compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ format is supported, as well as info-locations within compile
messages pointing to additional source locations.

See Info node `(haskell-mode)compilation' for more details."
(set (make-local-variable 'compilation-error-regexp-alist)
haskell-compilation-error-regexp-alist)
(setq-local compilation-error-regexp-alist
haskell-compilation-error-regexp-alist)

(add-hook 'compilation-filter-hook
'haskell-compilation-filter-hook nil t)
Expand Down
6 changes: 2 additions & 4 deletions haskell-decl-scan.el
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,8 @@ Invokes `haskell-decl-scan-mode-hook' on activation."
(local-set-key [menu-bar index] nil)))

(when haskell-decl-scan-mode
(set (make-local-variable 'beginning-of-defun-function)
'haskell-ds-backward-decl)
(set (make-local-variable 'end-of-defun-function)
'haskell-ds-forward-decl)
(setq-local beginning-of-defun-function 'haskell-ds-backward-decl)
(setq-local end-of-defun-function 'haskell-ds-forward-decl)
(haskell-ds-imenu)))


Expand Down
6 changes: 2 additions & 4 deletions haskell-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
:prefix "haskell-doc-")


(defvar haskell-doc-mode nil
(defvar-local haskell-doc-mode nil
"*If non-nil, show the type of the function near point or a related comment.

If the identifier near point is a Haskell keyword and the variable
Expand Down Expand Up @@ -343,17 +343,15 @@ in the alist `haskell-doc-user-defined-ids' and the variable
`haskell-doc-show-user-defined' is non-nil show the type of the function.

This variable is buffer-local.")
(make-variable-buffer-local 'haskell-doc-mode)

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

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

(defcustom haskell-doc-show-global-types nil
"If non-nil, search for the types of global functions by loading the files.
Expand Down
16 changes: 8 additions & 8 deletions haskell-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,14 @@ like ::, class, instance, data, newtype, type."

(defun haskell-font-lock-defaults-create ()
"Locally set `font-lock-defaults' for Haskell."
(set (make-local-variable 'font-lock-defaults)
'((haskell-font-lock-keywords)
nil nil nil nil
(font-lock-syntactic-face-function
. haskell-syntactic-face-function)
;; Get help from font-lock-syntactic-keywords.
(parse-sexp-lookup-properties . t)
(font-lock-extra-managed-props . (composition)))))
(setq-local font-lock-defaults
'((haskell-font-lock-keywords)
nil nil nil nil
(font-lock-syntactic-face-function
. haskell-syntactic-face-function)
;; Get help from font-lock-syntactic-keywords.
(parse-sexp-lookup-properties . t)
(font-lock-extra-managed-props . (composition)))))

(defun haskell-fontify-as-mode (text mode)
"Fontify TEXT as MODE, returning the fontified text."
Expand Down
7 changes: 3 additions & 4 deletions haskell-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -1489,9 +1489,8 @@ One indentation cycle is used."

;;; haskell-indent-mode

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

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

(set (make-local-variable 'indent-line-function) 'haskell-indent-cycle)
(set (make-local-variable 'indent-region-function) 'haskell-indent-region)
(setq-local indent-line-function 'haskell-indent-cycle)
(setq-local indent-region-function 'haskell-indent-region)
(setq haskell-indent-mode t)
;; Activate our keymap.
(let ((map (current-local-map)))
Expand Down
6 changes: 2 additions & 4 deletions haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ set and deleted as if they were real tabs."
(when (and (bound-and-true-p haskell-simple-indent-mode)
(fboundp 'haskell-simple-indent-mode))
(haskell-simple-indent-mode 0))
(set (make-local-variable 'indent-line-function)
'haskell-indentation-indent-line)
(set (make-local-variable 'indent-region-function)
'haskell-indentation-indent-region)))
(setq-local indent-line-function 'haskell-indentation-indent-line)
(setq-local indent-region-function 'haskell-indentation-indent-region)))

;;;###autoload
(defun turn-on-haskell-indentation ()
Expand Down
19 changes: 6 additions & 13 deletions haskell-interactive-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,12 @@
(require 'cl-lib)
(require 'etags)

(defvar haskell-interactive-mode-history-index)
(make-variable-buffer-local 'haskell-interactive-mode-history-index)
(defvar-local haskell-interactive-mode-history-index 0)

(defvar haskell-interactive-mode-history (list))
(make-variable-buffer-local 'haskell-interactive-mode-history)
(defvar-local haskell-interactive-mode-history (list))

(defvar haskell-interactive-mode-old-prompt-start
nil
(defvar-local haskell-interactive-mode-old-prompt-start nil
"Mark used for the old beginning of the prompt.")
(make-variable-buffer-local 'haskell-interactive-mode-old-prompt-start)

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

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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hooks
Expand Down Expand Up @@ -327,8 +322,7 @@ SESSION, otherwise operate on the current buffer."
(insert (substring prompt 0 1)
(propertize (substring prompt 1)
'front-sticky t)))
(let ((marker (set (make-local-variable 'haskell-interactive-mode-prompt-start)
(make-marker))))
(let ((marker (setq-local haskell-interactive-mode-prompt-start (make-marker))))
(set-marker marker (point)))
(when haskell-interactive-mode-scroll-to-bottom
(haskell-interactive-mode-scroll-to-bottom))))
Expand All @@ -346,8 +340,7 @@ SESSION, otherwise operate on the current buffer."
'rear-nonsticky t
'result t)))
(haskell-interactive-mode-handle-h)
(let ((marker (set (make-local-variable 'haskell-interactive-mode-result-end)
(make-marker))))
(let ((marker (setq-local haskell-interactive-mode-result-end (make-marker))))
(set-marker marker
(point)
(current-buffer)))
Expand Down
3 changes: 1 addition & 2 deletions haskell-menu.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
Each line describes one session.
Letters do not insert themselves; instead, they are commands."
(setq buffer-read-only t)
(set (make-local-variable 'revert-buffer-function)
'haskell-menu-revert-function)
(setq-local revert-buffer-function 'haskell-menu-revert-function)
(setq truncate-lines t)
(haskell-menu-revert-function nil t))

Expand Down
2 changes: 1 addition & 1 deletion haskell-mode-pkg.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(define-package "haskell-mode" "16.1-git" "A Haskell editing mode"
'((emacs "24.1") (cl-lib "0.5"))
'((emacs "24.3"))
:url "https://github.com/haskell/haskell-mode"
:keywords '("haskell" "cabal" "ghc" "repl"))
;; Local Variables:
Expand Down
Loading