Skip to content

'find-tag-marker-ring' is an obsolete variable (as of 25.1) #459

Closed
@vonavi

Description

@vonavi

Hi guys!

Once Haskell mode was compiling, I got error

'find-tag-marker-ring' is an obsolete variable (as of 25.1); use 'xref-push-marker-stack' or 'xref-pop-marker-stack' instead.

So, I prepared the following patches to fix the issue:

--- haskell-commands.el 2015-02-06 21:26:36.000000000 +0300
+++ haskell-commands-patched.el 2015-02-06 21:56:57.000000000 +0300
@@ -18,6 +18,7 @@
 ;;; Code:

 (require 'cl-lib)
+(require 'xref)
 (require 'haskell-process)
 (require 'haskell-font-lock)
 (require 'haskell-interactive-mode)
@@ -355,9 +356,9 @@
 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))))
@@ -365,8 +366,11 @@
         (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 ()
@@ -380,7 +384,7 @@
 (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))
--- inf-haskell.el  2015-02-06 22:12:08.000000000 +0300
+++ inf-haskell-patched.el  2015-02-06 22:16:06.000000000 +0300
@@ -33,6 +33,7 @@
 (require 'comint)
 (require 'shell)             ; For directory tracking.
 (require 'compile)
+(require 'xref)
 (require 'haskell-mode)
 (require 'haskell-decl-scan)
 (require 'haskell-cabal)
@@ -568,7 +569,7 @@
             (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))

These patches should work in principle. Maybe you will find a more suitable place for (require 'xref).

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions