浏览代码

Backwards compatibility: don't defalias special forms

* lisp/org-compat.el (org-condition-case-unless-debug): Do not use
  defalias for special forms, the Emacs 22 byte-compiler does not
  recognize them correctly when compiling macros.  Use a macro instead
  and rely on macro expansion.  That however makes the decision at
  compile time, which should be acceptable in this case since it only
  affects debugging.
Achim Gratz 12 年之前
父节点
当前提交
b63275350f
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      lisp/org-compat.el

+ 5 - 4
lisp/org-compat.el

@@ -448,12 +448,13 @@ With two arguments, return floor and remainder of their quotient."
 
 
 ;; `condition-case-unless-debug' has been introduced in Emacs 24.1
 ;; `condition-case-unless-debug' has been introduced in Emacs 24.1
 ;; `condition-case-no-debug' has been introduced in Emacs 23.1
 ;; `condition-case-no-debug' has been introduced in Emacs 23.1
-(defalias 'org-condition-case-unless-debug
+(defmacro org-condition-case-unless-debug (var bodyform &rest handlers)
+  (declare (debug condition-case) (indent 2))
   (or (and (fboundp 'condition-case-unless-debug)
   (or (and (fboundp 'condition-case-unless-debug)
-	   'condition-case-unless-debug)
+	   `(condition-case-unless-debug ,var ,bodyform ,@handlers))
       (and (fboundp 'condition-case-no-debug)
       (and (fboundp 'condition-case-no-debug)
-	   'condition-case-no-debug)
-      'condition-case))
+	   `(condition-case-no-debug ,var ,bodyform ,@handlers))
+      `(condition-case ,var ,bodyform ,@handlers)))
 
 
 ;;;###autoload
 ;;;###autoload
 (defmacro org-check-version ()
 (defmacro org-check-version ()