From 50f0b00748bea6d39915a1e2e2cbeca2accb7417 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Mon, 2 Nov 2020 21:37:46 +0000 Subject: [PATCH] Fix previous code change to `ispell--call-enchant-lsmod' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 1cd17b11ca8..da3c3f4d6fa 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -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. -- 2.39.2