]> git.eshelyaron.com Git - emacs.git/commitdiff
Examine tex-chktex--process in the correct buffer
authorJoão Távora <joaotavora@gmail.com>
Fri, 3 Nov 2017 19:01:45 +0000 (19:01 +0000)
committerJoão Távora <joaotavora@gmail.com>
Fri, 3 Nov 2017 19:06:01 +0000 (19:06 +0000)
As in other Flymake backends, the process sentinel might run in
arbitrary buffers where this variable's value doesn't make sense.

For a way to trigger a problem due to this, see discussion starting in
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00645.html

* lisp/textmodes/tex-mode.el (tex-chktex): Use
with-current-buffer.

lisp/textmodes/tex-mode.el

index 3da6e4e11243e8f7b55a558f899ddc6c64843f61..10ee10243adaae7d0c3904109124cda7bcfb46e2 100644 (file)
@@ -3512,7 +3512,8 @@ There might be text before point."
              (lambda (process _event)
                (when (eq (process-status process) 'exit)
                  (unwind-protect
-                     (when (eq process tex-chktex--process)
+                     (when (eq process
+                               (with-current-buffer source tex-chktex--process))
                        (with-current-buffer (process-buffer process)
                          (goto-char (point-min))
                          (cl-loop