aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2016-05-30 16:49:37 -0700
committerBill Wohler2016-05-30 16:49:37 -0700
commit0992ec3b0bfaf98edce1d08462e9ec8e11d6b6e6 (patch)
treeab6cc9aaf022779c3cff5e58bf5c16df6628c96e
parent50caae30b04edf7da1cb6e1fdba90e9a8aebe041 (diff)
downloademacs-0992ec3b0bfaf98edce1d08462e9ec8e11d6b6e6.tar.gz
emacs-0992ec3b0bfaf98edce1d08462e9ec8e11d6b6e6.zip
Correct cl-flet usage (Bug#22317)
* mh-compat.el: Rename mh-cl-flet to mh-flet and convert alias to macro using patch from Katsumi Yamaoka <yamaoka@jpl.org>. * mh-thread.el (mh-thread-set-tables): * mh-show.el (mh-gnus-article-highlight-citation): * mh-mime.el (mh-display-with-external-viewer): (mh-mime-display, mh-press-button, mh-push-button): (mh-display-emphasis): Call mh-flet instead of mh-cl-flet.
-rw-r--r--lisp/mh-e/mh-compat.el23
-rw-r--r--lisp/mh-e/mh-mime.el10
-rw-r--r--lisp/mh-e/mh-show.el2
-rw-r--r--lisp/mh-e/mh-thread.el2
4 files changed, 25 insertions, 12 deletions
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 10a8b6e219c..21ff5cb2cb8 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -75,11 +75,24 @@ introduced in Emacs 22."
75 'cancel-timer 75 'cancel-timer
76 'delete-itimer)) 76 'delete-itimer))
77 77
78;; Emacs 24 renamed flet to cl-flet. 78;; Emacs 24 made flet obsolete and suggested either cl-flet or
79(defalias 'mh-cl-flet 79;; cl-letf. This macro is based upon gmm-flet from Gnus.
80 (if (fboundp 'cl-flet) 80(defmacro mh-flet (bindings &rest body)
81 'cl-flet 81 "Make temporary overriding function definitions.
82 'flet)) 82This is an analogue of a dynamically scoped `let' that operates on
83the function cell of FUNCs rather than their value cell.
84
85\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
86 (if (fboundp 'cl-letf)
87 `(cl-letf ,(mapcar (lambda (binding)
88 `((symbol-function ',(car binding))
89 (lambda ,@(cdr binding))))
90 bindings)
91 ,@body)
92 `(flet ,bindings ,@body)))
93(put 'mh-flet 'lisp-indent-function 1)
94(put 'mh-flet 'edebug-form-spec
95 '((&rest (sexp sexp &rest form)) &rest form))
83 96
84(defun mh-display-color-cells (&optional display) 97(defun mh-display-color-cells (&optional display)
85 "Return the number of color cells supported by DISPLAY. 98 "Return the number of color cells supported by DISPLAY.
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index df3a42ec0f7..b8d700ddf5f 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -268,7 +268,7 @@ usually reads the file \"/etc/mailcap\"."
268 (buffer-read-only nil)) 268 (buffer-read-only nil))
269 (when (string-match "^[^% \t]+$" method) 269 (when (string-match "^[^% \t]+$" method)
270 (setq method (concat method " %s"))) 270 (setq method (concat method " %s")))
271 (mh-cl-flet 271 (mh-flet
272 ((mm-handle-set-external-undisplayer 272 ((mm-handle-set-external-undisplayer
273 (handle function) 273 (handle function)
274 (mh-handle-set-external-undisplayer folder handle function))) 274 (mh-handle-set-external-undisplayer folder handle function)))
@@ -525,7 +525,7 @@ parsed and then displayed."
525 (let ((handles ()) 525 (let ((handles ())
526 (folder mh-show-folder-buffer) 526 (folder mh-show-folder-buffer)
527 (raw-message-data (buffer-string))) 527 (raw-message-data (buffer-string)))
528 (mh-cl-flet 528 (mh-flet
529 ((mm-handle-set-external-undisplayer 529 ((mm-handle-set-external-undisplayer
530 (handle function) 530 (handle function)
531 (mh-handle-set-external-undisplayer folder handle function))) 531 (mh-handle-set-external-undisplayer folder handle function)))
@@ -1049,7 +1049,7 @@ attachment, the attachment is hidden."
1049 (function (get-text-property (point) 'mh-callback)) 1049 (function (get-text-property (point) 'mh-callback))
1050 (buffer-read-only nil) 1050 (buffer-read-only nil)
1051 (folder mh-show-folder-buffer)) 1051 (folder mh-show-folder-buffer))
1052 (mh-cl-flet 1052 (mh-flet
1053 ((mm-handle-set-external-undisplayer 1053 ((mm-handle-set-external-undisplayer
1054 (handle function) 1054 (handle function)
1055 (mh-handle-set-external-undisplayer folder handle function))) 1055 (mh-handle-set-external-undisplayer folder handle function)))
@@ -1070,7 +1070,7 @@ to click the MIME button."
1070 (mm-inline-media-tests mh-mm-inline-media-tests) 1070 (mm-inline-media-tests mh-mm-inline-media-tests)
1071 (data (get-text-property (point) 'mh-data)) 1071 (data (get-text-property (point) 'mh-data))
1072 (function (get-text-property (point) 'mh-callback))) 1072 (function (get-text-property (point) 'mh-callback)))
1073 (mh-cl-flet 1073 (mh-flet
1074 ((mm-handle-set-external-undisplayer 1074 ((mm-handle-set-external-undisplayer
1075 (handle func) 1075 (handle func)
1076 (mh-handle-set-external-undisplayer folder handle func))) 1076 (mh-handle-set-external-undisplayer folder handle func)))
@@ -1166,7 +1166,7 @@ this ;-)"
1166(defun mh-display-emphasis () 1166(defun mh-display-emphasis ()
1167 "Display graphical emphasis." 1167 "Display graphical emphasis."
1168 (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p)) 1168 (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p))
1169 (mh-cl-flet 1169 (mh-flet
1170 ((article-goto-body ())) ; shadow this function to do nothing 1170 ((article-goto-body ())) ; shadow this function to do nothing
1171 (save-excursion 1171 (save-excursion
1172 (goto-char (point-min)) 1172 (goto-char (point-min))
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index afe9812eea8..26e821696a8 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -900,7 +900,7 @@ See also `mh-folder-mode'.
900 (interactive) 900 (interactive)
901 ;; Don't allow Gnus to create buttons while highlighting, maybe this is bad 901 ;; Don't allow Gnus to create buttons while highlighting, maybe this is bad
902 ;; style? 902 ;; style?
903 (mh-cl-flet 903 (mh-flet
904 ((gnus-article-add-button (&rest args) nil)) 904 ((gnus-article-add-button (&rest args) nil))
905 (let* ((modified (buffer-modified-p)) 905 (let* ((modified (buffer-modified-p))
906 (gnus-article-buffer (buffer-name)) 906 (gnus-article-buffer (buffer-name))
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index 5135e7e88fa..e6acdba8b30 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -647,7 +647,7 @@ Only information about messages in MSG-LIST are added to the tree."
647 647
648(defun mh-thread-set-tables (folder) 648(defun mh-thread-set-tables (folder)
649 "Use the tables of FOLDER in current buffer." 649 "Use the tables of FOLDER in current buffer."
650 (mh-cl-flet 650 (mh-flet
651 ((mh-get-table (symbol) 651 ((mh-get-table (symbol)
652 (with-current-buffer folder 652 (with-current-buffer folder
653 (symbol-value symbol)))) 653 (symbol-value symbol))))