From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions Date: Mon, 20 Jun 2011 09:53:04 +0200 Organization: Organization?!? Message-ID: <87aaddvt0f.fsf@fencepost.gnu.org> References: <87oc1xd62s.fsf@gmail.com> <811uytyvgc.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308556549 13018 80.91.229.12 (20 Jun 2011 07:55:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2011 07:55:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 20 09:55:45 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 1QYZKf-0007x0-Ir for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2011 09:55:41 +0200 Original-Received: from localhost ([::1]:49067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYZKe-0005eB-GY for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2011 03:55:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYZIR-0005JH-KD for emacs-devel@gnu.org; Mon, 20 Jun 2011 03:53:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYZIQ-00031W-2P for emacs-devel@gnu.org; Mon, 20 Jun 2011 03:53:23 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYZIP-00031Q-EG for emacs-devel@gnu.org; Mon, 20 Jun 2011 03:53:21 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QYZIK-0006zH-Qx for emacs-devel@gnu.org; Mon, 20 Jun 2011 09:53:16 +0200 Original-Received: from p508edbd0.dip.t-dialin.net ([80.142.219.208]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2011 09:53:16 +0200 Original-Received: from dak by p508edbd0.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2011 09:53:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508edbd0.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:XU0FnqPxcTZcdMfvwS+n42ghRHE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:140707 Archived-At: Jambunathan K writes: > 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 (if (version<= "21.0" emacs-version) -- David Kastrup