names
names copied to clipboard
Question about using namespace across multiple files?
If a namespace
is split across multiple files (or even re-opening the namespace
in the same file), is there a way to cause function names embedded inside a backquote
to be namespace
-ed? As an example, is there a way to write bmacro
below other than fully specifying the function afunc
?
(require 'names-dev)
(require 'names)
;; In file a.el
(define-namespace foo-bar-- :global
(defun afunc ()
(message "foo-bar--afunc called"))
(afunc) ; afunc called
(defun cfunc ()
`(afunc))
(cfunc)
)
(provide 'foo-bar)
;; In file b.el
(define-namespace foo-bar-- :global
(defun bfunc ()
(afunc))
(defmacro bmacro ()
`(afunc))
(defmacro cmacro ()
`(foo-bar--afunc))
(afunc) ; afunc called
(bfunc) ; afunc called
(bmacro) ; (void function afunc)
(cmacro) ; afunc called
)