From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.mail.mh-e.devel,gmane.emacs.devel Subject: Where to put fix for #22317, mh-e: wrong usage of cl-flet Date: Sun, 01 May 2016 19:19:48 -0700 Organization: Newt Software Message-ID: <83602.1462155588@olgas.newt.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1462155608 25697 80.91.229.3 (2 May 2016 02:20:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 May 2016 02:20:08 +0000 (UTC) Cc: mh-e-devel@lists.sourceforge.net To: emacs-devel@gnu.org Original-X-From: mh-e-devel-bounces@lists.sourceforge.net Mon May 02 04:20:00 2016 Return-path: Envelope-to: gmmd-mh-e-devel@m.gmane.org Original-Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ax3Sp-0005mn-Jr for gmmd-mh-e-devel@m.gmane.org; Mon, 02 May 2016 04:19:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ax3So-0006Q5-Gl; Mon, 02 May 2016 02:19:58 +0000 Original-Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ax3Sn-0006Q0-8V for mh-e-devel@lists.sourceforge.net; Mon, 02 May 2016 02:19:57 +0000 X-ACL-Warn: Original-Received: from tassie.newt.com ([66.135.33.59]) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1ax3Sm-0001Ow-8P for mh-e-devel@lists.sourceforge.net; Mon, 02 May 2016 02:19:57 +0000 Original-Received: from olgas.newt.com (c-73-15-2-218.hsd1.ca.comcast.net [73.15.2.218]) by tassie.newt.com (Postfix) with ESMTPSA id 7D5F96801E4; Sun, 1 May 2016 19:19:50 -0700 (PDT) Original-Received: by olgas.newt.com (Postfix, from userid 1000) id 8C633381750; Sun, 1 May 2016 19:19:48 -0700 (PDT) X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 24.4.1 X-Image-URL: http://www.newt.com/wohler/images/bill-diving.png Mail-Followup-To: emacs-devel@gnu.org, mh-e-devel@lists.sourceforge.net X-Spam-Score: -1.1 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ax3Sm-0001Ow-8P X-BeenThere: mh-e-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Forum for the MH-E developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: mh-e-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.mail.mh-e.devel:13885 gmane.emacs.devel:203512 Archived-At: --=-=-= Content-Type: text/plain I've applied Katsumi's fix to MH-E and have been using it for a while now. I haven't noticed any difference. Please consider the following short patch and recommend whether I should 1) apply it to emacs-25, 2) apply it to master, or 3) apply it to master with a note to apply it to emacs-25 after the release. If 3), please suggest specific text that catches your attention. -- Bill Wohler aka http://www.newt.com/wohler/ GnuPG ID:610BD9AD --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=22317.diff diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 10a8b6e..21ff5cb 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -75,11 +75,24 @@ 'mh-cancel-timer '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 df3a42e..b8d700d 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -268,7 +268,7 @@ mh-display-with-external-viewer (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 @@ mh-mime-display (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 @@ mh-press-button (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 @@ mh-push-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 @@ mh-display-smileys (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 afe9812..26e8216 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -900,7 +900,7 @@ mh-gnus-article-highlight-citation (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 5135e7e..e6acdba 100644 --- a/lisp/mh-e/mh-thread.el +++ b/lisp/mh-e/mh-thread.el @@ -647,7 +647,7 @@ mh-thread-generate (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)))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ mh-e-devel mailing list mh-e-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mh-e-devel --=-=-=--