unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Mon, 20 Jun 2011 09:53:04 +0200	[thread overview]
Message-ID: <87aaddvt0f.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 811uytyvgc.fsf@gmail.com

Jambunathan K <kjambunathan@gmail.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> 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




  parent reply	other threads:[~2011-06-20  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 17:44 How to fix Emacs24 compiler warning w/o breaking code for previous versions Eric Schulte
2011-06-17  3:10 ` Stefan Monnier
2011-06-17  3:42   ` Jambunathan K
2011-06-17  6:34     ` Stephen J. Turnbull
2011-06-17  7:17       ` Eli Zaretskii
2011-06-19 21:14     ` Daniel Colascione
2011-06-20  7:53     ` David Kastrup [this message]
2011-06-17  4:45   ` Eric Schulte
2011-06-17  7:19 ` David Engster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aaddvt0f.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).