From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.bugs Subject: bug#22317: 25.0.50; mh-e: wrong usage of cl-flet Date: Mon, 30 May 2016 17:18:14 -0700 Organization: Newt Software Message-ID: <40036.1464653894__3306.59603137082$1464653971$gmane$org@olgas.newt.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1464653971 21554 80.91.229.3 (31 May 2016 00:19:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 May 2016 00:19:31 +0000 (UTC) Cc: Katsumi Yamaoka , 22317-done@debbugs.gnu.org, mh-e-devel@lists.sourceforge.net To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 31 02:19:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b7XOx-0003u2-Fh for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2016 02:19:19 +0200 Original-Received: from localhost ([::1]:33706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7XOt-0007mv-E8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 May 2016 20:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7XOm-0007lh-Tn for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 20:19:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7XOh-0007vr-Q6 for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 20:19:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7XOh-0007vV-Mx for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 20:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b7XOg-0005aN-DB; Mon, 30 May 2016 20:19:02 -0400 Resent-From: Bill Wohler Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org, mh-e-devel@lists.sourceforge.net Resent-Date: Tue, 31 May 2016 00:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 22317 X-GNU-PR-Package: emacs,mh-e X-GNU-PR-Keywords: Original-Received: via spool by 22317-done@debbugs.gnu.org id=D22317.146465390421423 (code D ref 22317); Tue, 31 May 2016 00:19:02 +0000 Original-Received: (at 22317-done) by debbugs.gnu.org; 31 May 2016 00:18:24 +0000 Original-Received: from localhost ([127.0.0.1]:47917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7XO4-0005ZT-1Q for submit@debbugs.gnu.org; Mon, 30 May 2016 20:18:24 -0400 Original-Received: from tassie.newt.com ([66.135.33.59]:45637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7XO1-0005ZG-K5 for 22317-done@debbugs.gnu.org; Mon, 30 May 2016 20:18:22 -0400 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 0223A680418; Mon, 30 May 2016 17:18:15 -0700 (PDT) Original-Received: by olgas.newt.com (Postfix, from userid 1000) id 3F593380F76; Mon, 30 May 2016 17:18:14 -0700 (PDT) In-reply-to: Comments: In-reply-to Glenn Morris message dated "Thu, 14 Jan 2016 12:46:20 -0500." 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: mh-e-devel@lists.sourceforge.net Content-ID: <40035.1464653894.1@olgas.newt.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118883 Archived-At: Fixed and committed to emacs-25 release branch: commit 0992ec3b0bfaf98edce1d08462e9ec8e11d6b6e6 Author: Bill Wohler Date: Mon May 30 16:49:37 2016 -0700 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 . * 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. Glenn Morris wrote: > mh-e-devel, FYI: > = > http://debbugs.gnu.org/22317 > = > Katsumi Yamaoka wrote: > = > > Hi, > > > > mh-e uses Gnus functions to render MIME messages and uses the > > mh-cl-flet macro to modify some of them. Currently mh-e always > > loads cl (see mh-acros.el), so both cl-flet and flet are available > > and mh-cl-flet will become cl-flet: > > ,---- > > | ;; Emacs 24 renamed flet to cl-flet. > > | (defalias 'mh-cl-flet > > | (if (fboundp 'cl-flet) > > | 'cl-flet > > | 'flet)) > > `---- > > However, cl-flet is quite unlike flet, IIUC. For instance, if > > cl-flet is used, the mh-cl-flet code in mh-display-emphasis > > ,---- > > | ;; (defun mh-display-emphasis () > > | ;; "Display graphical emphasis." > > | ;; (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p)) > > | (mh-cl-flet > > | ((article-goto-body ())) ; shadow this function to do n= othing > > | (save-excursion > > | (goto-char (point-min)) > > | (article-emphasize))) > > | ;; )) > > `---- > > will be expanded to > > ,---- > > | (progn > > | (save-excursion > > | (goto-char (point-min)) > > | (article-emphasize))) > > `---- > > whereas if flet is used, it will be expanded to: > > ,---- > > | (let* ((vnew (cl-function (lambda nil > > | (cl-block article-goto-body)))) > > | (old (symbol-function 'article-goto-body))) > > | (unwind-protect > > | (progn > > | (fset 'article-goto-body vnew) > > | (save-excursion > > | (goto-char (point-min)) > > | (article-emphasize))) > > | (fset 'article-goto-body old))) > > `---- > > Note that the former doesn't achieve the original target, i.e., > > article-goto-body is not modified while running article-emphasize. > > > > I don't know how it damages the behavior of mh-e, but I think it > > should be fixed anyway. If mh-e keeps loading cl as ever, > > mh-cl-flet can be: > > > > (defalias 'mh-cl-flet 'flet) > > > > Otherwise use this complete Emacs-Lisp style flet emulation macro > > (a copy of gmm-flet that exists in only the Gnus git master): > > > > --8<---------------cut here---------------start------------->8--- > > (defmacro mh-cl-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...)" > > (require 'cl) > > (if (fboundp 'cl-letf) > > `(cl-letf ,(mapcar (lambda (binding) > > `((symbol-function ',(car binding)) > > (lambda ,@(cdr binding)))) > > bindings) > > ,@body) > > `(flet ,bindings ,@body))) > > (put 'mh-cl-flet 'lisp-indent-function 1) > > (put 'mh-cl-flet 'edebug-form-spec > > '((&rest (sexp sexp &rest form)) &rest form)) > > --8<---------------cut here---------------end--------------->8--- > > > > I'm not the right person to install it since I'm not a mh-e user, > > sorry. > > > > Regards, > = > = > = > ------------------------------------------------------------------------= ------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=3D267308311&iu=3D/4140 > _______________________________________________ > mh-e-devel mailing list > mh-e-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mh-e-devel > = -- = Bill Wohler aka http://www.newt.com/wohler/ GnuPG ID:610BD9AD