From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el (gmm-flet, gmm-labels): New macros. Date: Tue, 04 Dec 2012 13:52:28 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354647179 733 80.91.229.3 (4 Dec 2012 18:52:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2012 18:52:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Katsumi Yamaoka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 04 19:53:12 2012 Return-path: Envelope-to: ged-emacs-devel@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 1TfxcA-000319-Rr for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2012 19:53:06 +0100 Original-Received: from localhost ([::1]:47429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfxbz-00035O-4f for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2012 13:52:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfxbk-0002xa-4o for emacs-devel@gnu.org; Tue, 04 Dec 2012 13:52:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tfxba-0004EX-48 for emacs-devel@gnu.org; Tue, 04 Dec 2012 13:52:40 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:26260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfxbZ-0004EG-Ua for emacs-devel@gnu.org; Tue, 04 Dec 2012 13:52:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09soXOY/2dsb2JhbABEtBGBCIIWAQVWIxALNBIUGA0kiCG6CZBEA4hCmnGBWIMHgTga X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="209070120" Original-Received: from 108-161-115-152.dsl.teksavvy.com (HELO pastel.home) ([108.161.115.152]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Dec 2012 13:52:29 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B4CCB58C73; Tue, 4 Dec 2012 13:52:28 -0500 (EST) In-Reply-To: (Katsumi Yamaoka's message of "Tue, 04 Dec 2012 08:22:12 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155256 Archived-At: > +;; `flet' and `labels' got obsolete since Emacs 24.3. > +(defmacro gmm-flet (bindings &rest body) > + "Make temporary overriding function definitions. > + > +\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" > + `(let (fn origs) > + (dolist (bind ',bindings) > + (setq fn (car bind)) > + (push (cons fn (and (fboundp fn) (symbol-function fn))) origs) > + (fset fn (cons 'lambda (cdr bind)))) > + (unwind-protect > + (progn ,@body) > + (dolist (orig origs) > + (if (cdr orig) > + (fset (car orig) (cdr orig)) > + (fmakunbound (car orig))))))) > +(put 'gmm-flet 'lisp-indent-function 1) Nooooooooooooooo!!!!!!!!! Please don't! If you really can't stand the warning, then just do something like (defmacro gmm-flet (&rest r) (if (fboundp 'cl-flet) `(cl-flet ,@r) `(flet ,@r))) After making sure that your uses of `flet' are compatible with `cl-flet' and the other uses are changed to use something like (cl-)letf or (better) defadvice. Same for gmm-labels! Stefan