Subject: bug#77797: 31.0.50; Visit an empty file on creating it

From: Eli Zaretskii <[email-masked]>
Date: Mon, 14 Apr 2025 16:38:21 +0300

> Date: Mon, 14 Apr 2025 13:57:59 +0200
> From:  Stephen Berman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> To create an empty file (and perhaps also one or more parent
> directories) and then immediately visit the file (e.g., to yank some
> copied text into it), you currently have to type `M-x make-empty-file',
> enter the file name (possibly with parent directories), and then type
> `C-x C-f M-p'.

That's backwards: in Emacs, you type "C-x C-f NEWFILE RET", then edit
it, then save it.  IOW, you don't create an empty file first, because
that's not useful.

The make-empty-file command exists for cases where the only desired
outcome is to make an empty file.  Not if the user wants to create a
_new_ _non-empty_ file.

> As a more convenient alternative to invoking two commands, I propose
> that invoking `make-empty-file' with a prefix argument should create
> and visit the empty file.  Here is a simple backward compatible
> patch to do this:

I don't necessarily object, but please note that this is non-Emacs'y.