Skip to content

Better Emacs23 support with warnings and errors #449

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 3 commits into from
Jan 23, 2015
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
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 6 additions & 6 deletions haskell-checkers.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))))
Expand Down
13 changes: 13 additions & 0 deletions haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down