From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#22317: 25.0.50; mh-e: wrong usage of cl-flet Date: Wed, 06 Jan 2016 10:01:23 +0900 Organization: Emacsen advocacy group Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1452042206 24760 80.91.229.3 (6 Jan 2016 01:03:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jan 2016 01:03:26 +0000 (UTC) To: 22317@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 06 02:03:14 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 1aGcVM-0007UI-HD for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jan 2016 02:03:12 +0100 Original-Received: from localhost ([::1]:52107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGcVL-0005et-Qb for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2016 20:03:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGcVH-0005ec-OR for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:03:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGcVC-0005tg-JJ for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:03:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGcVC-0005tc-Fo for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aGcVC-0001Bx-9t for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jan 2016 01:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22317 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14520421274518 (code B ref -1); Wed, 06 Jan 2016 01:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jan 2016 01:02:07 +0000 Original-Received: from localhost ([127.0.0.1]:39293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGcUJ-0001An-7a for submit@debbugs.gnu.org; Tue, 05 Jan 2016 20:02:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54588) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGcUH-0001AH-GY for submit@debbugs.gnu.org; Tue, 05 Jan 2016 20:02:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGcUB-0005nL-CA for submit@debbugs.gnu.org; Tue, 05 Jan 2016 20:02:00 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGcUB-0005nF-9k for submit@debbugs.gnu.org; Tue, 05 Jan 2016 20:01:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGcUA-0005Nb-7q for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:01:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGcU5-0005lC-6c for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:01:58 -0500 Original-Received: from mail-hampton.hostforweb.net ([205.234.186.191]:59233 helo=hampton.hostforweb.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGcU5-0005gb-2K for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 20:01:53 -0500 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:62745 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.86) (envelope-from ) id 1aGcTG-000RHF-F7; Tue, 05 Jan 2016 19:01:06 -0600 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.130014 (=?UTF-8?Q?=E7=9C=9F?= Gnus v0.14) Emacs/25.0.50 (i686-pc-cygwin) Cancel-Lock: sha1:80+ZQKJGPzlDm6/OPt2KW7LEtbE= X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: authenticated_id: yamaoka/from_h X-Authenticated-Sender: hampton.hostforweb.net: yamaoka@jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111280 Archived-At: 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 nothing | (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,