unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Thu, 16 Jun 2011 23:10:26 -0400	[thread overview]
Message-ID: <jwvfwn9p3f6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87oc1xd62s.fsf@gmail.com> (Eric Schulte's message of "Thu, 16 Jun 2011 10:44:27 -0700")

> 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



  reply	other threads:[~2011-06-17  3:10 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 [this message]
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
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=jwvfwn9p3f6.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=schulte.eric@gmail.com \
    /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).