From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: What's the right way to detect libxml2? Date: Sun, 22 Oct 2017 10:14:44 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1508681714 23420 195.159.176.226 (22 Oct 2017 14:15:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Oct 2017 14:15:14 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 22 16:15:08 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6H1d-0002nf-Eu for ged-emacs-devel@m.gmane.org; Sun, 22 Oct 2017 16:14:49 +0200 Original-Received: from localhost ([::1]:33034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6H1j-0002ax-8p for ged-emacs-devel@m.gmane.org; Sun, 22 Oct 2017 10:14:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6H1c-0002ap-Vu for emacs-devel@gnu.org; Sun, 22 Oct 2017 10:14:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6H1c-0008F6-6Q for emacs-devel@gnu.org; Sun, 22 Oct 2017 10:14:48 -0400 Original-Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:44918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6H1c-0008Eh-22 for emacs-devel@gnu.org; Sun, 22 Oct 2017 10:14:48 -0400 Original-Received: by mail-qk0-x230.google.com with SMTP id r64so19195046qkc.1 for ; Sun, 22 Oct 2017 07:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=KYYx45KFjpZwdFcxoF/1unPGM20Zz+9I8pZ5HIjalNo=; b=uylYX10BdFL6WOcW1EdTCGB34ZGYzveFgWb9KZZ7Zd7MO01ADXJReSDSv5s4CIhNMX Ta34evayKFRQeJeIfuM3T32LE9UQVQU5EDhCBeUmnGeO93As80GCRlabdYIttlF97vcu KCQwJJ6MpfiAxBvwRvxj8EAYN8rf9HSMIqGWp8BRVrLQPHe2Wt0/sdN1lQa+GFSRNRKt MjdwhkkPsC+4lMn2Ujm1Ps8EvmVkO+oklaPf+P8hD+rQ+CvvqTNPtyDsI8Tn8pNVG6lN /ZOYne4jbrgo23TqW+gfpEsfO0MR1T3cc1qKgxfU43bMOez4lmUBJ2QPNWHT58P76LrF vNmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=KYYx45KFjpZwdFcxoF/1unPGM20Zz+9I8pZ5HIjalNo=; b=NVD7sHNFYh29f7nKwGfb9JPhaJrYS0WGBDS4I+tm0ONmzbzRVumOyE//sK52FkcJbj at/S8tIOy5mdcPC8eHghsHV5Q/15Mt7c6LHU9T3cCn4BtipQOFlD8QNHTjY4p5MLfkiS lKab0XrfjQxfKeT0d6BEexzJH+GXegWkfiYzgsD9ZGQ5zc4orrDzLU0hHtCaWCFGZgbU o/q36J0gnmdonocdOAhRtL/qJlpSpRjnM62qWSs+EnUmpS34LCfqpajUXClyA8DWQED0 HwGE0fqLuLLmPTrAs64KtT/7GG4O5b8vRNmgrZWFBoaDbhVfQ0HKPxLRgdoyqto2+w9U XlCA== X-Gm-Message-State: AMCzsaXFYBI3v6XlL8rFJ3xRhIvbyCGm6amTgGZeusJ0gGBpu6Y+5ZVE Zc3zGGGyl1IXu7YIyZA/56WFqpIz X-Google-Smtp-Source: ABhQp+SHono75kf9t68DQG2pB+NZTEXrH17SLCFYaiF9wEGBZNk+qFiNyFreuOio+ZjXJjUjys4VTQ== X-Received: by 10.55.15.42 with SMTP id z42mr15022201qkg.181.1508681686003; Sun, 22 Oct 2017 07:14:46 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e9:b4eb:3aa0:6bd7:af88? ([2601:184:4180:66e9:b4eb:3aa0:6bd7:af88]) by smtp.gmail.com with ESMTPSA id m63sm3305190qke.9.2017.10.22.07.14.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Oct 2017 07:14:45 -0700 (PDT) Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:219673 Archived-At: 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 "") (libxml-parse-region (point-min) (point-max)))) (libxml-parse-region …) (xml-parse-region …)) Do we have better options? Thanks! Clément.