(bibtex-progress-message 'done)))))
(if error-list
- (let ((file (file-name-nondirectory (buffer-file-name)))
- (dir default-directory)
- (err-buf "*BibTeX validation errors*"))
+ (let* ((file-p (buffer-file-name))
+ (file (if file-p (file-name-nondirectory file-p) (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))
(let ((inhibit-read-only t))
(delete-region (point-min) (point-max))
(insert (substitute-command-keys