]> git.eshelyaron.com Git - emacs.git/commitdiff
gmm-utils.el (gmm-called-interactively-p): Restore as a macro.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 6 Dec 2012 04:28:00 +0000 (04:28 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 6 Dec 2012 04:28:00 +0000 (04:28 +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.

spam-stat.el (spam-stat-called-interactively-p): New macro.
  (spam-stat-score-buffer): Use it.

spam.el: Silence the warnings against BBDB functions when compiling.

gnus-score.el (gnus-score-decode-text-parts):
  Use append+mapcar instead of the cl function mapcan.

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

index 0dde5f6f9b238747726fc059e7c95ba6a9884701..9d93b28420d34c43872e04058388098607e8835c 100644 (file)
@@ -1,5 +1,20 @@
 2012-12-06  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * gmm-utils.el (gmm-called-interactively-p): Restore as a macro.
+       * 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.
+
+       * spam-stat.el (spam-stat-called-interactively-p): New macro.
+       (spam-stat-score-buffer): Use it.
+
+       * spam.el: Silence the warnings against BBDB functions when compiling.
+
+       * gnus-score.el (gnus-score-decode-text-parts):
+       Use append+mapcar instead of the cl function mapcan.
+
        * gmm-utils.el (gmm-flet): Remove.
 
        * gnus-sync.el (gnus-sync-lesync-call):
index 92a39257a763dad99539abd3a01334b08e5985c4..0f03d479534375985a57e59818cf044c764e2783 100644 (file)
@@ -417,6 +417,18 @@ coding-system."
        (write-region start end filename append visit lockname))
     (write-region start end filename append visit lockname mustbenew)))
 
+;; `interactive-p' is obsolete since Emacs 23.2.
+(defmacro gmm-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))))
+
 ;; `labels' is obsolete since Emacs 24.3.
 (defmacro gmm-labels (bindings &rest body)
   "Make temporary function bindings.
index edcd7da2dddad42333a6652cb58fadef474293a3..9dfe119f831d02cc23a62c60017c3b3cb0da6afa 100644 (file)
@@ -2718,7 +2718,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 9f6654dd12d65c85d4aaf99e9851faf64bd629e2..e447322777ea8a09c61d97f96b356be09f83480e 100644 (file)
@@ -367,7 +367,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 71e00967548beaf70d22c462d885c7cd9f05c68b..5e20f5fb70658fd0b9f2d5da9c9ceb5750b8d937 100644 (file)
@@ -982,7 +982,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 'any)
       (gnus-message 1 "Marks are %S" marks))
     marks))
 
index f7a507fd1d7a9d5f28d37ca67409112e96a5ce76..4a47b738134dda22a90e3f83b530a10eebb20ee0 100644 (file)
@@ -1723,7 +1723,8 @@ score in `gnus-newsgroup-scored' by SCORE."
       ((mm-text-parts
        (handle)
        (cond ((stringp (car handle))
-              (let ((parts (mapcan #'mm-text-parts (cdr handle))))
+              (let ((parts (apply #'append
+                                  (mapcar #'mm-text-parts (cdr handle)))))
                 (if (equal "multipart/alternative" (car handle))
                     ;; pick the first supported alternative
                     (list (car parts))
@@ -1733,7 +1734,7 @@ score in `gnus-newsgroup-scored' by SCORE."
               (when (string-match "^text/" (mm-handle-media-type handle))
                 (list handle)))
 
-             (t (mapcan #'mm-text-parts handle))))
+             (t (apply #'append (mapcar #'mm-text-parts handle)))))
        (my-mm-display-part
        (handle)
        (when handle
index af5bee2056f0c44343e951b38568d24bb29b86a0..0e2c5debe4dde95c25a30dd15274bba69d6e614e 100644 (file)
@@ -3137,22 +3137,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)
index 04f90ee038df2f058330ffee117ef6ef61dbc4c9..9165e4193dea4501673b754c40449dc831534d1a 100644 (file)
@@ -494,6 +494,18 @@ where DIFF is the difference between SCORE and 0.5."
     (setcdr (nthcdr 14 result) nil)
     result))
 
+(eval-when-compile
+  (defmacro spam-stat-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 spam-stat-score-buffer ()
   "Return a score describing the spam-probability for this buffer.
 Add user supplied modifications if supplied."
@@ -511,7 +523,7 @@ Add user supplied modifications if supplied."
            (error nil)))
         (ans
          (if score1s (+ score0 score1s) score0)))
-    (when (interactive-p)
+    (when (spam-stat-called-interactively-p 'any)
       (message "%S" ans))
     ans))
 
index c3be15adc1a0a92449faeeb3250e0e8a72ad3b68..c9030f11ee38208fe9e3a733aa9404741c54bdfd 100644 (file)
@@ -2092,22 +2092,24 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
 (declare-function gnus-extract-address-components "gnus-util" (from))
 
 (eval-and-compile
-  (when (condition-case nil
-            (progn
-              (require 'bbdb)
-              (require 'bbdb-com))
-          (file-error
-           ;; `bbdb-records' should not be bound as an autoload function
-           ;; before loading bbdb because of `bbdb-hashtable-size'.
-           (defalias 'bbdb-buffer 'ignore)
-           (defalias 'bbdb-create-internal 'ignore)
-           (defalias 'bbdb-records 'ignore)
-           (defalias 'spam-BBDB-register-routine 'ignore)
-           (defalias 'spam-enter-ham-BBDB 'ignore)
-           (defalias 'spam-exists-in-BBDB-p 'ignore)
-           (defalias 'bbdb-gethash 'ignore)
-           nil))
+  (condition-case nil
+      (progn
+       (require 'bbdb)
+       (require 'bbdb-com))
+    (file-error
+     ;; `bbdb-records' should not be bound as an autoload function
+     ;; before loading bbdb because of `bbdb-hashtable-size'.
+     (defalias 'bbdb-buffer 'ignore)
+     (defalias 'bbdb-create-internal 'ignore)
+     (defalias 'bbdb-records 'ignore)
+     (defalias 'spam-BBDB-register-routine 'ignore)
+     (defalias 'spam-enter-ham-BBDB 'ignore)
+     (defalias 'spam-exists-in-BBDB-p 'ignore)
+     (defalias 'bbdb-gethash 'ignore)
+     nil)))
 
+(eval-when-compile
+  (when (featurep 'bbdb-com)
     ;; when the BBDB changes, we want to clear out our cache
     (defun spam-clear-cache-BBDB (&rest immaterial)
       (spam-clear-cache 'spam-use-BBDB))