diff options
| author | Katsumi Yamaoka | 2012-12-05 09:24:27 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2012-12-05 09:24:27 +0000 |
| commit | ad6fe94df224de88cac873df5a91ffe14bf50d1b (patch) | |
| tree | 4b7f47319169d8a05df8d755eea5bcc0e5150fd4 | |
| parent | a368019460b1a22a84acc8e8836f60e97ebbcb25 (diff) | |
| download | emacs-ad6fe94df224de88cac873df5a91ffe14bf50d1b.tar.gz emacs-ad6fe94df224de88cac873df5a91ffe14bf50d1b.zip | |
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.
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/gmm-utils.el | 14 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 3 | ||||
| -rw-r--r-- | lisp/gnus/gnus-bookmark.el | 3 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 3 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 14 |
6 files changed, 27 insertions, 17 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d3b66f4c8fd..0516ed6cf4a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2012-12-05 Katsumi Yamaoka <yamaoka@jpl.org> | 1 | 2012-12-05 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 2 | ||
| 3 | * gmm-utils.el (gmm-called-interactively-p): New function. | ||
| 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 | |||
| 3 | * gmm-utils.el (gmm-flet): Restore it using cl-letf. | 10 | * gmm-utils.el (gmm-flet): Restore it using cl-letf. |
| 4 | * gnus-sync.el (gnus-sync-lesync-call) | 11 | * gnus-sync.el (gnus-sync-lesync-call) |
| 5 | * message.el (message-read-from-minibuffer): Use it. | 12 | * message.el (message-read-from-minibuffer): Use it. |
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index ab42b149be3..2e196158131 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el | |||
| @@ -417,7 +417,19 @@ 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 | ;; `flet' and `labels' got obsolete since Emacs 24.3. | 420 | ;; `interactive-p' is obsolete since Emacs 23.2. |
| 421 | (defalias 'gmm-called-interactively-p | ||
| 422 | (condition-case nil | ||
| 423 | (progn | ||
| 424 | (eval '(called-interactively-p 'any)) | ||
| 425 | ;; Emacs >=23.2 | ||
| 426 | 'called-interactively-p) | ||
| 427 | ;; Emacs <23.2 | ||
| 428 | (wrong-number-of-arguments '(lambda (kind) (called-interactively-p))) | ||
| 429 | ;; XEmacs | ||
| 430 | (void-function '(lambda (kind) (interactive-p))))) | ||
| 431 | |||
| 432 | ;; `flet' and `labels' are obsolete since Emacs 24.3. | ||
| 421 | (defmacro gmm-flet (bindings &rest body) | 433 | (defmacro gmm-flet (bindings &rest body) |
| 422 | "Make temporary overriding function definitions. | 434 | "Make temporary overriding function definitions. |
| 423 | This is an analogue of a dynamically scoped `let' that operates on | 435 | This is an analogue of a dynamically scoped `let' that operates on |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index edcd7da2ddd..ee5a1ad18c6 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | (require 'mm-uu) | 45 | (require 'mm-uu) |
| 46 | (require 'message) | 46 | (require 'message) |
| 47 | (require 'mouse) | 47 | (require 'mouse) |
| 48 | (require 'gmm-utils) | ||
| 48 | 49 | ||
| 49 | (autoload 'gnus-msg-mail "gnus-msg" nil t) | 50 | (autoload 'gnus-msg-mail "gnus-msg" nil t) |
| 50 | (autoload 'gnus-button-mailto "gnus-msg") | 51 | (autoload 'gnus-button-mailto "gnus-msg") |
| @@ -2718,7 +2719,7 @@ If READ-CHARSET, ask for a coding system." | |||
| 2718 | (while (re-search-forward | 2719 | (while (re-search-forward |
| 2719 | "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t) | 2720 | "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t) |
| 2720 | (replace-match "\\1\\3" t))) | 2721 | (replace-match "\\1\\3" t))) |
| 2721 | (when (interactive-p) | 2722 | (when (gmm-called-interactively-p 'any) |
| 2722 | (gnus-treat-article nil)))) | 2723 | (gnus-treat-article nil)))) |
| 2723 | 2724 | ||
| 2724 | (defun article-wash-html () | 2725 | (defun article-wash-html () |
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el index 9f6654dd12d..2ad1f23c1c0 100644 --- a/lisp/gnus/gnus-bookmark.el +++ b/lisp/gnus/gnus-bookmark.el | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | ;;; Code: | 53 | ;;; Code: |
| 54 | 54 | ||
| 55 | (require 'gnus-sum) | 55 | (require 'gnus-sum) |
| 56 | (require 'gmm-utils) | ||
| 56 | 57 | ||
| 57 | ;; FIXME: should avoid using C-c (no?) | 58 | ;; FIXME: should avoid using C-c (no?) |
| 58 | ;; (define-key gnus-summary-mode-map "\C-crm" 'gnus-bookmark-set) | 59 | ;; (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 | |||
| 367 | deletion, or > if it is flagged for displaying." | 368 | deletion, or > if it is flagged for displaying." |
| 368 | (interactive) | 369 | (interactive) |
| 369 | (gnus-bookmark-maybe-load-default-file) | 370 | (gnus-bookmark-maybe-load-default-file) |
| 370 | (if (interactive-p) | 371 | (if (gmm-called-interactively-p 'any) |
| 371 | (switch-to-buffer (get-buffer-create "*Gnus Bookmark List*")) | 372 | (switch-to-buffer (get-buffer-create "*Gnus Bookmark List*")) |
| 372 | (set-buffer (get-buffer-create "*Gnus Bookmark List*"))) | 373 | (set-buffer (get-buffer-create "*Gnus Bookmark List*"))) |
| 373 | (let ((inhibit-read-only t) | 374 | (let ((inhibit-read-only t) |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 71e00967548..755bf6ecc3f 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -86,6 +86,7 @@ | |||
| 86 | (require 'nnmail) | 86 | (require 'nnmail) |
| 87 | (require 'easymenu) | 87 | (require 'easymenu) |
| 88 | (require 'registry) | 88 | (require 'registry) |
| 89 | (require 'gmm-utils) | ||
| 89 | 90 | ||
| 90 | (defvar gnus-adaptive-word-syntax-table) | 91 | (defvar gnus-adaptive-word-syntax-table) |
| 91 | 92 | ||
| @@ -982,7 +983,7 @@ only the last one's marks are returned." | |||
| 982 | (let* ((article (last articles)) | 983 | (let* ((article (last articles)) |
| 983 | (id (gnus-registry-fetch-message-id-fast article)) | 984 | (id (gnus-registry-fetch-message-id-fast article)) |
| 984 | (marks (when id (gnus-registry-get-id-key id 'mark)))) | 985 | (marks (when id (gnus-registry-get-id-key id 'mark)))) |
| 985 | (when (interactive-p) | 986 | (when (gmm-called-interactively-p 'interactive) |
| 986 | (gnus-message 1 "Marks are %S" marks)) | 987 | (gnus-message 1 "Marks are %S" marks)) |
| 987 | marks)) | 988 | marks)) |
| 988 | 989 | ||
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 2171dcf3edc..145bab97409 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) |