names icon indicating copy to clipboard operation
names copied to clipboard

Problem with the namespace references when wrapped in macro calls.

Open ahungry opened this issue 6 years ago • 1 comments

         (eval-when-compile (require 'names))

         ;;;###autoload                                                                                                                                                  
         (define-namespace names-test-

         (defvar -a 5 "The names-test--a variable.")

         (defmacro freeze-ui (&rest body)
           "Basically, lock up the UI, then run BODY."
           `(save-excursion
              (save-restriction
                (save-window-excursion
                  ,@body))))

         (defun print-a ()
           (interactive)
           (freeze-ui (print -a)))
         
         )

Results in:

Symbol’s value as variable is void: -a

I saw the note about quoted/unquoted, however in this sample, it's the body being passed to the defmacro that is failing to evaluate.

Is there a workaround for this scenario? So that I do not have to do (print names-test--a) in the print-a defun? (this is a minimalist example for a real use case I'm hitting).

ahungry avatar Aug 05 '18 02:08 ahungry