Skip to content

Commit 5c75b88

Browse files
committed
Merge pull request #477 from gracjan/pr-update-emacs-snapshot-source
Update emacs-snapshot source to ppa:ubuntu-elisp/ppa.
2 parents 78636c6 + 79e6a91 commit 5c75b88

File tree

6 files changed

+50
-13
lines changed

6 files changed

+50
-13
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ install:
2222
sudo apt-get install -qq emacs24 emacs24-el;
2323
fi
2424
- if [ "$EMACS" = "emacs-snapshot" ]; then
25-
sudo add-apt-repository -y ppa:cassou/emacs &&
25+
sudo add-apt-repository -y ppa:ubuntu-elisp/ppa &&
2626
sudo apt-get update -qq &&
2727
sudo apt-get install -qq emacs-snapshot &&
28-
sudo apt-get install -qq emacs-snapshot-el emacs-snapshot-gtk;
28+
sudo apt-get install -qq emacs-snapshot-el;
2929
fi
3030

3131
script:

haskell-commands.el

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
;;; Code:
1919

2020
(require 'cl-lib)
21+
(require 'etags)
22+
(require 'haskell-compat)
2123
(require 'haskell-process)
2224
(require 'haskell-font-lock)
2325
(require 'haskell-interactive-mode)
@@ -310,19 +312,21 @@ jump to the tag.
310312
Remember: If GHCi is busy doing something, this will delay, but
311313
it will always be accurate, in contrast to tags, which always
312314
work but are not always accurate.
313-
314-
If the definition or tag is found, the location from which you
315-
jumped will be pushed onto `find-tag-marker-ring', so you can
316-
return to that position with `pop-tag-mark'."
315+
If the definition or tag is found, the location from which you jumped
316+
will be pushed onto `xref--marker-ring', so you can return to that
317+
position with `xref-pop-marker-stack'."
317318
(interactive "P")
318319
(let ((initial-loc (point-marker))
319320
(loc (haskell-mode-find-def (haskell-ident-at-point))))
320321
(if loc
321322
(haskell-mode-handle-generic-loc loc)
322323
(call-interactively 'haskell-mode-tag-find))
323324
(unless (equal initial-loc (point-marker))
324-
;; Store position for return with `pop-tag-mark'
325-
(ring-insert find-tag-marker-ring initial-loc))))
325+
(save-excursion
326+
(goto-char initial-loc)
327+
(set-mark-command nil)
328+
;; Store position for return with `xref-pop-marker-stack'
329+
(xref-push-marker-stack)))))
326330

327331
;;;###autoload
328332
(defun haskell-mode-goto-loc ()
@@ -336,7 +340,7 @@ command from GHCi."
336340
(defun haskell-mode-goto-span (span)
337341
"Jump to the span, whatever file and line and column it needs
338342
to to get there."
339-
(ring-insert find-tag-marker-ring (point-marker))
343+
(xref-push-marker-stack)
340344
(find-file (expand-file-name (plist-get span :path)
341345
(haskell-session-cabal-dir (haskell-interactive-session))))
342346
(goto-char (point-min))

haskell-compat.el

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
;;; Commentary:
2222

2323
;;; Code:
24+
(require 'etags)
25+
(require 'ring)
26+
(require 'outline)
27+
(require 'xref nil t)
28+
29+
(eval-when-compile
30+
(setq byte-compile-warnings '(not cl-functions obsolete)))
2431

2532
;; Missing in Emacs23, stolen from Emacs24's `subr.el'
2633
(unless (fboundp 'process-live-p)
@@ -29,7 +36,28 @@
2936
A process is considered alive if its status is `run', `open',
3037
`listen', `connect' or `stop'."
3138
(memq (process-status process)
32-
'(run open listen connect stop))))
39+
'(run open listen connect stop))))
40+
41+
;; Cross-referencing commands have been replaced since Emacs 25.1.
42+
;; These aliases are required to provide backward compatibility.
43+
(unless (fboundp 'xref-push-marker-stack)
44+
(defalias 'xref-pop-marker-stack 'pop-tag-mark)
45+
46+
(defun xref-push-marker-stack ()
47+
"Add point to the marker stack."
48+
(ring-insert find-tag-marker-ring (point-marker))))
49+
50+
(unless (fboundp 'outline-hide-sublevels)
51+
(defalias 'outline-hide-sublevels 'hide-sublevels))
52+
53+
(unless (fboundp 'outline-show-subtree)
54+
(defalias 'outline-show-subtree 'show-subtree))
55+
56+
(unless (fboundp 'outline-hide-sublevels)
57+
(defalias 'outline-hide-sublevels 'hide-sublevels))
58+
59+
(unless (fboundp 'outline-show-subtree)
60+
(defalias 'outline-show-subtree 'show-subtree))
3361

3462
(provide 'haskell-compat)
3563

haskell-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ When MESSAGE is non-nil, display a message with the version."
171171
(interactive)
172172
(with-current-buffer (find-file-read-only (expand-file-name "NEWS" haskell-mode-pkg-base-dir))
173173
(goto-char (point-min))
174-
(hide-sublevels 1)
174+
(outline-hide-sublevels 1)
175175
(outline-next-visible-heading 1)
176-
(show-subtree)))
176+
(outline-show-subtree)))
177177

178178
;; Are we looking at a literate script?
179179
(defvar haskell-literate nil

inf-haskell.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
(require 'comint)
3434
(require 'shell) ; For directory tracking.
35+
(require 'etags)
36+
(require 'haskell-compat)
3537
(require 'compile)
3638
(require 'haskell-mode)
3739
(require 'haskell-decl-scan)
@@ -568,7 +570,7 @@ The returned info is cached for reuse by `haskell-doc-mode'."
568570
(setq file (expand-file-name file)))
569571
;; Push current location marker on the ring used by `find-tag'
570572
(require 'etags)
571-
(ring-insert find-tag-marker-ring (point-marker))
573+
(xref-push-marker-stack)
572574
(pop-to-buffer (find-file-noselect file))
573575
(when line
574576
(goto-char (point-min))

tests/haskell-indent-tests.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
(ert-deftest haskell-indent-in-comment-1 ()
77
"Document bad behavior. Should not assert."
88
:expected-result :failed
9+
;; Emacs 25 (snapshot) starts debugger on cl-assert
10+
;; even in batch mode. So we do not run this test.
11+
(skip-unless (< emacs-major-version 25))
912
(should (with-temp-buffer
1013
(haskell-mode)
1114
(haskell-indent-mode)

0 commit comments

Comments
 (0)