[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24150: 26.0.50; New command: dired-create-empty-file
From: |
Tino Calancha |
Subject: |
bug#24150: 26.0.50; New command: dired-create-empty-file |
Date: |
Tue, 4 Jul 2017 00:04:31 +0900 (JST) |
User-agent: |
Alpine 2.20 (DEB 67 2015-01-07) |
On Mon, 3 Jul 2017, Eli Zaretskii wrote:
Thanks for your comprehensive replay.
You know, you are the boss, so i will do what you say i must do. Anyway,
let me defend my point after your replay.
First, I think this might be mixing two separate requests: one is the
desire to start a new file from Dired, the other is to create an empty
file on disk. I think these should be kept separate because they
serve 2 different needs; in particular, the latter is not related to
Dired in any way.
Honestly, i don't see the point to add a new keybinding in Dired for
`find-file' having already the global `C-x C-f'. I think the
people in the threads are all aware about `C-x C-f': they are not looking
for reduce `find-file' to just one key.
To me, it seems that those people are demanding for fast
creationg of an _empty_ new file in Dired. At least is what i got after
reading them.
I have no issues with adding a Dired keybinding that would call
find-file without much ado. I'm not sure whether it should be bound
to M-+ or to "C-u +", but I will defer to opinions of others on that.
But I don't think M-+ or whatever we bind that command to should
actually _create_ an empty file on disk. This is not how Emacs works
with files; "C-x C-f" will not create a file until you save the
buffer. That "+" actually creates a directory is IMO an exception
rather than the rule: nothing else makes sense with directories, since
users cannot type directory contents into a buffer and then save it,
at least not easily.
Dired is a file/directory manager inside Emacs. I could even imagine
people whom uses Emacs just to use Dired, because I was one of those guys.
You are right, a command to create an empty file is not the usual way
for Emacs, as an editor, but I consider perfectly reasonable/necessary to
assign a keybinding in a file manager for such operation. One person in
the threads above mentioned he wished this feature when working in a
python project. I often felt the same when working in python projects.
I do recognize a possible need for a function, or maybe even a
command, to create an empty disk file. AFAIK, we don't have such a
function, although it's not hard to write. But I think the use cases
for such a command are quite rare and niche cases, so I think we
shouldn't have a keybinding for it, not even in Dired.
Obviosly is disagree here. I found it useful in my workflow, that's why i
wrote the function and opened the issue. Many people watched the threads,
that means is not such rare feature.
Let users who
need this command frequently bind it to a key; with time, if it turns
out I'm wrong and these use cases are much more frequent, we can
decide on providing a binding by default.
So, to summarize my POV: (a) it's okay to add a Dired keybinding for
find-file; (b) let's add a command with no binding for creating an
empty file.
I don't find useful (a).
The (b), for the normal user not hacking the lisp sources, doesn't make
much difference:
M-! touch new-file RET
M-x my-create-empty-file RET
;; The only difference is that the second will create parents dirs as
;; needed.
We shouldn't assume that most of Emacs users set up their own bindings. I
know many buddies loving Emacs, using it many hours per day for
working, and they keep their defaults .emacs files.
They don't know elisp. They just want everything comes built-in.
We must not defraud those people.
- bug#24150: 26.0.50; New command: dired-create-empty-file, Tino Calancha, 2017/07/03
- bug#24150: 26.0.50; New command: dired-create-empty-file, Eli Zaretskii, 2017/07/03
- bug#24150: 26.0.50; New command: dired-create-empty-file,
Tino Calancha <=
- bug#24150: 26.0.50; New command: dired-create-empty-file, Eli Zaretskii, 2017/07/03
- bug#24150: 26.0.50; New command: dired-create-empty-file, Thien-Thi Nguyen, 2017/07/03
- bug#24150: 26.0.50; New command: dired-create-empty-file, Ted Zlatanov, 2017/07/07
- bug#24150: 26.0.50; New command: dired-create-empty-file, Drew Adams, 2017/07/07
- bug#24150: 26.0.50; New command: dired-create-empty-file, Ted Zlatanov, 2017/07/07
bug#24150: 26.0.50; New command: dired-create-empty-file, Drew Adams, 2017/07/03
bug#24150: 26.0.50; New command: dired-create-empty-file, Eli Zaretskii, 2017/07/05