浏览代码

Don't define debug-message functions as macros

I don't think it was actually preventing the evaluation of the
arguments.
Ryan C. Thompson 8 年之前
父节点
当前提交
119d7b19dc
共有 2 个文件被更改,包括 6 次插入10 次删除
  1. 3 5
      ido-completing-read+.el
  2. 3 5
      ido-ubiquitous.el

+ 3 - 5
ido-completing-read+.el

@@ -60,11 +60,9 @@ Debug info is printed to the *Messages* buffer."
   :global t
   :group 'ido-completing-read-plus)
 
-;; Defined as a macro for efficiency (args are not evaluated unless
-;; debug mode is on)
-(defmacro ido-cr+--debug-message (format-string &rest args)
-  `(when ido-cr+-debug-mode
-     (message (concat "ido-completing-read+: " ,format-string) ,@args)))
+(defun ido-cr+--debug-message (format-string &rest args)
+  (when ido-cr+-debug-mode
+    (apply #'message (concat "ido-completing-read+: " format-string) args)))
 
 ;;; Core code
 

+ 3 - 5
ido-ubiquitous.el

@@ -102,11 +102,9 @@ Debug info is printed to the *Messages* buffer."
   :global t
   :group 'ido-ubiquitous)
 
-;; Defined as a macro for efficiency (args are not evaluated unless
-;; debug mode is on)
-(defmacro ido-ubiquitous--debug-message (format-string &rest args)
-  `(when ido-ubiquitous-debug-mode
-     (message (concat "ido-ubiquitous: " ,format-string) ,@args)))
+(defun ido-ubiquitous--debug-message (format-string &rest args)
+  (when ido-ubiquitous-debug-mode
+     (apply #'message (concat "ido-ubiquitous: " format-string) args)))
 
 (defun ido-ubiquitous--explain-fallback (arg)
   ;; This function accepts a string, or an ido-ubiquitous-fallback