Subject: Re: bug#78904: 30.1; in a long directory pathname, "Cannot write backup file" is output with a spurious blank line

From: Eli Zaretskii <[email-masked]>
Date: Thu, 26 Jun 2025 12:22:11 +0300

tags 78904 notabug
thanks

> From: Vincent Lefevre <[email-masked]>
> Date: Thu, 26 Jun 2025 10:45:42 +0200
> 
> 
> 1. mkdir a-very-very-very-very-very-very-long-directory-pathname
> 2. cd a-very-very-very-very-very-very-long-directory-pathname
> 3. touch foo
> 4. emacs -Q --eval '(defun find-backup-file-name (fn) (list "/"))' foo
> 5. Modify the buffer.
> 6. Save with C-x C-s
> 
> The following is output:
> 
> Cannot write backup file; backing up in ~/.emacs.d/%backup%~
> 
> but with a spurious blank line below, i.e. the echo area takes 2 lines
> instead of a single one.

If you switch to the *Messages* buffer, do you see there a message
like this:

  Saving file /home/vinc17/a-very-very-very-very-very-very-long-directory-pathname

?  If so, this is the long message, shown before the "Cannot write
backup file", and it causes the mini-window to resize to 2 screen
lines instead of just 1.  This resize remains in effect for the
following echo-area messages, to avoid the annoying back-and-forth
jumps of the mode line.  If you don't like this behavior, customize
the option resize-mini-windows to the value t (and see its doc string
for more details about this feature).

This behavior is intended, not a bug.