GNU bug report logs - #78777
30.1; insert-file-contents should not set buffer-file-name to nil

Previous Next

Package: emacs;

Reported by: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>

Date: Thu, 12 Jun 2025 16:59:01 UTC

Severity: normal

Found in version 30.1

Full log


View this message in rfc822 format

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 78777 <at> debbugs.gnu.org
Subject: bug#78777: 30.1; insert-file-contents should not set buffer-file-name to nil
Date: Sat, 21 Jun 2025 14:16:48 +0100
[Message part 1 (text/plain, inline)]
> An alternative is to go back to using replace-buffer-content.  If its
> default operation is (or could be) too slow, you should be able to
> avoid that by passing zero for the MAX-SECS argument.
>

This is not a great solution. The point and mark will often move far away
from where it was after replacing content, even inside a
save-mark-and-incursion. There is a [RCS patch algorithm](
https://github.com/radian-software/apheleia/blob/main/apheleia-rcs.el)
available in a third party package, but there's no built-in Emacs function
that can do better than insert-file-contents in terms of speed and behavior.
[Message part 2 (text/html, inline)]

This bug report was last modified 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.