unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What's the right way to detect libxml2?
@ 2017-10-22 14:14 Clément Pit-Claudel
  2017-10-22 16:27 ` Phillip Lord
  0 siblings, 1 reply; 28+ messages in thread
From: Clément Pit-Claudel @ 2017-10-22 14:14 UTC (permalink / raw)
  To: Emacs developers

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.



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-11-03 17:17 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-22 14:14 What's the right way to detect libxml2? Clément Pit-Claudel
2017-10-22 16:27 ` 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

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).