Path: utzoo!attcan!uunet!bu.edu!rpi!zaphod.mps.ohio-state.edu!ncar!gatech!uflorida!ufqtp!beck From: beck@qtp.ufl.edu (Sullivan Beck) Newsgroups: comp.emacs Subject: Problem with macros Message-ID: <1183@red15.qtp.ufl.edu> Date: 13 Nov 90 21:51:07 GMT Reply-To: beck@qtp.ufl.edu (Sullivan Beck) Organization: University of Florida Quantum Theory Project Lines: 52 I am trying to learn how to use macros but am having some problems with the 'quote' command, mainly with trying to pass arguments to the macro. For example, here's a simple function which will insert a character in a buffer: (defun test (char) (save-excursion (set-buffer (get-buffer tmp-buffer)) (save-excursion (goto-char 1) (forward-line 2) (forward-char 3) (delete-char 1) (insert char)))) which works as expected. I can switch it to a macro using the list command repeatedly: (defmacro test (char) (list 'save-excursion (list 'set-buffer (list 'get-buffer 'tmp-buffer)) (list 'save-excursion (list 'goto-char 1) (list 'forward-line 2) (list 'forward-char 3) (list 'delete-char 1) (list 'insert char)))) but I cannot get the quote (which I'd greatly prefer of course) to work. Here's what I've got: (defmacro test (char) (` (save-excursion (set-buffer (get-buffer tmp-buffer)) (save-excursion (goto-char 1) (forward-line 2) (forward-char 3) (delete-char 1) (insert char))))) But this doesn't work. If I have the following lines in a program: (setq char "*") (test "!") the first two will insert the "!" but the third will insert a "*". Could someone explain what I am doing wrong (other than I don't really understand how to use the quote). Thanks in advance. S. Beck beck@qtp.ufl.edu