[Top][All Lists]

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

bug#24150: 26.0.50; New command: dired-create-empty-file

From: Eli Zaretskii
Subject: bug#24150: 26.0.50; New command: dired-create-empty-file
Date: Wed, 05 Jul 2017 21:28:07 +0300

> From: Tino Calancha <address@hidden>
> Date: Mon, 03 Jul 2017 13:51:25 +0900
> Cc: Ted Zlatanov <address@hidden>, address@hidden,
>       Clément Pit--Claudel <address@hidden>,
>       Leo Liu <address@hidden>
> If there are no objections, i would like to apply the following patch
> in a few days:

If no one else chimes in until this weekend, please push, after taking
care of the few minor issues below:

>     (dired-create-empty-file): New command.

I'd prefer a non-Dired function, and I think files.el is a better
place for such a general function.

> address@hidden _ @r{(Dired)}
> address@hidden dired-create-empty-file
> +  Likewise, @kbd{_} (@code{dired-create-empty-file}) reads a
> +file name, and creates an empty file with that name.  It signals
> +an error if the file already exists.

Please add here a @cindex entry about "create empty file".  Also, if
the command is going to be not Dired-specific, it should be described
in another section of the manual.

>  ** Dired
> -You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', it gets replaced
> -by the current file name.
> +
> +*** New command 'dired-create-empty-file' (similar to
> +'dired-create-directory') creates a new empty file; bound to '_'.

Since this is documented in the manual, it should be marked with
"+++".  (Renaming the command affects this part as well.)

> +*** You can now use '`?`' in 'dired-do-shell-command'; as ' ? ',
> +it gets replaced by the current file name.

This looks unrelated.

> +    (when (file-exists-p expanded)
> +      (error "Cannot create file %s: file exists" expanded))

If the file is actually a directory, I think the error message should
say so.

Finally, how about some simple tests for this new command?


reply via email to

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