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: How to fix Emacs24 compiler warning w/o breaking code for previous versions Date: Thu, 16 Jun 2011 23:10:26 -0400 Message-ID: References: <87oc1xd62s.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308280252 18692 80.91.229.12 (17 Jun 2011 03:10:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2011 03:10:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eric Schulte Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 17 05:10:49 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QXPSK-0003CW-Mo for ged-emacs-devel@m.gmane.org; Fri, 17 Jun 2011 05:10:48 +0200 Original-Received: from localhost ([::1]:42143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXPSJ-0003M5-G7 for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2011 23:10:47 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXPS1-0003Lg-LS for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:10:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXPRz-0001eY-MS for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:10:29 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:21548 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXPRz-0001eU-CC for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:10:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EADzE+k1FpZvP/2dsb2JhbABSpmt4iHPBBoYnBJ1YhB8 X-IronPort-AV: E=Sophos;i="4.65,379,1304308800"; d="scan'208";a="116499579" Original-Received: from 69-165-155-207.dsl.teksavvy.com (HELO ceviche.home) ([69.165.155.207]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 16 Jun 2011 23:10:26 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 40F4666234; Fri, 17 Jun 2011 00:10:26 -0300 (ART) In-Reply-To: <87oc1xd62s.fsf@gmail.com> (Eric Schulte's message of "Thu, 16 Jun 2011 10:44:27 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:140580 Archived-At: > I've been working to address the elisp byte-compiler warnings thrown > while compiling the current Org-mode head, and I do not know how to > address cases where the byte-compiler insists on usage of a new feature > not present in older Emacsen without breaking Org-mode support of those > Emacsen. I'm writing to ask for the "best practices" approach? IMNSHO: - The simplest solution is to only support a single or a very limited number of Emacs versions. - Another good one is to support many versions, only pay attention to warnings in the most recent supported version, and accept some warnings as "better have the warnings than break backward compatibility". - The next best one is to do as above except that you additionally wrap the remaining warnings in `with-no-warnings' (and regularly remove those `with-no-warnings' to remind you of the problems you can't fix yet because of backward compatibility). I strongly recommend against aiming to silence warnings on all the supported Emacs versions. It's a waste of time and leads to poor code (e.g. ugly/brittle byte-compiler hacks, cc-bytecomp comes to mind, I'd better stop here or I'll have nightmares again). Stefan