From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r113822: Add a test for decompressing gzipped data Date: Tue, 13 Aug 2013 13:24:47 +0900 Message-ID: <87li46jjzk.fsf@uwakimon.sk.tsukuba.ac.jp> References: <83iozapan0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1376367931 18883 80.91.229.3 (13 Aug 2013 04:25:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Aug 2013 04:25:31 +0000 (UTC) Cc: Eli Zaretskii , Emacs developers , Lars Ingebrigtsen , Stefan Monnier To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 13 06:25:32 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V96Ak-0000QU-KF for ged-emacs-devel@m.gmane.org; Tue, 13 Aug 2013 06:25:30 +0200 Original-Received: from localhost ([::1]:44616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V96Ak-0002ue-48 for ged-emacs-devel@m.gmane.org; Tue, 13 Aug 2013 00:25:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V96AX-0002j9-SV for emacs-devel@gnu.org; Tue, 13 Aug 2013 00:25:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V96AQ-0005vF-JW for emacs-devel@gnu.org; Tue, 13 Aug 2013 00:25:17 -0400 Original-Received: from mgmt2.sk.tsukuba.ac.jp ([130.158.97.224]:36627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V96AH-0005aA-Ia; Tue, 13 Aug 2013 00:25:01 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt2.sk.tsukuba.ac.jp (Postfix) with ESMTP id DC4DF970972; Tue, 13 Aug 2013 13:24:47 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 9FAE51A3D92; Tue, 13 Aug 2013 13:24:47 +0900 (JST) In-Reply-To: X-Mailer: VM undefined under 21.5 (beta32) "habanero" b0d40183ac79 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 130.158.97.224 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:162648 Archived-At: Juanma Barranquero writes: > In other words, portable elisp code should really do > > (and (fboundp 'zlib-available-p) (zlib-available-p)) > > to check for zlib support. Perhaps it would be worth to encapsulate > that check into (yet another) predicate... XEmacs has an if-fboundp macro which does the above, but it's ugly. I prefer extending the #'featurep mechanism to optionally do such checks. Eg, ;;; There's Fprovide(symbol) and Fput(Fintern("symbol"), ;;; Fintern("availability-predicate"), ;;; availability_predicate_DEFUN_symbol)) ;;; conditionally compiled on --with-symbol in the startup code. (defun feature-available-p (symbol) (and (featurep symbol) ;; I'm a ba-a-ad boy. (funcall (get symbol 'availability-predicate (lambda ()))))) Contributed to XEmacs under my agreement with the FSF. Ie, now copyright 2013 FSF. There may be better ways of spelling all this, of course.