[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What's the right way to detect libxml2?
From: |
Clément Pit-Claudel |
Subject: |
What's the right way to detect libxml2? |
Date: |
Sun, 22 Oct 2017 10:14:44 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
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.
- What's the right way to detect libxml2?,
Clément Pit-Claudel <=
- Re: What's the right way to detect libxml2?, Phillip Lord, 2017/10/22
- Re: What's the right way to detect libxml2?, Andy Moreton, 2017/10/24
- Re: What's the right way to detect libxml2?, Clément Pit-Claudel, 2017/10/24
- Re: What's the right way to detect libxml2?, Andy Moreton, 2017/10/24
- Re: What's the right way to detect libxml2?, Robert Pluim, 2017/10/24
- Re: What's the right way to detect libxml2?, Andy Moreton, 2017/10/24
- Re: What's the right way to detect libxml2?, Robert Pluim, 2017/10/25
- Re: What's the right way to detect libxml2?, Eli Zaretskii, 2017/10/28
- Re: What's the right way to detect libxml2?, Robert Pluim, 2017/10/30
- Re: What's the right way to detect libxml2?, Eli Zaretskii, 2017/10/30