unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jarosław Rzeszótko" <jrzeszotko@gmail.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Rename, delete and move current buffer and file
Date: Mon, 7 May 2018 18:20:53 +0200	[thread overview]
Message-ID: <CAO_X8WC8BXa8NCr+ep-ekpih05vXRqDXYUaHo2jSZXwxupOmew@mail.gmail.com> (raw)
In-Reply-To: <CAP_d_8UGq45W0b34W-TLVhjHOigm2mYmoPPHHgXxEJYtFAexSw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4629 bytes --]

On Mon, May 7, 2018 at 5:28 PM, Yuri Khan <yurivkhan@gmail.com> wrote:

> On Mon, May 7, 2018 at 8:59 PM Jarosław Rzeszótko <jrzeszotko@gmail.com>
> wrote:
>
> > It is surprisingly hard to do this in Emacs […]
> > You can use dired, but I personally find it to be a distraction for this
> use case.
>
> Why?
>

I personally most often want this when working on a programming project, I
have a bunch of files open and I am in the middle of a planned sequence of
changes, popping up a new buffer and dealing with dired which I do not
otherwise use much breaks my concentration. It is hard to explain this
fully rationally, but judging by how many .emacs, libraries, wiki pages
etc. I have seen that have rename-file-and-buffer in them I am not the only
one.

Note that an interactive delete-file function already exists, but it
doesn't kill the associated buffer. That's why I consider it a gap in the
Emacs set of functions. There are three sets of operations: file operations
(rename-file, delete-file), buffer operations (rename-buffer, kill-buffer)
and some file+buffer operations (set-visited-file-name). It would be nice
if there was some unity among the three sets, so that it would be possible
to do the common operations in all three ways (file/buffer/file+buffer),
and that the naming is reasonably consistent. Of course backwards
compatibility is an issue as always.


> [...]


> > A very similar related pain point is that it is hard to get the path and
> directory of the current buffers visited file.
>
> Your favorite binding of ‘find-file’, followed by your preferred method to
> get the current line to clipboard. (This breaks if you ‘cd’ to a different
> directory while editing a file.)
>

This is not that easy if you use a completion system like ivy or ido. It's
also not nice from an elisp standpoint, that for the two strongly related
things, one is accessible only as a variable and the other either as a
command or function.


>
> > Finally, while we are discussing functions everyone re-implements in
> their .emacs, please lets make transpose-windows happen as an Emacs builtin
> :)
>
> You mean the windcycle library?
>

I mean:

https://github.com/bbatsov/crux/blob/master/crux.el#L471
https://www.emacswiki.org/emacs/TransposeWindows

Sure there are packages to do this, it just seems strange among the many
built-in window functions there is no transpose. Again, you will easily
find very many .emacs on the web implementing a function like this, which
for me looks like a bit of gap in what is provided out-of-the-box.

Cheers,
Jarosław Rzeszótko


On Mon, May 7, 2018 at 5:28 PM, Yuri Khan <yurivkhan@gmail.com> wrote:

> On Mon, May 7, 2018 at 8:59 PM Jarosław Rzeszótko <jrzeszotko@gmail.com>
> wrote:
>
> > It is surprisingly hard to do this in Emacs […]
> > You can use dired, but I personally find it to be a distraction for this
> use case.
>
> Why?
>
> I think of deleting, renaming and moving as operations on the file as a
> whole and not on its content, so saving the file and going “outside” it is
> the intuitive first step for me. ‘dired-jump’ takes me to the Dired buffer
> of the enclosing directory and puts point on the file. It’s on C-x C-j by
> default, but I bind it on <M-S-up> so my fingers think going “outside” is a
> single spatial movement.
>
> If I want to delete the file, I press D and confirm. To rename, I press R
> and enter the new name; the buffer is renamed automatically.
>
> When copying or moving files, I prefer to see the target directory before I
> do it. So, I split the window, switch there, navigate to the target
> directory, switch back, R (or C to copy), RET (because with
> ‘dired-dwim-target’ set to non-nil the target directory is automatically
> suggested as the default), then deal with any changes to the window
> configuration.
>
> Note here the DWIM behavior: R suggests the directory in the other window,
> but if there is no other window, then the current directory.
>
> > A very similar related pain point is that it is hard to get the path and
> directory of the current buffers visited file.
>
> Your favorite binding of ‘find-file’, followed by your preferred method to
> get the current line to clipboard. (This breaks if you ‘cd’ to a different
> directory while editing a file.)
>
> > Finally, while we are discussing functions everyone re-implements in
> their .emacs, please lets make transpose-windows happen as an Emacs builtin
> :)
>
> You mean the windcycle library?
>

[-- Attachment #2: Type: text/html, Size: 7873 bytes --]

  reply	other threads:[~2018-05-07 16:20 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 13:58 Rename, delete and move current buffer and file Jarosław Rzeszótko
2018-05-07 14:53 ` Stefan Monnier
2018-05-07 16:20   ` Jarosław Rzeszótko
2018-05-07 17:01     ` Stefan Monnier
2018-05-07 17:47       ` Jarosław Rzeszótko
2018-05-08  1:28         ` Stefan Monnier
2018-05-08  7:05           ` Jarosław Rzeszótko
2018-05-09 12:28             ` Stefan Monnier
2018-05-09 18:12               ` Radon Rosborough
2018-05-09 22:44                 ` Stefan Monnier
2018-05-10 17:01                   ` Radon Rosborough
2018-05-10 21:49                     ` Stefan Monnier
2018-05-11  7:31                       ` Andreas Schwab
2018-05-11 15:33                         ` Stefan Monnier
2018-05-11 15:45                           ` Paul Eggert
2018-05-11 16:06                             ` Clément Pit-Claudel
2018-05-11 16:14                             ` Stefan Monnier
2018-05-09 23:50               ` Van L
2018-05-10  5:37                 ` Jarosław Rzeszótko
2018-05-10 13:18                   ` Van L
2018-05-10  8:20               ` Amit Ramon
2018-05-10  8:59                 ` Phil Sainty
2018-05-10 16:04                 ` Eli Zaretskii
2018-05-07 18:20     ` Andreas Schwab
2018-05-08  1:28       ` Stefan Monnier
2018-05-07 15:28 ` Yuri Khan
2018-05-07 16:20   ` Jarosław Rzeszótko [this message]
2018-05-09 11:46   ` Tino Calancha
2018-05-07 15:29 ` Andreas Röhler
2018-05-07 15:38   ` Andreas Röhler
2018-05-10  0:46   ` net june
2018-05-11  6:26     ` Andreas Röhler
2018-05-11 16:10       ` net june

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAO_X8WC8BXa8NCr+ep-ekpih05vXRqDXYUaHo2jSZXwxupOmew@mail.gmail.com \
    --to=jrzeszotko@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).