aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2012-12-06 03:30:23 +0000
committerKatsumi Yamaoka2012-12-06 03:30:23 +0000
commit9ad948e2fdc7bbe7caa00fd3460ef3f47087c9c3 (patch)
treeff67d3cd8f7f34eafc01f9b3ef56af6a82a98b20
parent9a81a97f1712feb7b6118e3513a671434bb3edb6 (diff)
downloademacs-9ad948e2fdc7bbe7caa00fd3460ef3f47087c9c3.tar.gz
emacs-9ad948e2fdc7bbe7caa00fd3460ef3f47087c9c3.zip
Avoid letf macro use from Gnus
gnus/gmm-utils.el (gmm-flet): Remove. gnus/gnus-sync.el (gnus-sync-lesync-call): Avoid overriding json-alist-p. gnus/message.el (message-read-from-minibuffer): Avoid overriding mail-abbrev-in-expansion-header-p. mail/mailabbrev.el (mail-abbrev-expand-wrapper): Work in minibuffer so as to enable message-read-from-minibuffer to expand mail aliases.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/gmm-utils.el18
-rw-r--r--lisp/gnus/gnus-sync.el20
-rw-r--r--lisp/gnus/message.el3
-rw-r--r--lisp/mail/mailabbrev.el8
6 files changed, 31 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cb5118cde40..3c0f28da4db 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * mail/mailabbrev.el (mail-abbrev-expand-wrapper): Work in minibuffer
4 so as to enable message-read-from-minibuffer to expand mail aliases.
5
12012-12-06 Stefan Monnier <monnier@iro.umontreal.ca> 62012-12-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * minibuf-eldef.el (minibuf-eldef-update-minibuffer): Don't mess with 8 * minibuf-eldef.el (minibuf-eldef-update-minibuffer): Don't mess with
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 522c688fc13..0dde5f6f9b2 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12012-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gmm-utils.el (gmm-flet): Remove.
4
5 * gnus-sync.el (gnus-sync-lesync-call):
6 Avoid overriding json-alist-p.
7
8 * message.el (message-read-from-minibuffer):
9 Avoid overriding mail-abbrev-in-expansion-header-p.
10
12012-12-05 Sam Steingold <sds@gnu.org> 112012-12-05 Sam Steingold <sds@gnu.org>
2 12
3 * gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'. 13 * gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'.
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 91e4965e91c..92a39257a76 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -417,23 +417,7 @@ 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' are obsolete since Emacs 24.3. 420;; `labels' is obsolete since Emacs 24.3.
421(defmacro gmm-flet (bindings &rest body)
422 "Make temporary overriding function definitions.
423This is an analogue of a dynamically scoped `let' that operates on
424the function cell of FUNCs rather than their value cell.
425
426\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
427 (require 'cl)
428 (if (fboundp 'cl-letf)
429 `(cl-letf ,(mapcar (lambda (binding)
430 `((symbol-function ',(car binding))
431 (lambda ,@(cdr binding))))
432 bindings)
433 ,@body)
434 `(flet ,bindings ,@body)))
435(put 'gmm-flet 'lisp-indent-function 1)
436
437(defmacro gmm-labels (bindings &rest body) 421(defmacro gmm-labels (bindings &rest body)
438 "Make temporary function bindings. 422 "Make temporary function bindings.
439The bindings can be recursive and the scoping is lexical, but capturing 423The bindings can be recursive and the scoping is lexical, but capturing
diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el
index e2a71f0ee01..0ec9fedffe3 100644
--- a/lisp/gnus/gnus-sync.el
+++ b/lisp/gnus/gnus-sync.el
@@ -88,7 +88,6 @@
88(require 'gnus) 88(require 'gnus)
89(require 'gnus-start) 89(require 'gnus-start)
90(require 'gnus-util) 90(require 'gnus-util)
91(require 'gmm-utils)
92 91
93(defvar gnus-topic-alist) ;; gnus-group.el 92(defvar gnus-topic-alist) ;; gnus-group.el
94(eval-when-compile 93(eval-when-compile
@@ -177,16 +176,15 @@ and `gnus-topic-alist'. Also see `gnus-variable-list'."
177(defun gnus-sync-lesync-call (url method headers &optional kvdata) 176(defun gnus-sync-lesync-call (url method headers &optional kvdata)
178 "Make an access request to URL using KVDATA and METHOD. 177 "Make an access request to URL using KVDATA and METHOD.
179KVDATA must be an alist." 178KVDATA must be an alist."
180 (gmm-flet ((json-alist-p (list) (gnus-sync-json-alist-p list))) ; temp patch 179 (let ((url-request-method method)
181 (let ((url-request-method method) 180 (url-request-extra-headers headers)
182 (url-request-extra-headers headers) 181 (url-request-data (if kvdata (json-encode kvdata) nil)))
183 (url-request-data (if kvdata (json-encode kvdata) nil))) 182 (with-current-buffer (url-retrieve-synchronously url)
184 (with-current-buffer (url-retrieve-synchronously url) 183 (let ((data (gnus-sync-lesync-parse)))
185 (let ((data (gnus-sync-lesync-parse))) 184 (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
186 (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S" 185 method url `((headers . ,headers) (data ,kvdata)) data)
187 method url `((headers . ,headers) (data ,kvdata)) data) 186 (kill-buffer (current-buffer))
188 (kill-buffer (current-buffer)) 187 data))))
189 data)))))
190 188
191(defun gnus-sync-lesync-PUT (url headers &optional data) 189(defun gnus-sync-lesync-PUT (url headers &optional data)
192 (gnus-sync-lesync-call url "PUT" headers data)) 190 (gnus-sync-lesync-call url "PUT" headers data))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 2171dcf3edc..af5bee2056f 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8141,8 +8141,7 @@ regexp VARSTR."
8141 (if (fboundp 'mail-abbrevs-setup) 8141 (if (fboundp 'mail-abbrevs-setup)
8142 (let ((minibuffer-setup-hook 'mail-abbrevs-setup) 8142 (let ((minibuffer-setup-hook 'mail-abbrevs-setup)
8143 (minibuffer-local-map message-minibuffer-local-map)) 8143 (minibuffer-local-map message-minibuffer-local-map))
8144 (gmm-flet ((mail-abbrev-in-expansion-header-p nil t)) 8144 (read-from-minibuffer prompt initial-contents))
8145 (read-from-minibuffer prompt initial-contents)))
8146 (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook) 8145 (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
8147 (minibuffer-local-map message-minibuffer-local-map)) 8146 (minibuffer-local-map message-minibuffer-local-map))
8148 (read-string prompt initial-contents)))) 8147 (read-string prompt initial-contents))))
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 2e4ffec1383..aa507897243 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -472,10 +472,12 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
472 472
473(defun mail-abbrev-expand-wrapper (expand) 473(defun mail-abbrev-expand-wrapper (expand)
474 (if (and mail-abbrevs (not (eq mail-abbrevs t))) 474 (if (and mail-abbrevs (not (eq mail-abbrevs t)))
475 (if (mail-abbrev-in-expansion-header-p) 475 (if (or (mail-abbrev-in-expansion-header-p)
476 ;; Necessary for `message-read-from-minibuffer' to work.
477 (window-minibuffer-p))
476 478
477 ;; We are in a To: (or CC:, or whatever) header, and 479 ;; We are in a To: (or CC:, or whatever) header or a minibuffer,
478 ;; should use word-abbrevs to expand mail aliases. 480 ;; and should use word-abbrevs to expand mail aliases.
479 (let ((local-abbrev-table mail-abbrevs)) 481 (let ((local-abbrev-table mail-abbrevs))
480 482
481 ;; Before anything else, resolve aliases if they need it. 483 ;; Before anything else, resolve aliases if they need it.