Function: shr-copy-url

shr-copy-url is an interactive and byte-compiled function defined in shr.el.gz.

Signature

(shr-copy-url URL)

Documentation

Copy the URL under point to the kill ring.

With a prefix argument, or if there is no link under point, but there is an image under point then copy the URL of the image under point instead.

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr-copy-url (url)
  "Copy the URL under point to the kill ring.
With a prefix argument, or if there is no link under point, but
there is an image under point then copy the URL of the image
under point instead."
  (interactive (list (shr-url-at-point current-prefix-arg)))
  (if (not url)
      (message "No URL under point")
    (setq url (url-encode-url url))
    (kill-new url)
    (message "Copied %s" url)))