diff options
| author | Katsumi Yamaoka | 2012-12-06 04:28:00 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2012-12-06 04:28:00 +0000 |
| commit | da9462398abf03e0fdd7269aedf9ed7ebe6bfaa7 (patch) | |
| tree | 6ea6d40a283e9deb3e9a247cb876b299f9803484 | |
| parent | 9ad948e2fdc7bbe7caa00fd3460ef3f47087c9c3 (diff) | |
| download | emacs-da9462398abf03e0fdd7269aedf9ed7ebe6bfaa7.tar.gz emacs-da9462398abf03e0fdd7269aedf9ed7ebe6bfaa7.zip | |
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.
| -rw-r--r-- | lisp/gnus/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/gnus/gmm-utils.el | 12 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-bookmark.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-score.el | 5 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 14 | ||||
| -rw-r--r-- | lisp/gnus/spam-stat.el | 14 | ||||
| -rw-r--r-- | lisp/gnus/spam.el | 32 |
9 files changed, 64 insertions, 34 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0dde5f6f9b2..9d93b28420d 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,20 @@ | |||
| 1 | 2012-12-06 Katsumi Yamaoka <yamaoka@jpl.org> | 1 | 2012-12-06 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 2 | ||
| 3 | * gmm-utils.el (gmm-called-interactively-p): Restore as a macro. | ||
| 4 | * gnus-art.el (article-unsplit-urls) | ||
| 5 | * gnus-bookmark.el (gnus-bookmark-bmenu-list) | ||
| 6 | * gnus-registry.el (gnus-registry-get-article-marks) | ||
| 7 | * message.el (message-goto-body): Use it. | ||
| 8 | (message-called-interactively-p): Remove. | ||
| 9 | |||
| 10 | * spam-stat.el (spam-stat-called-interactively-p): New macro. | ||
| 11 | (spam-stat-score-buffer): Use it. | ||
| 12 | |||
| 13 | * spam.el: Silence the warnings against BBDB functions when compiling. | ||
| 14 | |||
| 15 | * gnus-score.el (gnus-score-decode-text-parts): | ||
| 16 | Use append+mapcar instead of the cl function mapcan. | ||
| 17 | |||
| 3 | * gmm-utils.el (gmm-flet): Remove. | 18 | * gmm-utils.el (gmm-flet): Remove. |
| 4 | 19 | ||
| 5 | * gnus-sync.el (gnus-sync-lesync-call): | 20 | * gnus-sync.el (gnus-sync-lesync-call): |
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 92a39257a76..0f03d479534 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el | |||
| @@ -417,6 +417,18 @@ coding-system." | |||
| 417 | (write-region start end filename append visit lockname)) | 417 | (write-region start end filename append visit lockname)) |
| 418 | (write-region start end filename append visit lockname mustbenew))) | 418 | (write-region start end filename append visit lockname mustbenew))) |
| 419 | 419 | ||
| 420 | ;; `interactive-p' is obsolete since Emacs 23.2. | ||
| 421 | (defmacro gmm-called-interactively-p (kind) | ||
| 422 | (condition-case nil | ||
| 423 | (progn | ||
| 424 | (eval '(called-interactively-p 'any)) | ||
| 425 | ;; Emacs >=23.2 | ||
| 426 | `(called-interactively-p ,kind)) | ||
| 427 | ;; Emacs <23.2 | ||
| 428 | (wrong-number-of-arguments '(called-interactively-p)) | ||
| 429 | ;; XEmacs | ||
| 430 | (void-function '(interactive-p)))) | ||
| 431 | |||
| 420 | ;; `labels' is obsolete since Emacs 24.3. | 432 | ;; `labels' is obsolete since Emacs 24.3. |
| 421 | (defmacro gmm-labels (bindings &rest body) | 433 | (defmacro gmm-labels (bindings &rest body) |
| 422 | "Make temporary function bindings. | 434 | "Make temporary function bindings. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index edcd7da2ddd..9dfe119f831 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2718,7 +2718,7 @@ If READ-CHARSET, ask for a coding system." | |||
| 2718 | (while (re-search-forward | 2718 | (while (re-search-forward |
| 2719 | "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t) | 2719 | "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t) |
| 2720 | (replace-match "\\1\\3" t))) | 2720 | (replace-match "\\1\\3" t))) |
| 2721 | (when (interactive-p) | 2721 | (when (gmm-called-interactively-p 'any) |
| 2722 | (gnus-treat-article nil)))) | 2722 | (gnus-treat-article nil)))) |
| 2723 | 2723 | ||
| 2724 | (defun article-wash-html () | 2724 | (defun article-wash-html () |
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el index 9f6654dd12d..e447322777e 100644 --- a/lisp/gnus/gnus-bookmark.el +++ b/lisp/gnus/gnus-bookmark.el | |||
| @@ -367,7 +367,7 @@ The leftmost column displays a D if the bookmark is flagged for | |||
| 367 | deletion, or > if it is flagged for displaying." | 367 | deletion, or > if it is flagged for displaying." |
| 368 | (interactive) | 368 | (interactive) |
| 369 | (gnus-bookmark-maybe-load-default-file) | 369 | (gnus-bookmark-maybe-load-default-file) |
| 370 | (if (interactive-p) | 370 | (if (gmm-called-interactively-p 'any) |
| 371 | (switch-to-buffer (get-buffer-create "*Gnus Bookmark List*")) | 371 | (switch-to-buffer (get-buffer-create "*Gnus Bookmark List*")) |
| 372 | (set-buffer (get-buffer-create "*Gnus Bookmark List*"))) | 372 | (set-buffer (get-buffer-create "*Gnus Bookmark List*"))) |
| 373 | (let ((inhibit-read-only t) | 373 | (let ((inhibit-read-only t) |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 71e00967548..5e20f5fb706 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -982,7 +982,7 @@ only the last one's marks are returned." | |||
| 982 | (let* ((article (last articles)) | 982 | (let* ((article (last articles)) |
| 983 | (id (gnus-registry-fetch-message-id-fast article)) | 983 | (id (gnus-registry-fetch-message-id-fast article)) |
| 984 | (marks (when id (gnus-registry-get-id-key id 'mark)))) | 984 | (marks (when id (gnus-registry-get-id-key id 'mark)))) |
| 985 | (when (interactive-p) | 985 | (when (gmm-called-interactively-p 'any) |
| 986 | (gnus-message 1 "Marks are %S" marks)) | 986 | (gnus-message 1 "Marks are %S" marks)) |
| 987 | marks)) | 987 | marks)) |
| 988 | 988 | ||
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index f7a507fd1d7..4a47b738134 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el | |||
| @@ -1723,7 +1723,8 @@ score in `gnus-newsgroup-scored' by SCORE." | |||
| 1723 | ((mm-text-parts | 1723 | ((mm-text-parts |
| 1724 | (handle) | 1724 | (handle) |
| 1725 | (cond ((stringp (car handle)) | 1725 | (cond ((stringp (car handle)) |
| 1726 | (let ((parts (mapcan #'mm-text-parts (cdr handle)))) | 1726 | (let ((parts (apply #'append |
| 1727 | (mapcar #'mm-text-parts (cdr handle))))) | ||
| 1727 | (if (equal "multipart/alternative" (car handle)) | 1728 | (if (equal "multipart/alternative" (car handle)) |
| 1728 | ;; pick the first supported alternative | 1729 | ;; pick the first supported alternative |
| 1729 | (list (car parts)) | 1730 | (list (car parts)) |
| @@ -1733,7 +1734,7 @@ score in `gnus-newsgroup-scored' by SCORE." | |||
| 1733 | (when (string-match "^text/" (mm-handle-media-type handle)) | 1734 | (when (string-match "^text/" (mm-handle-media-type handle)) |
| 1734 | (list handle))) | 1735 | (list handle))) |
| 1735 | 1736 | ||
| 1736 | (t (mapcan #'mm-text-parts handle)))) | 1737 | (t (apply #'append (mapcar #'mm-text-parts handle))))) |
| 1737 | (my-mm-display-part | 1738 | (my-mm-display-part |
| 1738 | (handle) | 1739 | (handle) |
| 1739 | (when handle | 1740 | (when handle |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index af5bee2056f..0e2c5debe4d 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -3137,22 +3137,10 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." | |||
| 3137 | (push-mark) | 3137 | (push-mark) |
| 3138 | (message-position-on-field "Summary" "Subject")) | 3138 | (message-position-on-field "Summary" "Subject")) |
| 3139 | 3139 | ||
| 3140 | (eval-when-compile | ||
| 3141 | (defmacro message-called-interactively-p (kind) | ||
| 3142 | (condition-case nil | ||
| 3143 | (progn | ||
| 3144 | (eval '(called-interactively-p 'any)) | ||
| 3145 | ;; Emacs >=23.2 | ||
| 3146 | `(called-interactively-p ,kind)) | ||
| 3147 | ;; Emacs <23.2 | ||
| 3148 | (wrong-number-of-arguments '(called-interactively-p)) | ||
| 3149 | ;; XEmacs | ||
| 3150 | (void-function '(interactive-p))))) | ||
| 3151 | |||
| 3152 | (defun message-goto-body () | 3140 | (defun message-goto-body () |
| 3153 | "Move point to the beginning of the message body." | 3141 | "Move point to the beginning of the message body." |
| 3154 | (interactive) | 3142 | (interactive) |
| 3155 | (when (and (message-called-interactively-p 'any) | 3143 | (when (and (gmm-called-interactively-p 'any) |
| 3156 | (looking-at "[ \t]*\n")) | 3144 | (looking-at "[ \t]*\n")) |
| 3157 | (expand-abbrev)) | 3145 | (expand-abbrev)) |
| 3158 | (push-mark) | 3146 | (push-mark) |
diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index 04f90ee038d..9165e4193de 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el | |||
| @@ -494,6 +494,18 @@ where DIFF is the difference between SCORE and 0.5." | |||
| 494 | (setcdr (nthcdr 14 result) nil) | 494 | (setcdr (nthcdr 14 result) nil) |
| 495 | result)) | 495 | result)) |
| 496 | 496 | ||
| 497 | (eval-when-compile | ||
| 498 | (defmacro spam-stat-called-interactively-p (kind) | ||
| 499 | (condition-case nil | ||
| 500 | (progn | ||
| 501 | (eval '(called-interactively-p 'any)) | ||
| 502 | ;; Emacs >=23.2 | ||
| 503 | `(called-interactively-p ,kind)) | ||
| 504 | ;; Emacs <23.2 | ||
| 505 | (wrong-number-of-arguments '(called-interactively-p)) | ||
| 506 | ;; XEmacs | ||
| 507 | (void-function '(interactive-p))))) | ||
| 508 | |||
| 497 | (defun spam-stat-score-buffer () | 509 | (defun spam-stat-score-buffer () |
| 498 | "Return a score describing the spam-probability for this buffer. | 510 | "Return a score describing the spam-probability for this buffer. |
| 499 | Add user supplied modifications if supplied." | 511 | Add user supplied modifications if supplied." |
| @@ -511,7 +523,7 @@ Add user supplied modifications if supplied." | |||
| 511 | (error nil))) | 523 | (error nil))) |
| 512 | (ans | 524 | (ans |
| 513 | (if score1s (+ score0 score1s) score0))) | 525 | (if score1s (+ score0 score1s) score0))) |
| 514 | (when (interactive-p) | 526 | (when (spam-stat-called-interactively-p 'any) |
| 515 | (message "%S" ans)) | 527 | (message "%S" ans)) |
| 516 | ans)) | 528 | ans)) |
| 517 | 529 | ||
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index c3be15adc1a..c9030f11ee3 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el | |||
| @@ -2092,22 +2092,24 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." | |||
| 2092 | (declare-function gnus-extract-address-components "gnus-util" (from)) | 2092 | (declare-function gnus-extract-address-components "gnus-util" (from)) |
| 2093 | 2093 | ||
| 2094 | (eval-and-compile | 2094 | (eval-and-compile |
| 2095 | (when (condition-case nil | 2095 | (condition-case nil |
| 2096 | (progn | 2096 | (progn |
| 2097 | (require 'bbdb) | 2097 | (require 'bbdb) |
| 2098 | (require 'bbdb-com)) | 2098 | (require 'bbdb-com)) |
| 2099 | (file-error | 2099 | (file-error |
| 2100 | ;; `bbdb-records' should not be bound as an autoload function | 2100 | ;; `bbdb-records' should not be bound as an autoload function |
| 2101 | ;; before loading bbdb because of `bbdb-hashtable-size'. | 2101 | ;; before loading bbdb because of `bbdb-hashtable-size'. |
| 2102 | (defalias 'bbdb-buffer 'ignore) | 2102 | (defalias 'bbdb-buffer 'ignore) |
| 2103 | (defalias 'bbdb-create-internal 'ignore) | 2103 | (defalias 'bbdb-create-internal 'ignore) |
| 2104 | (defalias 'bbdb-records 'ignore) | 2104 | (defalias 'bbdb-records 'ignore) |
| 2105 | (defalias 'spam-BBDB-register-routine 'ignore) | 2105 | (defalias 'spam-BBDB-register-routine 'ignore) |
| 2106 | (defalias 'spam-enter-ham-BBDB 'ignore) | 2106 | (defalias 'spam-enter-ham-BBDB 'ignore) |
| 2107 | (defalias 'spam-exists-in-BBDB-p 'ignore) | 2107 | (defalias 'spam-exists-in-BBDB-p 'ignore) |
| 2108 | (defalias 'bbdb-gethash 'ignore) | 2108 | (defalias 'bbdb-gethash 'ignore) |
| 2109 | nil)) | 2109 | nil))) |
| 2110 | 2110 | ||
| 2111 | (eval-when-compile | ||
| 2112 | (when (featurep 'bbdb-com) | ||
| 2111 | ;; when the BBDB changes, we want to clear out our cache | 2113 | ;; when the BBDB changes, we want to clear out our cache |
| 2112 | (defun spam-clear-cache-BBDB (&rest immaterial) | 2114 | (defun spam-clear-cache-BBDB (&rest immaterial) |
| 2113 | (spam-clear-cache 'spam-use-BBDB)) | 2115 | (spam-clear-cache 'spam-use-BBDB)) |