unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Roland Winkler <winkler@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71946@debbugs.gnu.org, Liu Hui <liuhui1610@gmail.com>
Subject: bug#71946: 30.0.50; [PATCH] Fix bibtex validation for non-file buffers
Date: Sun, 22 Sep 2024 14:57:05 -0500	[thread overview]
Message-ID: <87msjzjwby.fsf@gnu.org> (raw)
In-Reply-To: <87a5fzlcl9.fsf@gnu.org> (Roland Winkler's message of "Sun, 22 Sep 2024 14:20:34 -0500")

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

On Sat, Jul 13 2024, Eli Zaretskii wrote:
> Roland, is this patch okay with you, and if so, is it safe enough to
> be installed on the emacs-30 release branch?

(For the records: resending this message with bug#71946 unarchived
so that this message goes into the bug tracker.)

I am sorry, due to a silly mistake on my side, I saw your email only
now.  I saw that you already installed the patch in the emacs-30 relase
branch.

I tested the patch, it works for me, and I believe the already installed
patch should be safe in 99.9% of all scenarios I can think of.  However
I'd suggest two minor modifications, see the patch attached below:

- rename FILE-P to IS-FILE to be consistent with the emacs lisp coding
  conventions.

- Set compilation-parse-errors-filename-function only if we do not want
  its default value.

Shall I install this patch in the emacs-30 release branch or in master?

Roland



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bibtex.patch --]
[-- Type: text/x-diff, Size: 1205 bytes --]

--- bibtex.el~	2024-09-22 13:41:29.890443820 -0500
+++ bibtex.el	2024-09-22 14:23:17.726487214 -0500
@@ -4638,16 +4638,17 @@
             (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

  parent reply	other threads:[~2024-09-22 19:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 10:00 bug#71946: 30.0.50; [PATCH] Fix bibtex validation for non-file buffers Liu Hui
2024-07-06 22:38 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-13 10:26 ` Eli Zaretskii
     [not found]   ` <87a5fzlcl9.fsf@gnu.org>
2024-09-22 19:57     ` Roland Winkler [this message]
     [not found]     ` <875xqnlccs.fsf@gnu.org>
2024-09-23 11:44       ` Eli Zaretskii
2024-09-25  4:24         ` Roland Winkler
2024-07-20  9:49 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msjzjwby.fsf@gnu.org \
    --to=winkler@gnu.org \
    --cc=71946@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=liuhui1610@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).