From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.devel Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions Date: Fri, 17 Jun 2011 09:12:59 +0530 Message-ID: <811uytyvgc.fsf@gmail.com> References: <87oc1xd62s.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308282223 26941 80.91.229.12 (17 Jun 2011 03:43:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2011 03:43:43 +0000 (UTC) Cc: Eric Schulte , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 17 05:43:39 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 1QXPy6-00077r-Kr for ged-emacs-devel@m.gmane.org; Fri, 17 Jun 2011 05:43:38 +0200 Original-Received: from localhost ([::1]:41744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXPy5-0006bN-Af for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2011 23:43:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXPxr-0006aJ-QL for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:43:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXPxq-0006ph-Li for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:43:23 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:59078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXPxq-0006pd-Ex for emacs-devel@gnu.org; Thu, 16 Jun 2011 23:43:22 -0400 Original-Received: by pzk4 with SMTP id 4so1826077pzk.0 for ; Thu, 16 Jun 2011 20:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:mail-followup-to :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=RJXH1NhiB71zjJArcJZol13n/+3W5toKBmQB7V0eFnM=; b=hS/89T73F8NVVxcoJERolARd6Lo1tcnW+qqDNzwzZc1uzNV2LsWjKOXTs9ZXcY4mPy RXR7ArT7GIQuJ+RQE90nyn25zzpO0CBbTQxRxzPgPpmbc2WgCvaKpZBycQtV6xjhj4KF gh7uVJ6dBm6yj78BUaECyOcs/1k3RJ+PcPkOc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=eJg5AiN9npIl5unYdBO65ueTY7PKkginFkj4ufhGUKbbRUye989dUsDnPPhHvwzHnf EKpUFmtynLW6G4kytKZzp+K45gudbACh6uhiTD0QotY9bTsqGGR0UGVU6M+MznlCW7WF VDvCxen+iLKkE844G237rMPyckOGw0dbagOwY= Original-Received: by 10.68.27.4 with SMTP id p4mr279551pbg.171.1308282201281; Thu, 16 Jun 2011 20:43:21 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([115.184.79.180]) by mx.google.com with ESMTPS id v6sm1299121pbh.86.2011.06.16.20.43.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2011 20:43:20 -0700 (PDT) Mail-Followup-To: Stefan Monnier , Eric Schulte , emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Thu, 16 Jun 2011 23:10:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.41 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:140583 Archived-At: Stefan Monnier writes: >> 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). I was hoping that there is an elisp equivalent for C-like #if emacs-version > a do this #else do that #endif > > > Stefan > > --