aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2012-12-05 00:13:56 +0000
committerKatsumi Yamaoka2012-12-05 00:13:56 +0000
commit119191326014fa1aee3d75f83efaabcc819d576a (patch)
tree433cbe5a2088db71e857ec2c2a5b7d471d222f50
parentb2b049bc3783e7de267b194489f0840220a7b78c (diff)
downloademacs-119191326014fa1aee3d75f83efaabcc819d576a.tar.gz
emacs-119191326014fa1aee3d75f83efaabcc819d576a.zip
gmm-utils.el (gmm-flet): Remove.
gnus-sync.el (gnus-sync-lesync-call) message.el (message-read-from-minibuffer): Don't use it.
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/gnus/gmm-utils.el25
-rw-r--r--lisp/gnus/gnus-sync.el26
-rw-r--r--lisp/gnus/message.el10
4 files changed, 31 insertions, 36 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 2d125753c17..af19f607f99 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,9 @@
12012-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gmm-utils.el (gmm-flet): Remove.
4 * gnus-sync.el (gnus-sync-lesync-call)
5 * message.el (message-read-from-minibuffer): Don't use it.
6
12012-12-04 Katsumi Yamaoka <yamaoka@jpl.org> 72012-12-04 Katsumi Yamaoka <yamaoka@jpl.org>
2 8
3 * gmm-utils.el (gmm-labels): Use cl-labels if available. 9 * gmm-utils.el (gmm-labels): Use cl-labels if available.
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 7d6684ca6c1..3357ee42239 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -417,30 +417,11 @@ 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;; `labels' got obsolete since Emacs 24.3.
421(defmacro gmm-flet (bindings &rest body)
422 "Make temporary overriding function definitions.
423
424\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
425 `(let (fn origs)
426 (dolist (bind ',bindings)
427 (setq fn (car bind))
428 (push (cons fn (and (fboundp fn) (symbol-function fn))) origs)
429 (fset fn (cons 'lambda (cdr bind))))
430 (unwind-protect
431 (progn ,@body)
432 (dolist (orig origs)
433 (if (cdr orig)
434 (fset (car orig) (cdr orig))
435 (fmakunbound (car orig)))))))
436(put 'gmm-flet 'lisp-indent-function 1)
437
438(defmacro gmm-labels (bindings &rest body) 421(defmacro gmm-labels (bindings &rest body)
439 "Make temporary function bindings. 422 "Make temporary function bindings.
440The bindings can be recursive and the scoping is lexical, but capturing 423The lexical scoping is handled via `lexical-let' rather than relying
441them in closures will only work if `lexical-binding' is in use. But in 424on `lexical-binding'.
442Emacs 24.2 and older, the lexical scoping is handled via `lexical-let'
443rather than relying on `lexical-binding'.
444 425
445\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" 426\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
446 `(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels)) 427 `(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels))
diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el
index e2a71f0ee01..895a5e4d9a5 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,21 @@ 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 ((orig-json-alist-p (symbol-function 'json-alist-p)))
181 (let ((url-request-method method) 180 (fset 'json-alist-p
182 (url-request-extra-headers headers) 181 (lambda (list) (gnus-sync-json-alist-p list))) ; temp patch
183 (url-request-data (if kvdata (json-encode kvdata) nil))) 182 (unwind-protect
184 (with-current-buffer (url-retrieve-synchronously url) 183 (let ((url-request-method method)
185 (let ((data (gnus-sync-lesync-parse))) 184 (url-request-extra-headers headers)
186 (gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S" 185 (url-request-data (if kvdata (json-encode kvdata) nil)))
187 method url `((headers . ,headers) (data ,kvdata)) data) 186 (with-current-buffer (url-retrieve-synchronously url)
188 (kill-buffer (current-buffer)) 187 (let ((data (gnus-sync-lesync-parse)))
189 data))))) 188 (gnus-message
189 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
190 method url `((headers . ,headers) (data ,kvdata)) data)
191 (kill-buffer (current-buffer))
192 data)))
193 (fset 'json-alist-p orig-json-alist-p))))
190 194
191(defun gnus-sync-lesync-PUT (url headers &optional data) 195(defun gnus-sync-lesync-PUT (url headers &optional data)
192 (gnus-sync-lesync-call url "PUT" headers data)) 196 (gnus-sync-lesync-call url "PUT" headers data))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 2171dcf3edc..03ffe2fb2eb 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8140,9 +8140,13 @@ regexp VARSTR."
8140 "Read from the minibuffer while providing abbrev expansion." 8140 "Read from the minibuffer while providing abbrev expansion."
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 (orig-m-a-i-e-h-p (symbol-function
8145 (read-from-minibuffer prompt initial-contents))) 8145 'mail-abbrev-in-expansion-header-p)))
8146 (fset 'mail-abbrev-in-expansion-header-p (lambda (&rest args) t))
8147 (unwind-protect
8148 (read-from-minibuffer prompt initial-contents)
8149 (fset 'mail-abbrev-in-expansion-header-p orig-m-a-i-e-h-p)))
8146 (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook) 8150 (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
8147 (minibuffer-local-map message-minibuffer-local-map)) 8151 (minibuffer-local-map message-minibuffer-local-map))
8148 (read-string prompt initial-contents)))) 8152 (read-string prompt initial-contents))))