From 29f590c3b747af84a2acfbac18f0ae167141ca00 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Fri, 23 Jan 2015 15:56:36 +0100 Subject: [PATCH 1/3] Use setq instead of setf. --- haskell-checkers.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/haskell-checkers.el b/haskell-checkers.el index 3f8cdf2b2..4276920c6 100644 --- a/haskell-checkers.el +++ b/haskell-checkers.el @@ -104,19 +104,19 @@ (goto-char (point-min)) (forward-line (1- fline)) (beginning-of-line) - (setf bline (point)) + (setq bline (point)) (when (or hs-checkers-replace-without-ask (yes-or-no-p msg)) (end-of-line) - (setf eline (point)) + (setq eline (point)) (beginning-of-line) - (setf old-code (regexp-quote old-code)) + (setq old-code (regexp-quote old-code)) (while (string-match "\\\\ " old-code spos) - (setf new-old-code (concat new-old-code + (setq new-old-code (concat new-old-code (substring old-code spos (match-beginning 0)) "\\ *")) - (setf spos (match-end 0))) - (setf new-old-code (concat new-old-code (substring old-code spos))) + (setq spos (match-end 0))) + (setq new-old-code (concat new-old-code (substring old-code spos))) (remove-text-properties bline eline '(composition nil)) (when (re-search-forward new-old-code eline t) (replace-match new-code nil t))))))) From d510066e2d739197fee409d58ceb5b5a26722283 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Fri, 23 Jan 2015 15:58:03 +0100 Subject: [PATCH 2/3] Define process-live-p for Emacs-23. --- haskell-process.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/haskell-process.el b/haskell-process.el index fb953ce3c..8dafa9d39 100644 --- a/haskell-process.el +++ b/haskell-process.el @@ -217,6 +217,19 @@ the response." (haskell-process-send-string (car state) (cdr state)))))) +(eval-when-compile + ;; Emacs23 does not have process-live-p. That is easy to define. + (unless (fboundp 'process-live-p) + (defun process-live-p (process) + "Returns non-nil if PROCESS is alive. +A process is considered alive if its status is `run', `open', +`listen', `connect' or `stop'. Value is nil if PROCESS is not a +process." + (and (processp process) + (memq (process-status process) + '(run open listen connect stop)))))) + + (defun haskell-process-queue-command (process command) "Add a command to the process command queue." (haskell-process-cmd-queue-add process command) From d1019bb1c143c55707f97084c6b2487a77a5c61a Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Fri, 23 Jan 2015 15:58:29 +0100 Subject: [PATCH 3/3] Enable warnings under Emacs-23. Enable all warning except cl-function ones under Emacs-23. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bf8c6bae1..7cde5d1b9 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,9 @@ GIT_VERSION = $(shell git describe --tags --match 'v[0-9]*' --long --dirty | sed INSTALL_INFO = install-info EMACS = emacs EFLAGS = --eval "(if (< emacs-major-version 24) \ - (add-to-list 'load-path (expand-file-name \"tests/compat\")) \ - (setq byte-compile-error-on-warn t))" + (progn (add-to-list 'load-path (expand-file-name \"tests/compat\")) \ + (setq byte-compile-warnings '(not cl-functions))))" \ + --eval '(setq byte-compile-error-on-warn t)' BATCH = $(EMACS) $(EFLAGS) --batch -Q -L . SUBST_ATAT = sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g;s/@GIT_VERSION@/$(GIT_VERSION)/g;s/@@VERSION@@/$(VERSION)/g;s/@VERSION@/$(VERSION)/g'