From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zachary Kanfer Newsgroups: gmane.emacs.bugs Subject: bug#56229: title: add a function to move a file from one place to another Date: Sun, 26 Jun 2022 11:16:24 -0400 Message-ID: References: <87bkuffph1.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001629ab05e25b4aa1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11793"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56229@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 26 17:17:39 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5U15-0002tW-IF for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 17:17:39 +0200 Original-Received: from localhost ([::1]:49224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5U14-0001SY-BG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 11:17:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5U0U-00013h-Sf for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 11:17:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5U0U-0006Z8-KH for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 11:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5U0U-0004Qu-GB for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 11:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Zachary Kanfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2022 15:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56229 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56229-submit@debbugs.gnu.org id=B56229.165625660416184 (code B ref 56229); Sun, 26 Jun 2022 15:17:02 +0000 Original-Received: (at 56229) by debbugs.gnu.org; 26 Jun 2022 15:16:44 +0000 Original-Received: from localhost ([127.0.0.1]:48694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5U0C-0004Cc-DL for submit@debbugs.gnu.org; Sun, 26 Jun 2022 11:16:44 -0400 Original-Received: from mail-yw1-f171.google.com ([209.85.128.171]:35788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5U0A-00047A-2h for 56229@debbugs.gnu.org; Sun, 26 Jun 2022 11:16:43 -0400 Original-Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-317741c86fdso64687827b3.2 for <56229@debbugs.gnu.org>; Sun, 26 Jun 2022 08:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P8z6LCjyPJPjyFXFtphPvMB6u4ETm5F36jEkGMvWvUE=; b=NuoloNNNKcqfETzprNdQbSo6HSGJ1W3Mu4zH5X6n8HJayesWy+pVl8rrv8z+vWQExa AbQJVygzonbCGFa1etO424WY24nBR2eHsuwOjyhDLq3FYbx/JQ2VS/he7eQbAJxDHaDh jydTPpGxTX30VeiQo8sdGOfz49R7qLjBEeLCw5TJOJDSiGN/AIq+ET/HfpzFrlOmAalW jBe9z/Sv0/Us21AZpdJU5qp5zO1cAHOdzSCJqbANlfgMZXqMnObKa8M4RwgahZ/lm8rJ V5rPNN8QSkYVc9pUkKH2k3fb9E4OnuzFw4PowVD8f1D3xf1Z1vDhcHCyBRYp2u3c0E2X Q6Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P8z6LCjyPJPjyFXFtphPvMB6u4ETm5F36jEkGMvWvUE=; b=I6mXSSZDKKGDtT4hUd0HvDioxYCNcX6B3PrwkUyZ3IMnlCGs3xWL08Jljhg2db+jOl 6NDU6PPDdK55d93+8+Jd3wGsw4pxOwor5dknZSpWkIIc+STtdomQ5tCIVFMKDRKFX4zd 3+pZ8Dk7wcTGynp6+CnZLRCfKhzOJGrJps0zqgYZTanbr/nK9xpohSCBFGQvi3YhUHAe rHq69vjjzsg9y0cPyAJ6KWGlnntInEsu3Eo6TsDx4HAXx/2MHe1DTPbrlljAlvV4dkGa wfpUKXJTKK1aHPixVgld3JOn/9xXZQ5NLMNkG2SVsrKwr8wmUWccD2XaaB14OBQJ7aSh 90tA== X-Gm-Message-State: AJIora9sHm4MwdwupuQiqEYiAdVNJkl5rIs5KY1FLaqhwdqd39q3f2J1 +1eln8C/14Dd25AXRlxbANPhiepdwlgEaohGJgwd/42G X-Google-Smtp-Source: AGRyM1uppLOAcIPNN1fo9dMZ3h2kMa8OzEJh5idnJ0ETJ7t1+2NBINWEgi/pkno9cg2V7WbFWkFUDxmc+vlR/AQIym8= X-Received: by 2002:a0d:dd10:0:b0:317:abd3:a97e with SMTP id g16-20020a0ddd10000000b00317abd3a97emr10339105ywe.56.1656256596419; Sun, 26 Jun 2022 08:16:36 -0700 (PDT) In-Reply-To: <87bkuffph1.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235353 Archived-At: --0000000000001629ab05e25b4aa1 Content-Type: text/plain; charset="UTF-8" Thanks! I agree the name is not exactly right. It's more complicated because if the buffer is *not* visiting a file, the right thing for this function to just save the buffer to the location selected. I don't know if the name that needs to take that into account. Is there a name for the file a buffer is visiting? Maybe "move-associated-file"? "move-visited-file"? On Sun, Jun 26, 2022, 10:50 AM Lars Ingebrigtsen wrote: > Zachary Kanfer writes: > > > So, attached is a patch for an interactive function that prompts for a > > new location, then writes the current buffer to that > > location. Assuming it's successful, and the buffer previously was > > associated with a file, it deletes the old file. > > I think this sounds like a useful command, but I'm not sure about the > name: > > [...] > > > +(defun move-file (new-location) > > + "Move the current file to NEW-LOCATION. > > This is about moving the file the current buffer is visiting -- there's > no such thing as a "current file" in Emacs -- so the command name (and > doc string) should reflect that. I don't really have a suggestion for a > better command name, though. Anybody? > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --0000000000001629ab05e25b4aa1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks! I agree the name is not exactly right.
=

It's more complicated bec= ause if the buffer is *not* visiting a file, the right thing for this funct= ion to just save the buffer to the location selected. I don't know if t= he name that needs to take that into account.

Is there a name for the file a buffer is visiting? Ma= ybe "move-associated-file"? "move-visited-file"?
On Sun, Jun 26, 2022, 10:50 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Zachary Kanfer <zkanfer@gmail.com> writes:

> So, attached is a patch for an interactive function that prompts for a=
> new location, then writes the current buffer to that
> location. Assuming it's successful, and the buffer previously was<= br> > associated with a file, it deletes the old file.

I think this sounds like a useful command, but I'm not sure about the name:

[...]

> +(defun move-file (new-location)
> +=C2=A0 "Move the current file to NEW-LOCATION.

This is about moving the file the current buffer is visiting -- there's=
no such thing as a "current file" in Emacs -- so the command name= (and
doc string) should reflect that.=C2=A0 I don't really have a suggestion= for a
better command name, though.=C2=A0 Anybody?

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--0000000000001629ab05e25b4aa1--