From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#22317: 25.0.50; mh-e: wrong usage of cl-flet Date: Thu, 14 Jan 2016 12:46:20 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452793641 21902 80.91.229.3 (14 Jan 2016 17:47:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Jan 2016 17:47:21 +0000 (UTC) Cc: Katsumi Yamaoka To: 22317@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 14 18:47: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 1aJlzN-00054p-I2 for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jan 2016 18:47:13 +0100 Original-Received: from localhost ([::1]:44024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJlzH-0000In-Rc for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jan 2016 12:47:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJlzD-0000HY-Lc for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2016 12:47:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJlzC-0002YE-F8 for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2016 12:47:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJlzC-0002YA-B8 for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2016 12:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aJlzC-0001WN-5L; Thu, 14 Jan 2016 12:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, mh-e-devel@lists.sourceforge.net Resent-Date: Thu, 14 Jan 2016 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22317 X-GNU-PR-Package: emacs,mh-e X-GNU-PR-Keywords: Original-Received: via spool by 22317-submit@debbugs.gnu.org id=B22317.14527935925802 (code B ref 22317); Thu, 14 Jan 2016 17:47:02 +0000 Original-Received: (at 22317) by debbugs.gnu.org; 14 Jan 2016 17:46:32 +0000 Original-Received: from localhost ([127.0.0.1]:49359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJlyi-0001VW-JL for submit@debbugs.gnu.org; Thu, 14 Jan 2016 12:46:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43519) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJlyh-0001VJ-6E for 22317@debbugs.gnu.org; Thu, 14 Jan 2016 12:46:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJlya-0002UQ-RK for 22317@debbugs.gnu.org; Thu, 14 Jan 2016 12:46:26 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJlya-0002UL-NO; Thu, 14 Jan 2016 12:46:24 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1aJlyX-0006nb-SM; Thu, 14 Jan 2016 12:46:22 -0500 X-Spook: Exon Shell MDA AIEWS Armed Revolutionary Forces Colombia X-Ran: tWE)?x`d6ofH5%32NO$At`AmRc#%OPR^_Ih;!GueQ-&*Sb#)&O2C}A^_A4\0/Rx7=|pbe7 X-Hue: red X-Attribution: GM In-Reply-To: (Katsumi Yamaoka's message of "Wed, 06 Jan 2016 10:01:23 +0900") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:111613 Archived-At: 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 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,