fix(lib): void-function macroexp-file-name error
This function was introduced in Emacs 28.1, so7e0c2ed
was a breaking change for 27.x users. Fix: #6766 Amend:7e0c2ed8a3
This commit is contained in:
parent
7e931ec586
commit
eb80d461df
1 changed files with 8 additions and 4 deletions
|
@ -245,10 +245,14 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
|
|||
|
||||
(defmacro file! ()
|
||||
"Return the file of the file this macro was called."
|
||||
(or (macroexp-file-name)
|
||||
load-file-name
|
||||
buffer-file-name ; for `eval'
|
||||
(error "file!: cannot deduce the current file path")))
|
||||
(or
|
||||
;; REVIEW: Use `macroexp-file-name' once 27 support is dropped.
|
||||
(let ((file (car (last current-load-list))))
|
||||
(if (stringp file) file))
|
||||
(bound-and-true-p byte-compile-current-file)
|
||||
load-file-name
|
||||
buffer-file-name ; for `eval'
|
||||
(error "file!: cannot deduce the current file path")))
|
||||
|
||||
(defmacro dir! ()
|
||||
"Return the directory of the file this macro was called."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue