[Top][All Lists]

[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: Gecko/20071031 Thunderbird/ Mnenhy/

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
  (declare (indent 2) (debug let))
  `(if (not mumamo-use-condition-case)
       (let* ((debugger mumamo-debugger)
              (debug-on-error (if debugger t debug-on-error)))
    (condition-case ,var

(defun my-test-err4 ()
  (mumamo-condition-case err
    (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]