Function: eww-read-alternate-url

eww-read-alternate-url is a byte-compiled function defined in eww.el.gz.

Signature

(eww-read-alternate-url)

Documentation

Get the URL of an alternate link of this page.

If there is just one alternate link, return its URL. If there are multiple alternate links, prompt for one in the minibuffer with completion. If there are none, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
(defun eww-read-alternate-url ()
  "Get the URL of an alternate link of this page.

If there is just one alternate link, return its URL.  If there
are multiple alternate links, prompt for one in the minibuffer
with completion.  If there are none, return nil."
  (when-let* ((alts (eww--alternate-urls (plist-get eww-data :dom)
                                         (plist-get eww-data :url))))
    (if (cdr alts)
        ;; Multiple alternate links, prompt the user to select one.
        (completing-read
         "Alternate URL: "
         (completion-table-with-metadata
          alts `((affixation-function . eww--alternate-urls-affixation)))
         nil t)
      ;; Just one alternate link, return it without prompting.
      (car alts))))