gmm-utils.el (gmm-called-interactively-p): New function.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 5 Dec 2012 09:24:16 +0000 (09:24 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 5 Dec 2012 09:24:16 +0000 (09:24 +0000)
gnus-art.el (article-unsplit-urls)
gnus-bookmark.el (gnus-bookmark-bmenu-list)
gnus-registry.el (gnus-registry-get-article-marks)
message.el (message-goto-body): Use it.
  (message-called-interactively-p): Remove.

lisp/ChangeLog
lisp/gmm-utils.el
lisp/gnus-art.el
lisp/gnus-bookmark.el
lisp/gnus-registry.el
lisp/message.el

index 63a75b8..18fb3c1 100644 (file)
@@ -1,5 +1,12 @@
 2012-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * gmm-utils.el (gmm-called-interactively-p): New function.
+       * gnus-art.el (article-unsplit-urls)
+       * gnus-bookmark.el (gnus-bookmark-bmenu-list)
+       * gnus-registry.el (gnus-registry-get-article-marks)
+       * message.el (message-goto-body): Use it.
+       (message-called-interactively-p): Remove.
+
        * gmm-utils.el (gmm-flet): Restore it using cl-letf.
        * gnus-sync.el (gnus-sync-lesync-call)
        * message.el (message-read-from-minibuffer): Use it.
index ab42b14..2e19615 100644 (file)
@@ -417,7 +417,19 @@ coding-system."
        (write-region start end filename append visit lockname))
     (write-region start end filename append visit lockname mustbenew)))
 
-;; `flet' and `labels' got obsolete since Emacs 24.3.
+;; `interactive-p' is obsolete since Emacs 23.2.
+(defalias 'gmm-called-interactively-p
+  (condition-case nil
+      (progn
+       (eval '(called-interactively-p 'any))
+       ;; Emacs >=23.2
+       'called-interactively-p)
+    ;; Emacs <23.2
+    (wrong-number-of-arguments '(lambda (kind) (called-interactively-p)))
+    ;; XEmacs
+    (void-function '(lambda (kind) (interactive-p)))))
+
+;; `flet' and `labels' are obsolete since Emacs 24.3.
 (defmacro gmm-flet (bindings &rest body)
   "Make temporary overriding function definitions.
 This is an analogue of a dynamically scoped `let' that operates on
index 6e8bef8..616f8cd 100644 (file)
@@ -46,6 +46,7 @@
 (require 'mm-uu)
 (require 'message)
 (require 'mouse)
+(require 'gmm-utils)
 
 (autoload 'gnus-msg-mail "gnus-msg" nil t)
 (autoload 'gnus-button-mailto "gnus-msg")
@@ -2719,7 +2720,7 @@ If READ-CHARSET, ask for a coding system."
       (while (re-search-forward
              "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t)
        (replace-match "\\1\\3" t)))
-    (when (interactive-p)
+    (when (gmm-called-interactively-p 'any)
       (gnus-treat-article nil))))
 
 (defun article-wash-html ()
index 9f6654d..2ad1f23 100644 (file)
@@ -53,6 +53,7 @@
 ;;; Code:
 
 (require 'gnus-sum)
+(require 'gmm-utils)
 
 ;; FIXME: should avoid using C-c (no?)
 ;; (define-key gnus-summary-mode-map "\C-crm" 'gnus-bookmark-set)
@@ -367,7 +368,7 @@ The leftmost column displays a D if the bookmark is flagged for
 deletion, or > if it is flagged for displaying."
   (interactive)
   (gnus-bookmark-maybe-load-default-file)
-  (if (interactive-p)
+  (if (gmm-called-interactively-p 'any)
       (switch-to-buffer (get-buffer-create "*Gnus Bookmark List*"))
     (set-buffer (get-buffer-create "*Gnus Bookmark List*")))
   (let ((inhibit-read-only t)
index 71e0096..755bf6e 100644 (file)
@@ -86,6 +86,7 @@
 (require 'nnmail)
 (require 'easymenu)
 (require 'registry)
+(require 'gmm-utils)
 
 (defvar gnus-adaptive-word-syntax-table)
 
@@ -982,7 +983,7 @@ only the last one's marks are returned."
   (let* ((article (last articles))
          (id (gnus-registry-fetch-message-id-fast article))
          (marks (when id (gnus-registry-get-id-key id 'mark))))
-    (when (interactive-p)
+    (when (gmm-called-interactively-p 'interactive)
       (gnus-message 1 "Marks are %S" marks))
     marks))
 
index 32d0edf..9cd0a4d 100644 (file)
@@ -3181,22 +3181,10 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
   (push-mark)
   (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 (message-called-interactively-p 'any)
+  (when (and (gmm-called-interactively-p 'any)
             (looking-at "[ \t]*\n"))
     (expand-abbrev))
   (push-mark)