Skip to content

Commit 45a3f88

Browse files
committed
Merge pull request #1103 from gracjan/pr-haskell-compat
Cleanup haskell-compat.el
2 parents 371c87d + f1f8e7f commit 45a3f88

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@ check-%: tests/%-tests.el
109109
$(BATCH) -l "$<" -f ert-run-tests-batch-and-exit;
110110

111111
check: $(ELCHECKS) build-$(EMACS_VERSION)
112-
$(BATCH) --eval "(when (>= emacs-major-version 24) \
113-
(require 'undercover) \
114-
(undercover \"*.el\" (:exclude \"haskell-mode-pkg.el\")))" \
115-
-L tests \
116-
$(patsubst %,-l %,$(ELCHECKS)) \
112+
$(BATCH) --eval "(when (>= emacs-major-version 24) \
113+
(require 'undercover) \
114+
(undercover \"*.el\" \
115+
(:exclude \"haskell-mode-pkg.el\" \"haskell-compat.el\")))" \
116+
-L tests \
117+
$(patsubst %,-l %,$(ELCHECKS)) \
117118
-f ert-run-tests-batch-and-exit
118119
@TAB=$$(echo "\t"); \
119120
if grep -Hn "[ $${TAB}]\+\$$" *.el; then \

haskell-commands.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ position with `xref-pop-marker-stack'."
355355
(haskell-mode-handle-generic-loc loc)
356356
(call-interactively 'haskell-mode-tag-find))
357357
(unless (equal initial-loc (point-marker))
358-
(xref-push-marker-stack initial-loc))))
358+
(save-excursion
359+
(goto-char initial-loc)
360+
(xref-push-marker-stack)))))
359361

360362
;;;###autoload
361363
(defun haskell-mode-goto-loc ()

haskell-compat.el

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,15 @@
2929
(eval-when-compile
3030
(setq byte-compile-warnings '(not cl-functions obsolete)))
3131

32-
;; Missing in Emacs23, stolen from Emacs24's `subr.el'
33-
(unless (fboundp 'process-live-p)
34-
(defun process-live-p (process)
35-
"Returns non-nil if PROCESS is alive.
36-
A process is considered alive if its status is `run', `open',
37-
`listen', `connect' or `stop'."
38-
(memq (process-status process)
39-
'(run open listen connect stop))))
4032

4133
;; Cross-referencing commands have been replaced since Emacs 25.1.
4234
;; These aliases are required to provide backward compatibility.
4335
(unless (fboundp 'xref-push-marker-stack)
4436
(defalias 'xref-pop-marker-stack 'pop-tag-mark)
4537

46-
(defun xref-push-marker-stack (&optional m)
38+
(defun xref-push-marker-stack ()
4739
"Add point to the marker stack."
48-
(ring-insert find-tag-marker-ring (or m (point-marker)))))
40+
(ring-insert find-tag-marker-ring (point-marker))))
4941

5042
(unless (fboundp 'outline-hide-sublevels)
5143
(defalias 'outline-hide-sublevels 'hide-sublevels))

0 commit comments

Comments
 (0)