From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Rename, delete and move current buffer and file Date: Mon, 07 May 2018 15:28:20 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525706838 14267 195.159.176.226 (7 May 2018 15:27:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 May 2018 15:27:18 +0000 (UTC) Cc: Emacs developers To: jrzeszotko@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 07 17:27:14 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fFi2j-0003Yb-Aa for ged-emacs-devel@m.gmane.org; Mon, 07 May 2018 17:27:13 +0200 Original-Received: from localhost ([::1]:46810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFi4o-0003OT-Rp for ged-emacs-devel@m.gmane.org; Mon, 07 May 2018 11:29:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFi41-0003OK-F6 for emacs-devel@gnu.org; Mon, 07 May 2018 11:28:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFi40-000750-IX for emacs-devel@gnu.org; Mon, 07 May 2018 11:28:33 -0400 Original-Received: from mail-ot0-x22a.google.com ([2607:f8b0:4003:c0f::22a]:34899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fFi40-00074k-DK for emacs-devel@gnu.org; Mon, 07 May 2018 11:28:32 -0400 Original-Received: by mail-ot0-x22a.google.com with SMTP id h8-v6so32419000otb.2 for ; Mon, 07 May 2018 08:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=w7Pgw/0dz95SqJqY77QL/Gme+Cza1GskqqYCOBuNU+M=; b=WnXHS9HYySskQYiqEQ9DLkPofQ2eLpR0pnjcG7S3+lCUDMLSrNtA9Un6iUZwH8sVsx d7bAWCOwrUuZP8AxSjUKYWGSdl8L2CSCifZVZX3id9mX6eTcjrAnV/JF9+r+Jgf55XWv l07VC2MpcpiJ6M6Z99AAtYhlAYnpQke3XpurmmSbe/tNlWpLqUkHcpC8K9cXiLIkmPEe +WNERLChJ+e4a8L+RUBKSjhSaTGQoy2DyJ2FhXvTXTtUUMDqJNhO4k2CTMqfe/CmqwEZ pl8EmonXduk82ZOxDAbVXxqFWcz+i+Mr03+vRd+0a4pziACk3vmkVEm6hNtyjkIDRmWl uxgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=w7Pgw/0dz95SqJqY77QL/Gme+Cza1GskqqYCOBuNU+M=; b=f4T9j+IOjzQbPifvwYjQ4bZs5p2OvC91ttYAHUAAjD2tnKLNA4beu74PDIqrUCrCxX OI2CWxp0fHE9ZlFixP3xiyUz0jOUaKBj7QkXGRWH6LO9/CO/SnPYIJxg6/iPoD1tW2jj /+Ux4lozrU4usKUmsesirA+ndhnJQ1vyV6tcP/QrJ4jxLrIykCPBpDXcXLAOE9jZwrwi /gb6tLeKBNLEwhDUS9x+1etM4JFB5NDpggkUr2DUoHPjI1+4lINNvdzDMU6XVnYeGe5R kc2BNgtW8V2oWnkgsWuVrzmQWLnYWG0kt1CDpWnCNiymyzjuCHXFI8g3mr6acE4ENXM9 Xy1w== X-Gm-Message-State: ALQs6tBD4QV88c1tZ4+RxbxPa8SU3Vb4MD2As6ZT8yo/h4Tjm67wdKhP +voHJi9RgExFevL11nRXJkQP85y3QqrNz6UOPbI= X-Google-Smtp-Source: AB8JxZqsWtVU4gL6fODfHpcJjT3BPCDzM2qE2g3cJh4f+QVmBnLAQs47Ie4BkXZR3uX9gnmVjV2aC8glqglnQ1dSUGo= X-Received: by 2002:a9d:172d:: with SMTP id i45-v6mr84501ota.43.1525706911449; Mon, 07 May 2018 08:28:31 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225116 Archived-At: On Mon, May 7, 2018 at 8:59 PM Jaros=C5=82aw Rzesz=C3=B3tko wrote: > It is surprisingly hard to do this in Emacs [=E2=80=A6] > 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 =E2=80=9Coutside= =E2=80=9D it is the intuitive first step for me. =E2=80=98dired-jump=E2=80=99 takes me to t= he Dired buffer of the enclosing directory and puts point on the file. It=E2=80=99s on C-x = C-j by default, but I bind it on so my fingers think going =E2=80=9Coutsi= de=E2=80=9D 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 =E2=80=98dired-dwim-target=E2=80=99 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 =E2=80=98find-file=E2=80=99, followed by your pref= erred method to get the current line to clipboard. (This breaks if you =E2=80=98cd=E2=80=99= 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?