   ;; Add-function doesn't work on 'eldoc-documentation-function in Emacs < 25,
   ;; due to the default value being nil instead of `ignore'.
   (setq-local eldoc-documentation-function #'fstar--eldoc-function)
-  (advice-add 'eldoc-message :around #'fstar--eldoc-truncate-message)
+  (when (fboundp 'advice-add)
+    (advice-add 'eldoc-message :around #'fstar--eldoc-truncate-message))
   (eldoc-mode))
 
 (defun fstar-teardown-eldoc ()
   "Tear down eldoc support."
-  (kill-local-variable 'eldoc-documentation-function))
+  (kill-local-variable 'eldoc-documentation-function)
+  (when (fboundp 'advice-remove)
+    (advice-remove 'eldoc-message #'fstar--eldoc-truncate-message)))
 
 ;;;; xref-like features
 

            (find-file target-fname))
          (fstar--goto target-row target-col)
          (recenter)
          (pulse-momentary-highlight-one-line (point))))
    (message "No definition found")))

(defun fstar-jump-to-definition ()

    `(,(propertize " " 'display '(space :align-to 0)) ;; 'face 'fringe
      ,(propertize "Legend: " 'face nil)
      ,(mapconcat
        (lambda (label-face)
          (propertize (concat "​" sp "​" (car label-face) "​" sp "​")
                      'face (cdr label-face)))
        `(("pending" . (fstar-subp-overlay-pending-face))
          ("busy" . (fstar-subp-overlay-busy-face))
          ("processed" . (fstar-subp-overlay-processed-face))
