diff --git a/haskell-commands.el b/haskell-commands.el index 052f89e86..553d738d0 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -364,12 +364,7 @@ position with `xref-pop-marker-stack'." (haskell-mode-handle-generic-loc loc) (call-interactively 'haskell-mode-tag-find)) (unless (equal initial-loc (point-marker)) - (with-current-buffer (marker-buffer 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)))))) + (xref-push-marker-stack initial-loc)))) ;;;###autoload (defun haskell-mode-goto-loc () diff --git a/haskell-compat.el b/haskell-compat.el index f83985458..b08254325 100644 --- a/haskell-compat.el +++ b/haskell-compat.el @@ -43,9 +43,9 @@ A process is considered alive if its status is `run', `open', (unless (fboundp 'xref-push-marker-stack) (defalias 'xref-pop-marker-stack 'pop-tag-mark) - (defun xref-push-marker-stack () + (defun xref-push-marker-stack (&optional m) "Add point to the marker stack." - (ring-insert find-tag-marker-ring (point-marker)))) + (ring-insert find-tag-marker-ring (or m (point-marker))))) (unless (fboundp 'outline-hide-sublevels) (defalias 'outline-hide-sublevels 'hide-sublevels))