bibtex-mode: fix patch bibtex validation for non-file buffers
This commit is contained in:
parent
4729065ee7
commit
bd25a98b4e
1 changed files with 5 additions and 4 deletions
|
@ -4638,16 +4638,17 @@ Return t if test was successful, nil otherwise."
|
|||
(bibtex-progress-message 'done)))))
|
||||
|
||||
(if error-list
|
||||
(let* ((file-p (buffer-file-name))
|
||||
(file (if file-p (file-name-nondirectory file-p) (buffer-name)))
|
||||
(let* ((is-file (buffer-file-name))
|
||||
(file (if is-file (file-name-nondirectory is-file) (buffer-name)))
|
||||
(dir default-directory)
|
||||
(err-buf "*BibTeX validation errors*"))
|
||||
(setq error-list (sort error-list #'car-less-than-car))
|
||||
(with-current-buffer (get-buffer-create err-buf)
|
||||
(setq default-directory dir)
|
||||
(unless (eq major-mode 'compilation-mode) (compilation-mode))
|
||||
(setq-local compilation-parse-errors-filename-function
|
||||
(if file-p #'identity #'get-buffer))
|
||||
(unless is-file
|
||||
(setq-local compilation-parse-errors-filename-function
|
||||
#'get-buffer))
|
||||
(let ((inhibit-read-only t))
|
||||
(delete-region (point-min) (point-max))
|
||||
(insert (substitute-command-keys
|
||||
|
|
Loading…
Add table
Reference in a new issue