* lisp/emacs-lisp/checkdoc.el (checkdoc-show-diagnostics): Don't make bogus

assumptions about window ordering.
This commit is contained in:
Stefan Monnier 2015-02-18 11:04:15 -05:00
parent 81d89d88ae
commit ad6c1be923
3 changed files with 15 additions and 8 deletions

View file

@ -2619,14 +2619,15 @@ function called to create the messages."
(defun checkdoc-show-diagnostics ()
"Display the checkdoc diagnostic buffer in a temporary window."
(if checkdoc-pending-errors
(let ((b (get-buffer checkdoc-diagnostic-buffer)))
(if b (progn (pop-to-buffer b)
(goto-char (point-max))
(re-search-backward "\C-l" nil t)
(beginning-of-line)
(forward-line 1)
(recenter 0)))
(other-window -1)
(let* ((b (get-buffer checkdoc-diagnostic-buffer))
(win (if b (display-buffer b))))
(when win
(with-selected-window win
(goto-char (point-max))
(re-search-backward "\C-l" nil t)
(beginning-of-line)
(forward-line 1)
(recenter 0)))
(setq checkdoc-pending-errors nil)
nil)))