minibuffer

How to convert a filename into an absolute filename in Emacs Lisp?

October 09, 2023
(expand-file-name "~/minibuffer/notes.el") ;; "/home/tony/minibuffer/notes.el"
(expand-file-name "./notes.el") ;; "/home/tony/minibuffer/notes.el"
default-directory ;; "/home/tony/minibuffer/"

(expand-file-name "./notes.el" "/tmp/foo/bar/") ;; "/tmp/foo/bar/notes.el"

(let ((default-directory "/tmp/"))
  (expand-file-name "./notes.el"))
;; "/tmp/notes.el"