From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Schulte Newsgroups: gmane.emacs.devel Subject: How to fix Emacs24 compiler warning w/o breaking code for previous versions Date: Thu, 16 Jun 2011 10:44:27 -0700 Message-ID: <87oc1xd62s.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308251070 29652 80.91.229.12 (16 Jun 2011 19:04:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Jun 2011 19:04:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 16 21:04:25 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 1QXHrZ-0004fB-KK for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2011 21:04:21 +0200 Original-Received: from localhost ([::1]:55655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXHrY-0007G9-JS for ged-emacs-devel@m.gmane.org; Thu, 16 Jun 2011 15:04:20 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:34864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXGcM-0003BA-HF for emacs-devel@gnu.org; Thu, 16 Jun 2011 13:44:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXGcK-0001Yy-Oi for emacs-devel@gnu.org; Thu, 16 Jun 2011 13:44:34 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:50497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXGcK-0001Yu-El for emacs-devel@gnu.org; Thu, 16 Jun 2011 13:44:32 -0400 Original-Received: by pzk4 with SMTP id 4so1542646pzk.0 for ; Thu, 16 Jun 2011 10:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=qPAwztnyT+UVN36SERUuO04E5ntooRuz1ZCheS+Wm+8=; b=WJqOn1yOZ9OBaNEdedASZZEcHHvMY2jb466L5S+Mglhdx8ZNVMNccr+kjuteKJW4uu iifHuKuoAf3FCHYrE15syp+xgUFDfWzOZCiS+C6YNXprI/s8L2xqDv7UNpgVQFnNMF3b wvECo1r41HoQdeszI1ICkXiXejll7TylLXTlQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=e+qm5qmmkN61TBnSSa+wjSHZqlmdowGDM2gHinXGiWc0tK2e6Oagx1pKSXikU30ilS 8IceXedKBf4lugNq9/ZzCJwlvoOHzzRPfKmrP9Ilpm0d4N7jpYYCEe7NEBS2bOHrXa3H yO+LDBjqPKe2Sb9IefLLh7dcB4EgBdyDN7Ezs= Original-Received: by 10.142.173.5 with SMTP id v5mr254138wfe.66.1308246271126; Thu, 16 Jun 2011 10:44:31 -0700 (PDT) Original-Received: from bagel ([66.201.54.34]) by mx.google.com with ESMTPS id x8sm1840826wfx.7.2011.06.16.10.44.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2011 10:44:30 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) 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:140564 Archived-At: Hi, 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? Here are two examples. On Emacs23 the `filter-buffer-substring-functions' variable (introduced in May of 2010) is preferred over the `buffer-substring-filters' function which is now deprecated. Using the former breaks all prior Emacsen while using the later throws compiler warnings on Emacs24. Similarly, the `interactive-p' function is now defunct and not liked by the byte compiler, however the suggested replacement function `called-interactive-p' requires an argument in Emacs24, and accepts no arguments in Emacs22. The obvious solution here would be to replace both of these instances with new Org-mode functions which check either Emacs version or check for existence/definition of the relevant variable/function and then behave accordingly. That however seems uglier than just using the deprecated version of these functions. Any advice is greatly appreciated. Thanks -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/