unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: What's the right way to detect libxml2?
Date: Sun, 22 Oct 2017 10:14:44 -0400	[thread overview]
Message-ID: <a58d86bf-b8ae-3a1a-32c6-12a248f24f84@gmail.com> (raw)

Hi emacs-devel,

In Flycheck we use ``libxml-parse-region`` if available, and fall back to ``xml-parse-region`` otherwise.  We recently realized that our libxml detection code was wrong, however.

We used to write ``(if (fboundp 'libxml-parse-region) (libxml-parse-region …) (xml-parse-region …))``, but this isn't sufficient on Windows, where ``fboundp`` succeeds if Emacs was compiled with libxml support, even if the appropriate DLL isn't installed on the user's system.

What's the proper way to autodetect libxml? We're thinking of doing this instead::

   (if (and (fboundp 'libxml-parse-region)
            (with-temp-buffer
              (insert "<xml/>")
              (libxml-parse-region (point-min) (point-max))))
       (libxml-parse-region …)
     (xml-parse-region …))

Do we have better options?

Thanks!
Clément.



             reply	other threads:[~2017-10-22 14:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-22 14:14 Clément Pit-Claudel [this message]
2017-10-22 16:27 ` What's the right way to detect libxml2? Phillip Lord
2017-10-24 13:38   ` Andy Moreton
2017-10-24 14:01     ` Clément Pit-Claudel
2017-10-24 15:33       ` Andy Moreton
2017-10-24 17:04         ` Robert Pluim
2017-10-24 17:46           ` Andy Moreton
2017-10-25 11:24             ` Robert Pluim
2017-10-28  9:10               ` Eli Zaretskii
2017-10-30  8:49                 ` Robert Pluim
2017-10-30 18:07                   ` Eli Zaretskii
2017-10-30 18:10                     ` Eli Zaretskii
2017-11-03  9:36                   ` Eli Zaretskii
2017-11-03 17:17                     ` Robert Pluim
2017-10-24 21:49     ` Richard Stallman
2017-10-24 22:32       ` John Wiegley
2017-10-25  1:45         ` Stefan Monnier
2017-10-25 22:05           ` Paul Eggert
2017-10-26  3:42           ` Richard Stallman
2017-10-25  4:39         ` Werner LEMBERG
2017-10-25  7:19       ` To Tramp or not to Tramp (was: What's the right way to detect libxml2?) Michael Albinus
2017-10-25 10:56         ` Kaushal Modi
2017-10-26  7:56         ` To Tramp or not to Tramp martin rudalics
2017-10-27  2:44           ` Richard Stallman
2017-10-27  4:01             ` John Wiegley
2017-10-27 20:58               ` Richard Stallman
2017-10-25 22:29       ` What's the right way to detect libxml2? Richard Copley
2017-10-26 10:48       ` Marcin Borkowski

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=a58d86bf-b8ae-3a1a-32c6-12a248f24f84@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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).