[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111099: gmm-utils.el (gmm-flet): Rem
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111099: gmm-utils.el (gmm-flet): Remove. |
Date: |
Wed, 05 Dec 2012 00:13:56 +0000 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111099
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Wed 2012-12-05 00:13:56 +0000
message:
gmm-utils.el (gmm-flet): Remove.
gnus-sync.el (gnus-sync-lesync-call)
message.el (message-read-from-minibuffer): Don't use it.
modified:
lisp/gnus/ChangeLog
lisp/gnus/gmm-utils.el
lisp/gnus/gnus-sync.el
lisp/gnus/message.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2012-12-04 23:24:24 +0000
+++ b/lisp/gnus/ChangeLog 2012-12-05 00:13:56 +0000
@@ -1,3 +1,9 @@
+2012-12-05 Katsumi Yamaoka <address@hidden>
+
+ * gmm-utils.el (gmm-flet): Remove.
+ * gnus-sync.el (gnus-sync-lesync-call)
+ * message.el (message-read-from-minibuffer): Don't use it.
+
2012-12-04 Katsumi Yamaoka <address@hidden>
* gmm-utils.el (gmm-labels): Use cl-labels if available.
=== modified file 'lisp/gnus/gmm-utils.el'
--- a/lisp/gnus/gmm-utils.el 2012-12-04 23:33:24 +0000
+++ b/lisp/gnus/gmm-utils.el 2012-12-05 00:13:56 +0000
@@ -417,30 +417,11 @@
(write-region start end filename append visit lockname))
(write-region start end filename append visit lockname mustbenew)))
-;; `flet' and `labels' got obsolete since Emacs 24.3.
-(defmacro gmm-flet (bindings &rest body)
- "Make temporary overriding function definitions.
-
-\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
- `(let (fn origs)
- (dolist (bind ',bindings)
- (setq fn (car bind))
- (push (cons fn (and (fboundp fn) (symbol-function fn))) origs)
- (fset fn (cons 'lambda (cdr bind))))
- (unwind-protect
- (progn ,@body)
- (dolist (orig origs)
- (if (cdr orig)
- (fset (car orig) (cdr orig))
- (fmakunbound (car orig)))))))
-(put 'gmm-flet 'lisp-indent-function 1)
-
+;; `labels' got 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
-them in closures will only work if `lexical-binding' is in use. But in
-Emacs 24.2 and older, the lexical scoping is handled via `lexical-let'
-rather than relying on `lexical-binding'.
+The lexical scoping is handled via `lexical-let' rather than relying
+on `lexical-binding'.
\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
`(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels))
=== modified file 'lisp/gnus/gnus-sync.el'
--- a/lisp/gnus/gnus-sync.el 2012-12-04 08:22:12 +0000
+++ b/lisp/gnus/gnus-sync.el 2012-12-05 00:13:56 +0000
@@ -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,21 @@
(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 ((orig-json-alist-p (symbol-function 'json-alist-p)))
+ (fset 'json-alist-p
+ (lambda (list) (gnus-sync-json-alist-p list))) ; temp patch
+ (unwind-protect
+ (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)))
+ (fset 'json-alist-p orig-json-alist-p))))
(defun gnus-sync-lesync-PUT (url headers &optional data)
(gnus-sync-lesync-call url "PUT" headers data))
=== modified file 'lisp/gnus/message.el'
--- a/lisp/gnus/message.el 2012-12-04 08:22:12 +0000
+++ b/lisp/gnus/message.el 2012-12-05 00:13:56 +0000
@@ -8140,9 +8140,13 @@
"Read from the minibuffer while providing abbrev expansion."
(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)))
+ (minibuffer-local-map message-minibuffer-local-map)
+ (orig-m-a-i-e-h-p (symbol-function
+ 'mail-abbrev-in-expansion-header-p)))
+ (fset 'mail-abbrev-in-expansion-header-p (lambda (&rest args) t))
+ (unwind-protect
+ (read-from-minibuffer prompt initial-contents)
+ (fset 'mail-abbrev-in-expansion-header-p orig-m-a-i-e-h-p)))
(let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
(minibuffer-local-map message-minibuffer-local-map))
(read-string prompt initial-contents))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111099: gmm-utils.el (gmm-flet): Remove.,
Katsumi Yamaoka <=