emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-30 816c53c2d9d: Fix bibtex validation for non-file buffers


From: Eli Zaretskii
Subject: emacs-30 816c53c2d9d: Fix bibtex validation for non-file buffers
Date: Sat, 20 Jul 2024 05:48:51 -0400 (EDT)

branch: emacs-30
commit 816c53c2d9d6f2aabffdced23d10a0c902193235
Author: Liu Hui <liuhui1610@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix bibtex validation for non-file buffers
    
    * lisp/textmodes/bibtex.el (bibtex-validate): Use buffer name
    to show errors in non-file buffers.  (Bug#71946)
---
 lisp/textmodes/bibtex.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index a6da34d6a41..1473fc2bd6b 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -4638,13 +4638,16 @@ Return t if test was successful, nil otherwise."
             (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]