Function: ghostel--goto-hyperlink

ghostel--goto-hyperlink is a natively compiled function defined in ghostel-links.el.

Signature

(ghostel--goto-hyperlink DIRECTION)

Documentation

Jump to the next/previous hyperlink. DIRECTION is next or previous.

Wraps around when no link is found in the requested direction. Signals user-error if the buffer has no hyperlinks at all.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-links.el
(defun ghostel--goto-hyperlink (direction)
  "Jump to the next/previous hyperlink.  DIRECTION is `next' or `previous'.
Wraps around when no link is found in the requested direction.
Signals `user-error' if the buffer has no hyperlinks at all."
  (let* ((search (if (eq direction 'next)
                     #'ghostel--find-next-link
                   #'ghostel--find-previous-link))
         (target (funcall search (point))))
    (unless target
      (let ((wrap-from (if (eq direction 'next) (point-min) (point-max))))
        (setq target (funcall search wrap-from))
        (when target (message "Wrapped"))))
    (if target
        (goto-char target)
      (user-error "No hyperlinks in buffer"))))