emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help with defmacro


From: Lennart Borgman (gmail)
Subject: Need help with defmacro
Date: Thu, 31 Jan 2008 00:58:41 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

When I try to do instrument my-test-err4 below for edebug with

   C-u C-M-x

I get an error saying

    edebug-syntax-error: Invalid read syntax: "Expected", (&rest
        &or (symbolp &optional form) symbolp)

Can someone please explain to me what I have done wrong here?


(defvar mumamo-use-condition-case nil)
(make-variable-buffer-local 'mumamo-use-condition-case)
(put 'mumamo-use-condition-case 'permanent-local t)

(defvar mumamo-debugger 'mumamo-debug-to-backtrace)
(make-variable-buffer-local 'mumamo-debugger)
(put 'mumamo-debugger 'permanent-local t)

(defmacro mumamo-condition-case (var body-form &rest handlers)
  "Like `condition-case', but optional.
If `mumamo-use-condition-case' is nil then just evaluate
BODY. Otherwise do the same thing as

  (condition-case VAR
      BODY
    HANDLERS)."
  (declare (indent 2) (debug let))
  `(if (not mumamo-use-condition-case)
       (let* ((debugger mumamo-debugger)
              (debug-on-error (if debugger t debug-on-error)))
         ,body-form)
    (condition-case ,var
        ,body-form
      ,@handlers)))

(defun my-test-err4 ()
  (interactive)
  (mumamo-condition-case err
      (my-errx)
    (arith-error (message "here"))
    (error (message "%s, %s" err (error-message-string err)))
    ))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]