message.el (message-called-interactively-p): A temporary macro.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 25 Nov 2010 23:18:49 +0000 (23:18 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 25 Nov 2010 23:18:49 +0000 (23:18 +0000)
message.el (message-goto-body): Use it temporarily.

lisp/ChangeLog
lisp/message.el

index 2b84b11..83583b3 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * message.el (message-called-interactively-p): A temporary macro.
+       (message-goto-body): Use it temporarily.
+
 2010-11-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * nnimap.el (nnimap-unfold-quoted-lines): Refactor out.
index 1134b68..8a729f6 100644 (file)
@@ -3091,10 +3091,22 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
   (interactive)
   (message-position-on-field "Summary" "Subject"))
 
+(eval-when-compile
+  (defmacro message-called-interactively-p (kind)
+    (condition-case nil
+       (progn
+         (eval '(called-interactively-p 'any))
+         ;; Emacs >=23.2
+         `(called-interactively-p ,kind))
+      ;; Emacs <23.2
+      (wrong-number-of-arguments '(called-interactively-p))
+      ;; XEmacs
+      (void-function '(interactive-p)))))
+
 (defun message-goto-body ()
   "Move point to the beginning of the message body."
   (interactive)
-  (when (and (called-interactively-p 'any)
+  (when (and (message-called-interactively-p 'any)
             (looking-at "[ \t]*\n"))
     (expand-abbrev))
   (goto-char (point-min))