Skip to content

Commit 2b90202

Browse files
committed
Merge pull request #449 from gracjan/pr-better-emacs23
Better Emacs23 support with warnings and errors
2 parents 4619c5e + d1019bb commit 2b90202

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ GIT_VERSION = $(shell git describe --tags --match 'v[0-9]*' --long --dirty | sed
44
INSTALL_INFO = install-info
55
EMACS = emacs
66
EFLAGS = --eval "(if (< emacs-major-version 24) \
7-
(add-to-list 'load-path (expand-file-name \"tests/compat\")) \
8-
(setq byte-compile-error-on-warn t))"
7+
(progn (add-to-list 'load-path (expand-file-name \"tests/compat\")) \
8+
(setq byte-compile-warnings '(not cl-functions))))" \
9+
--eval '(setq byte-compile-error-on-warn t)'
910

1011
BATCH = $(EMACS) $(EFLAGS) --batch -Q -L .
1112
SUBST_ATAT = sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g;s/@GIT_VERSION@/$(GIT_VERSION)/g;s/@@VERSION@@/$(VERSION)/g;s/@VERSION@/$(VERSION)/g'

haskell-checkers.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,19 @@
104104
(goto-char (point-min))
105105
(forward-line (1- fline))
106106
(beginning-of-line)
107-
(setf bline (point))
107+
(setq bline (point))
108108
(when (or hs-checkers-replace-without-ask
109109
(yes-or-no-p msg))
110110
(end-of-line)
111-
(setf eline (point))
111+
(setq eline (point))
112112
(beginning-of-line)
113-
(setf old-code (regexp-quote old-code))
113+
(setq old-code (regexp-quote old-code))
114114
(while (string-match "\\\\ " old-code spos)
115-
(setf new-old-code (concat new-old-code
115+
(setq new-old-code (concat new-old-code
116116
(substring old-code spos (match-beginning 0))
117117
"\\ *"))
118-
(setf spos (match-end 0)))
119-
(setf new-old-code (concat new-old-code (substring old-code spos)))
118+
(setq spos (match-end 0)))
119+
(setq new-old-code (concat new-old-code (substring old-code spos)))
120120
(remove-text-properties bline eline '(composition nil))
121121
(when (re-search-forward new-old-code eline t)
122122
(replace-match new-code nil t)))))))

haskell-process.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,19 @@ the response."
217217
(haskell-process-send-string (car state)
218218
(cdr state))))))
219219

220+
(eval-when-compile
221+
;; Emacs23 does not have process-live-p. That is easy to define.
222+
(unless (fboundp 'process-live-p)
223+
(defun process-live-p (process)
224+
"Returns non-nil if PROCESS is alive.
225+
A process is considered alive if its status is `run', `open',
226+
`listen', `connect' or `stop'. Value is nil if PROCESS is not a
227+
process."
228+
(and (processp process)
229+
(memq (process-status process)
230+
'(run open listen connect stop))))))
231+
232+
220233
(defun haskell-process-queue-command (process command)
221234
"Add a command to the process command queue."
222235
(haskell-process-cmd-queue-add process command)

0 commit comments

Comments
 (0)