]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix a recent change to EWW
authorJim Porter <jporterbugs@gmail.com>
Tue, 22 Oct 2024 15:36:23 +0000 (08:36 -0700)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Oct 2024 19:03:21 +0000 (21:03 +0200)
* lisp/net/eww.el (eww--guess-content-type): Save excursion.

(cherry picked from commit f58652a41978974855be0993d42ace225b64efed)

lisp/net/eww.el

index 4df9740d54011064e410462f887dc2a76d3c4b4e..6559c7e5eb9734d9c04720fce38aded7b9ef232f 100644 (file)
@@ -651,9 +651,10 @@ Will call each function in `eww-guess-content-type-functions', until one
 of them returns a value.  This mechanism is used only if there isn't a
 valid Content-Type header.  If none of the functions can guess, return
 \"application/octet-stream\"."
-  (or (run-hook-with-args-until-success
-       'eww-guess-content-type-functions headers response-buffer)
-      "application/octet-stream"))
+  (save-excursion
+    (or (run-hook-with-args-until-success
+         'eww-guess-content-type-functions headers response-buffer)
+        "application/octet-stream")))
 
 (defun eww--html-if-doctype (_headers response-buffer)
   "Return \"text/html\" if RESPONSE-BUFFER has an HTML doctype declaration.