unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Emacs developers <emacs-devel@gnu.org>,
	Lars Ingebrigtsen <larsi@gnus.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: [Emacs-diffs] trunk r113822: Add a test for decompressing gzipped data
Date: Tue, 13 Aug 2013 13:24:47 +0900	[thread overview]
Message-ID: <87li46jjzk.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <CAAeL0STxXG_v8AfryRRyw=mAqAp7FoTxsJu+jtRO6E_TU6+ywA@mail.gmail.com>

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.





  reply	other threads:[~2013-08-13  4:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1V8wyP-0003i5-8r@vcs.savannah.gnu.org>
2013-08-13  1:56 ` [Emacs-diffs] trunk r113822: Add a test for decompressing gzipped data Stefan Monnier
2013-08-13  2:50   ` Eli Zaretskii
2013-08-13  3:45     ` Juanma Barranquero
2013-08-13  4:24       ` Stephen J. Turnbull [this message]
2013-08-13  9:54       ` Lars Magne Ingebrigtsen
2013-08-13 16:02         ` Eli Zaretskii
2013-08-13 16:10           ` Lars Magne Ingebrigtsen
2013-08-13 14:41     ` Stefan Monnier
2013-08-13 14:47       ` Paul Eggert
2013-08-13 16:27         ` Eli Zaretskii
2013-08-13 16:25       ` Eli Zaretskii
2013-08-13 16:30         ` Lars Magne Ingebrigtsen
2013-08-13 16:49         ` Stefan Monnier
2013-08-13 18:04           ` Eli Zaretskii
2013-08-13 18:55             ` Stefan Monnier

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=87li46jjzk.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).