Skip to content

Instantly share code, notes, and snippets.

@thomp
Created February 8, 2022 22:15
Show Gist options
  • Save thomp/87d3cebf31778cde37b5f7720ef5b96e to your computer and use it in GitHub Desktop.
Save thomp/87d3cebf31778cde37b5f7720ef5b96e to your computer and use it in GitHub Desktop.
Grab file URL corresponding to file at point in Dired
(defun dat-url-of-dired-file ()
"Add to the kill ring the URL for tthe file named at the current Dired point."
(interactive)
(let ((tem (dired-get-filename t t)))
(if tem
; (message "file: %s"
(kill-new
(concatenate 'string "file://"
(expand-file-name tem)))
(error "No file on this line"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment