emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to fix Emacs24 compiler warning w/o breaking code for previous v


From: Jambunathan K
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Fri, 17 Jun 2011 09:12:59 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)

Stefan Monnier <address@hidden> 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
>
>

-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]