summaryrefslogtreecommitdiff
path: root/lisp/mh-e
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-05-31 08:07:41 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-05-31 08:07:41 -0700
commit25cc0f2aada3e321e5f1c6d1e492a93d16da45b2 (patch)
tree05309a9d1d74813cf25073015ef7aaf36d7a36bf /lisp/mh-e
parent4efef3db2fb1c3a20b83a67948e614d9b0c258dd (diff)
parent788c9b69e1801dd883dbe603281571ef3c78a724 (diff)
downloademacs-25cc0f2aada3e321e5f1c6d1e492a93d16da45b2.tar.gz
Merge from origin/emacs-25
788c9b6 ; Spelling fix 25c4a30 * lisp/recentf.el (recentf-dialog-mode-map): Remove follow-li... 0992ec3 Correct cl-flet usage (Bug#22317) 50caae3 Release MH-E manual version 8.6 602bb40 Update MH-E's documentation about HTML renderers 89018f0 Fx the we->the typo 845ee57 Restore frames into the current display by default ee28b4c * lisp/recentf.el (recentf-open-files-item): Quick fix for (b... 01c3cd1 etc/TODO: Remove out-of-place issue 5e18486 Clarify doc string of 'file-name-sans-extension' bffda22 Fix the MSDOS build f907f98 * lisp/progmodes/elisp-mode.el (elisp-function-argstring): Ca... 1a2ffd0 * src/dired.c (Ffile_name_all_completions): Doc fix. (Bug#23... f7ffc4b Fix infloop in 'number-sequence' 4ab2673 ; Spelling and punctuation fixes in comments 71c152e * lisp/emacs-lisp/find-func.el (find-function-library):
Diffstat (limited to 'lisp/mh-e')
-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."
'cancel-timer
'delete-itimer))
-;; Emacs 24 renamed flet to cl-flet.
-(defalias 'mh-cl-flet
- (if (fboundp 'cl-flet)
- 'cl-flet
- 'flet))
+;; Emacs 24 made flet obsolete and suggested either cl-flet or
+;; cl-letf. This macro is based upon gmm-flet from Gnus.
+(defmacro mh-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...)"
+ (if (fboundp 'cl-letf)
+ `(cl-letf ,(mapcar (lambda (binding)
+ `((symbol-function ',(car binding))
+ (lambda ,@(cdr binding))))
+ bindings)
+ ,@body)
+ `(flet ,bindings ,@body)))
+(put 'mh-flet 'lisp-indent-function 1)
+(put 'mh-flet 'edebug-form-spec
+ '((&rest (sexp sexp &rest form)) &rest form))
(defun mh-display-color-cells (&optional display)
"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\"."
(buffer-read-only nil))
(when (string-match "^[^% \t]+$" method)
(setq method (concat method " %s")))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle function)
(mh-handle-set-external-undisplayer folder handle function)))
@@ -525,7 +525,7 @@ parsed and then displayed."
(let ((handles ())
(folder mh-show-folder-buffer)
(raw-message-data (buffer-string)))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle function)
(mh-handle-set-external-undisplayer folder handle function)))
@@ -1049,7 +1049,7 @@ attachment, the attachment is hidden."
(function (get-text-property (point) 'mh-callback))
(buffer-read-only nil)
(folder mh-show-folder-buffer))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle function)
(mh-handle-set-external-undisplayer folder handle function)))
@@ -1070,7 +1070,7 @@ to click the MIME button."
(mm-inline-media-tests mh-mm-inline-media-tests)
(data (get-text-property (point) 'mh-data))
(function (get-text-property (point) 'mh-callback)))
- (mh-cl-flet
+ (mh-flet
((mm-handle-set-external-undisplayer
(handle func)
(mh-handle-set-external-undisplayer folder handle func)))
@@ -1166,7 +1166,7 @@ this ;-)"
(defun mh-display-emphasis ()
"Display graphical emphasis."
(when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p))
- (mh-cl-flet
+ (mh-flet
((article-goto-body ())) ; shadow this function to do nothing
(save-excursion
(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'.
(interactive)
;; Don't allow Gnus to create buttons while highlighting, maybe this is bad
;; style?
- (mh-cl-flet
+ (mh-flet
((gnus-article-add-button (&rest args) nil))
(let* ((modified (buffer-modified-p))
(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."
(defun mh-thread-set-tables (folder)
"Use the tables of FOLDER in current buffer."
- (mh-cl-flet
+ (mh-flet
((mh-get-table (symbol)
(with-current-buffer folder
(symbol-value symbol))))