Avoid letf macro use from Gnus
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 6 Dec 2012 03:30:23 +0000 (03:30 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 6 Dec 2012 03:30:23 +0000 (03:30 +0000)
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.

lisp/ChangeLog
lisp/gnus/ChangeLog
lisp/gnus/gmm-utils.el
lisp/gnus/gnus-sync.el
lisp/gnus/message.el
lisp/mail/mailabbrev.el

index cb5118c..3c0f28d 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mail/mailabbrev.el (mail-abbrev-expand-wrapper): Work in minibuffer
+       so as to enable message-read-from-minibuffer to expand mail aliases.
+
 2012-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuf-eldef.el (minibuf-eldef-update-minibuffer): Don't mess with
index 522c688..0dde5f6 100644 (file)
@@ -1,3 +1,13 @@
+2012-12-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gmm-utils.el (gmm-flet): Remove.
+
+       * gnus-sync.el (gnus-sync-lesync-call):
+       Avoid overriding json-alist-p.
+
+       * message.el (message-read-from-minibuffer):
+       Avoid overriding mail-abbrev-in-expansion-header-p.
+
 2012-12-05  Sam Steingold  <sds@gnu.org>
 
        * gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'.
index 91e4965..92a3925 100644 (file)
@@ -417,23 +417,7 @@ coding-system."
        (write-region start end filename append visit lockname))
     (write-region start end filename append visit lockname mustbenew)))
 
-;; `flet' and `labels' are obsolete since Emacs 24.3.
-(defmacro gmm-flet (bindings &rest body)
-  "Make temporary overriding function definitions.
-This is an analogue of a dynamically scoped `let' that operates on
-the function cell of FUNCs rather than their value cell.
-
-\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
-  (require 'cl)
-  (if (fboundp 'cl-letf)
-      `(cl-letf ,(mapcar (lambda (binding)
-                          `((symbol-function ',(car binding))
-                            (lambda ,@(cdr binding))))
-                        bindings)
-        ,@body)
-    `(flet ,bindings ,@body)))
-(put 'gmm-flet 'lisp-indent-function 1)
-
+;; `labels' is obsolete since Emacs 24.3.
 (defmacro gmm-labels (bindings &rest body)
   "Make temporary function bindings.
 The bindings can be recursive and the scoping is lexical, but capturing
index e2a71f0..0ec9fed 100644 (file)
@@ -88,7 +88,6 @@
 (require 'gnus)
 (require 'gnus-start)
 (require 'gnus-util)
-(require 'gmm-utils)
 
 (defvar gnus-topic-alist) ;; gnus-group.el
 (eval-when-compile
@@ -177,16 +176,15 @@ and `gnus-topic-alist'.  Also see `gnus-variable-list'."
 (defun gnus-sync-lesync-call (url method headers &optional kvdata)
   "Make an access request to URL using KVDATA and METHOD.
 KVDATA must be an alist."
-  (gmm-flet ((json-alist-p (list) (gnus-sync-json-alist-p list))) ; temp patch
-    (let ((url-request-method method)
-          (url-request-extra-headers headers)
-          (url-request-data (if kvdata (json-encode kvdata) nil)))
-      (with-current-buffer (url-retrieve-synchronously url)
-        (let ((data (gnus-sync-lesync-parse)))
-          (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
-                        method url `((headers . ,headers) (data ,kvdata)) data)
-          (kill-buffer (current-buffer))
-          data)))))
+  (let ((url-request-method method)
+       (url-request-extra-headers headers)
+       (url-request-data (if kvdata (json-encode kvdata) nil)))
+    (with-current-buffer (url-retrieve-synchronously url)
+      (let ((data (gnus-sync-lesync-parse)))
+       (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
+                     method url `((headers . ,headers) (data ,kvdata)) data)
+       (kill-buffer (current-buffer))
+       data))))
 
 (defun gnus-sync-lesync-PUT (url headers &optional data)
   (gnus-sync-lesync-call url "PUT" headers data))
index 2171dcf..af5bee2 100644 (file)
@@ -8141,8 +8141,7 @@ regexp VARSTR."
   (if (fboundp 'mail-abbrevs-setup)
       (let ((minibuffer-setup-hook 'mail-abbrevs-setup)
            (minibuffer-local-map message-minibuffer-local-map))
-       (gmm-flet ((mail-abbrev-in-expansion-header-p nil t))
-         (read-from-minibuffer prompt initial-contents)))
+       (read-from-minibuffer prompt initial-contents))
     (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
          (minibuffer-local-map message-minibuffer-local-map))
       (read-string prompt initial-contents))))
index 2e4ffec..aa50789 100644 (file)
@@ -472,10 +472,12 @@ of a mail alias.  The value is set up, buffer-local, when first needed.")
 
 (defun mail-abbrev-expand-wrapper (expand)
   (if (and mail-abbrevs (not (eq mail-abbrevs t)))
-      (if (mail-abbrev-in-expansion-header-p)
+      (if (or (mail-abbrev-in-expansion-header-p)
+             ;; Necessary for `message-read-from-minibuffer' to work.
+             (window-minibuffer-p))
 
-          ;; We are in a To: (or CC:, or whatever) header, and
-          ;; should use word-abbrevs to expand mail aliases.
+          ;; We are in a To: (or CC:, or whatever) header or a minibuffer,
+          ;; and should use word-abbrevs to expand mail aliases.
           (let ((local-abbrev-table mail-abbrevs))
 
             ;; Before anything else, resolve aliases if they need it.