Skip to content

Update emacs-snapshot source to ppa:ubuntu-elisp/ppa. #477

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 4 commits into from
Feb 28, 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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ install:
sudo apt-get install -qq emacs24 emacs24-el;
fi
- if [ "$EMACS" = "emacs-snapshot" ]; then
sudo add-apt-repository -y ppa:cassou/emacs &&
sudo add-apt-repository -y ppa:ubuntu-elisp/ppa &&
sudo apt-get update -qq &&
sudo apt-get install -qq emacs-snapshot &&
sudo apt-get install -qq emacs-snapshot-el emacs-snapshot-gtk;
sudo apt-get install -qq emacs-snapshot-el;
fi

script:
Expand Down
18 changes: 11 additions & 7 deletions haskell-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
;;; Code:

(require 'cl-lib)
(require 'etags)
(require 'haskell-compat)
(require 'haskell-process)
(require 'haskell-font-lock)
(require 'haskell-interactive-mode)
Expand Down Expand Up @@ -310,19 +312,21 @@ jump to the tag.
Remember: If GHCi is busy doing something, this will delay, but
it will always be accurate, in contrast to tags, which always
work but are not always accurate.

If the definition or tag is found, the location from which you
jumped will be pushed onto `find-tag-marker-ring', so you can
return to that position with `pop-tag-mark'."
If the definition or tag is found, the location from which you jumped
will be pushed onto `xref--marker-ring', so you can return to that
position with `xref-pop-marker-stack'."
(interactive "P")
(let ((initial-loc (point-marker))
(loc (haskell-mode-find-def (haskell-ident-at-point))))
(if loc
(haskell-mode-handle-generic-loc loc)
(call-interactively 'haskell-mode-tag-find))
(unless (equal initial-loc (point-marker))
;; Store position for return with `pop-tag-mark'
(ring-insert find-tag-marker-ring initial-loc))))
(save-excursion
(goto-char initial-loc)
(set-mark-command nil)
;; Store position for return with `xref-pop-marker-stack'
(xref-push-marker-stack)))))

;;;###autoload
(defun haskell-mode-goto-loc ()
Expand All @@ -336,7 +340,7 @@ command from GHCi."
(defun haskell-mode-goto-span (span)
"Jump to the span, whatever file and line and column it needs
to to get there."
(ring-insert find-tag-marker-ring (point-marker))
(xref-push-marker-stack)
(find-file (expand-file-name (plist-get span :path)
(haskell-session-cabal-dir (haskell-interactive-session))))
(goto-char (point-min))
Expand Down
30 changes: 29 additions & 1 deletion haskell-compat.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
;;; Commentary:

;;; Code:
(require 'etags)
(require 'ring)
(require 'outline)
(require 'xref nil t)

(eval-when-compile
(setq byte-compile-warnings '(not cl-functions obsolete)))

;; Missing in Emacs23, stolen from Emacs24's `subr.el'
(unless (fboundp 'process-live-p)
Expand All @@ -29,7 +36,28 @@
A process is considered alive if its status is `run', `open',
`listen', `connect' or `stop'."
(memq (process-status process)
'(run open listen connect stop))))
'(run open listen connect stop))))

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

(defun xref-push-marker-stack ()
"Add point to the marker stack."
(ring-insert find-tag-marker-ring (point-marker))))

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

(unless (fboundp 'outline-show-subtree)
(defalias 'outline-show-subtree 'show-subtree))

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

(unless (fboundp 'outline-show-subtree)
(defalias 'outline-show-subtree 'show-subtree))

(provide 'haskell-compat)

Expand Down
4 changes: 2 additions & 2 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ When MESSAGE is non-nil, display a message with the version."
(interactive)
(with-current-buffer (find-file-read-only (expand-file-name "NEWS" haskell-mode-pkg-base-dir))
(goto-char (point-min))
(hide-sublevels 1)
(outline-hide-sublevels 1)
(outline-next-visible-heading 1)
(show-subtree)))
(outline-show-subtree)))

;; Are we looking at a literate script?
(defvar haskell-literate nil
Expand Down
4 changes: 3 additions & 1 deletion inf-haskell.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

(require 'comint)
(require 'shell) ; For directory tracking.
(require 'etags)
(require 'haskell-compat)
(require 'compile)
(require 'haskell-mode)
(require 'haskell-decl-scan)
Expand Down Expand Up @@ -568,7 +570,7 @@ The returned info is cached for reuse by `haskell-doc-mode'."
(setq file (expand-file-name file)))
;; Push current location marker on the ring used by `find-tag'
(require 'etags)
(ring-insert find-tag-marker-ring (point-marker))
(xref-push-marker-stack)
(pop-to-buffer (find-file-noselect file))
(when line
(goto-char (point-min))
Expand Down
3 changes: 3 additions & 0 deletions tests/haskell-indent-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
(ert-deftest haskell-indent-in-comment-1 ()
"Document bad behavior. Should not assert."
:expected-result :failed
;; Emacs 25 (snapshot) starts debugger on cl-assert
;; even in batch mode. So we do not run this test.
(skip-unless (< emacs-major-version 25))
(should (with-temp-buffer
(haskell-mode)
(haskell-indent-mode)
Expand Down