]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix previous code change to `ispell--call-enchant-lsmod'
authorReuben Thomas <rrt@sc3d.org>
Mon, 2 Nov 2020 21:37:46 +0000 (21:37 +0000)
committerReuben Thomas <rrt@sc3d.org>
Mon, 2 Nov 2020 21:37:46 +0000 (21:37 +0000)
* lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): Restore the
use of with-current-buffer, to avoid enchant-lsmod’s output being
dumped into the current buffer.

lisp/textmodes/ispell.el

index 1cd17b11ca8ab3baa71f7aceb34d8ec5d4330a7c..da3c3f4d6faf6542e656b84dc9802a249aa507b9 100644 (file)
@@ -1215,14 +1215,15 @@ Internal use.")
 
 (defun ispell--call-enchant-lsmod (&rest args)
   "Call enchant-lsmod with ARGS and return the output as string."
-  (with-output-to-string
-    (apply #'ispell-call-process
-           (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'"
-                                     "enchant-lsmod\\1"
-                                     ispell-program-name)
-           ;; We discard stderr here because enchant-lsmod can emit
-           ;; unrelated warnings that will confuse us.
-           nil '(t nil) nil args)))
+  (with-current-buffer standard-output
+    (with-output-to-string
+      (apply #'ispell-call-process
+             (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'"
+                                       "enchant-lsmod\\1"
+                                       ispell-program-name)
+             ;; We discard stderr here because enchant-lsmod can emit
+             ;; unrelated warnings that will confuse us.
+             nil '(t nil) nil args))))
 
 (defun ispell--get-extra-word-characters (&optional lang)
   "Get the extra word characters for LANG as a character class.