* net/eww.el (libxml-parse-html-region): Declare.
authorGlenn Morris <rgm@gnu.org>
Wed, 18 Sep 2013 04:48:55 +0000 (21:48 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 18 Sep 2013 04:48:55 +0000 (21:48 -0700)
(eww-display-html): Explicit error if no libxml2 support.

lisp/ChangeLog
lisp/net/eww.el

index fd6d8f0..96f2702 100644 (file)
@@ -1,5 +1,8 @@
 2013-09-18  Glenn Morris  <rgm@gnu.org>
 
+       * net/eww.el (libxml-parse-html-region): Declare.
+       (eww-display-html): Explicit error if no libxml2 support.
+
        * doc-view.el (doc-view-mode): Silence --without-x compilation.
 
        * image.el (image-type-from-buffer, image-multi-frame-p):
index 6cf4ff2..e67d9c5 100644 (file)
@@ -197,7 +197,12 @@ word(s) will be searched for via `eww-search-prefix'."
              "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)")
             (match-string 1)))))
 
+(declare-function libxml-parse-html-region "xml.c"
+                 (start end &optional base-url))
+
 (defun eww-display-html (charset url)
+  (or (fboundp 'libxml-parse-html-region)
+      (error "This function requires Emacs to be compiled with libxml2"))
   (unless (eq charset 'utf8)
     (condition-case nil
        (decode-coding-region (point) (point-max) charset)