all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: tzz@lifelogs.com, 24150@debbugs.gnu.org, sdl.web@gmail.com,
	clement.pit@gmail.com
Subject: bug#24150: 26.0.50; New command: dired-create-empty-file
Date: Mon, 03 Jul 2017 17:24:35 +0300	[thread overview]
Message-ID: <83y3s5oaxo.fsf@gnu.org> (raw)
In-Reply-To: <87mv8m3yya.fsf@calancha-pc> (message from Tino Calancha on Mon,  03 Jul 2017 13:51:25 +0900)

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Mon, 03 Jul 2017 13:51:25 +0900
> Cc: Ted Zlatanov <tzz@lifelogs.com>, tino.calancha@gmail.com,
> 	Clément Pit--Claudel <clement.pit@gmail.com>,
> 	Leo Liu <sdl.web@gmail.com>
> 
> After i found the following threads:
> 
> https://stackoverflow.com/questions/20300137/how-to-create-new-file-from-dired-mode
> https://stackoverflow.com/questions/2592095/how-do-i-create-an-empty-file-in-emacs
> 
> and considering the significant number of views they have, i'd like to
> reopen this issue.
> 
> 1. In my config i've bound the new command to 'M-+'.
> 
> 2. In the threads above they suggest the keybindings 'c' and '_'.
> 
> 'c' is already bound to `dired-do-compress-to', so i propose to bind
> the new command to '_' (unless you have a better proposal).
> 
> If there are no objections, i would like to apply the following patch
> in a few days:

Thanks for working on this, Tino.

I have a few concerns that I'd like to raise before we agree on adding
this.

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.

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.

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.  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.

Thanks.





  reply	other threads:[~2017-07-03 14:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 13:25 bug#24150: 25.1.50; New command: dired-create-empty-file Tino Calancha
2016-08-04 13:54 ` Clément Pit--Claudel
2016-08-04 16:29 ` Leo Liu
2016-08-04 17:13   ` Ted Zlatanov
2016-08-04 17:29     ` Drew Adams
2016-08-05  6:03 ` Tino Calancha
2016-08-05 14:48   ` Drew Adams
2016-08-06 12:38     ` Tino Calancha
2016-08-05  6:07 ` Tino Calancha
2017-05-03  8:23 ` Tino Calancha
2017-07-03  4:51 ` bug#24150: 26.0.50; " Tino Calancha
2017-07-03 14:24   ` Eli Zaretskii [this message]
2017-07-03 15:04     ` Tino Calancha
2017-07-03 16:33       ` Eli Zaretskii
2017-07-03 20:18         ` Thien-Thi Nguyen
2017-07-07 13:13         ` Ted Zlatanov
2017-07-07 13:17           ` Drew Adams
2017-07-07 13:31             ` Ted Zlatanov
2017-07-03 15:12     ` Drew Adams
2017-07-05 18:28   ` Eli Zaretskii
2017-07-05 19:34     ` Drew Adams
2017-07-07  5:36       ` Tino Calancha
2017-07-07 11:11         ` Drew Adams
2018-07-10  7:01           ` Tino Calancha
2018-07-10  7:42             ` Phil Sainty
2018-07-17  7:39               ` Tino Calancha
2018-07-20  9:03                 ` Eli Zaretskii
2018-07-23  3:57                   ` Tino Calancha
2018-07-27  8:39                     ` Eli Zaretskii
2018-07-31  4:47                       ` Tino Calancha
2018-07-31 16:20                         ` Eli Zaretskii
2018-08-01  5:16                           ` Tino Calancha
2018-08-01  6:24                             ` Eli Zaretskii
2018-08-01  7:13                               ` Tino Calancha
2018-08-01  8:56                                 ` Eli Zaretskii
2018-08-01  9:31                                   ` Tino Calancha
2018-08-01 11:45                                     ` Eli Zaretskii
2018-08-02  4:34                                       ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y3s5oaxo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24150@debbugs.gnu.org \
    --cc=clement.pit@gmail.com \
    --cc=sdl.web@gmail.com \
    --cc=tino.calancha@gmail.com \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.