I have a question about macros. When I call a macro with an argument, I call a function with it. It works. But if I add another instruction below, the backquoted instruction is not executed.
Here is the dummy example:
(setq words '()) (defun func-test (name) "Function test." (message "Function called with %s" name) (add-to-list 'words name)) (defmacro macro-test (name) "Macro test." (message "Before ...") (unless (member name words) `(func-test ,name)) ;;;; /!\ Bug: if I uncomment this next line, it does not work anymore ;;(message "... After") ) (macro-test 'hello) (message "%S" words) ;; Should be (hello) (macro-test 'thanks) (message "%S" words) ;; Should be (thanks hello) (macro-test 'bye) (message "%S" words) ;; Should be (bye thanks hello)
Do you have any idea or tip to deal with it?
Bonus question: can I use several backquoted instructions in this macro or is there a specific form to use it? E.g. if I want to call several functions from my macro.