emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111118: gmm-utils.el (gmm-called-int


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111118: gmm-utils.el (gmm-called-interactively-p): Restore as a macro.
Date: Thu, 06 Dec 2012 04:28:00 +0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111118
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Thu 2012-12-06 04:28:00 +0000
message:
  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.
modified:
  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
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2012-12-06 03:30:23 +0000
+++ b/lisp/gnus/ChangeLog       2012-12-06 04:28:00 +0000
@@ -1,5 +1,20 @@
 2012-12-06  Katsumi Yamaoka  <address@hidden>
 
+       * 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):

=== modified file 'lisp/gnus/gmm-utils.el'
--- a/lisp/gnus/gmm-utils.el    2012-12-06 03:30:23 +0000
+++ b/lisp/gnus/gmm-utils.el    2012-12-06 04:28:00 +0000
@@ -417,6 +417,18 @@
        (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.

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2012-12-05 10:27:16 +0000
+++ b/lisp/gnus/gnus-art.el     2012-12-06 04:28:00 +0000
@@ -2718,7 +2718,7 @@
       (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 ()

=== modified file 'lisp/gnus/gnus-bookmark.el'
--- a/lisp/gnus/gnus-bookmark.el        2012-12-05 10:27:16 +0000
+++ b/lisp/gnus/gnus-bookmark.el        2012-12-06 04:28:00 +0000
@@ -367,7 +367,7 @@
 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)

=== modified file 'lisp/gnus/gnus-registry.el'
--- a/lisp/gnus/gnus-registry.el        2012-12-05 10:27:16 +0000
+++ b/lisp/gnus/gnus-registry.el        2012-12-06 04:28:00 +0000
@@ -982,7 +982,7 @@
   (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))
 

=== modified file 'lisp/gnus/gnus-score.el'
--- a/lisp/gnus/gnus-score.el   2012-12-04 08:22:12 +0000
+++ b/lisp/gnus/gnus-score.el   2012-12-06 04:28:00 +0000
@@ -1723,7 +1723,8 @@
       ((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 @@
               (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

=== modified file 'lisp/gnus/message.el'
--- a/lisp/gnus/message.el      2012-12-06 03:30:23 +0000
+++ b/lisp/gnus/message.el      2012-12-06 04:28:00 +0000
@@ -3137,22 +3137,10 @@
   (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)

=== modified file 'lisp/gnus/spam-stat.el'
--- a/lisp/gnus/spam-stat.el    2012-01-19 07:21:25 +0000
+++ b/lisp/gnus/spam-stat.el    2012-12-06 04:28:00 +0000
@@ -494,6 +494,18 @@
     (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 @@
            (error nil)))
         (ans
          (if score1s (+ score0 score1s) score0)))
-    (when (interactive-p)
+    (when (spam-stat-called-interactively-p 'any)
       (message "%S" ans))
     ans))
 

=== modified file 'lisp/gnus/spam.el'
--- a/lisp/gnus/spam.el 2012-06-26 22:52:31 +0000
+++ b/lisp/gnus/spam.el 2012-12-06 04:28:00 +0000
@@ -2092,22 +2092,24 @@
 (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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]