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: Tue, 28 Jun 2022 21:17:47 -0400 Message-ID: References: <87bkuffph1.fsf@gnus.org> <875ykne905.fsf@gnus.org> <87zghza0u8.fsf@gmail.com> <87ilom8rrh.fsf@gnus.org> <87bkudrnl6.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000071712605e28bec55" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38669"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Visuwesh , rms@gnu.org, 56229@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 29 03:19:19 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 1o6MMQ-0009sS-RC for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 03:19:18 +0200 Original-Received: from localhost ([::1]:34150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6MMP-0000bk-7l for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 21:19:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6MMA-0000bO-L7 for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 21:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6MMA-0001JX-DB for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 21:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6MMA-00089R-5s for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 21:19: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: Wed, 29 Jun 2022 01:19: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.165646548731258 (code B ref 56229); Wed, 29 Jun 2022 01:19:02 +0000 Original-Received: (at 56229) by debbugs.gnu.org; 29 Jun 2022 01:18:07 +0000 Original-Received: from localhost ([127.0.0.1]:56734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6MLG-000886-TB for submit@debbugs.gnu.org; Tue, 28 Jun 2022 21:18:07 -0400 Original-Received: from mail-yw1-f178.google.com ([209.85.128.178]:43611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6MLE-00087a-AI for 56229@debbugs.gnu.org; Tue, 28 Jun 2022 21:18:05 -0400 Original-Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-3137316bb69so134051147b3.10 for <56229@debbugs.gnu.org>; Tue, 28 Jun 2022 18:18:04 -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=xWBegmzU8j72P/8iD8ns4pqBCawr2tTSqq/jBrVFtws=; b=ADu1FxaxtxH67T+lclKTNjIZF5daJRKMePbJ3jZTzswKm7Euv7TrQnSHRdPaAwVv0o feuWD7WAU5dpqMqubeLidej2JiIgFr4FrSXD6pbzygmc8hJ9GfyUZVquHr/sY7lT6CgX rTeyH6xyXSP8uz9Yki9N6uXRpP6rB3FMFPBM3YjOJAFFZCE4YyhsePR0ozy87/Uk4taC b6PxBaWGbDjv5WNaXSsL/i/defVYSjuse9iklWGnjBwUA0ujpc6nPIpu7XFAWiMht/LM Rm1NRGkXhHn1tCxc04KKlJ8bdmRD3PcIp2N6Z4XHL99A8aP0zLvF+FmzCjFY2AJolLcY MNLg== 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=xWBegmzU8j72P/8iD8ns4pqBCawr2tTSqq/jBrVFtws=; b=rauTpQtYVulHopt7j2JMNI1I/kj9A4A2wOB174cML+Gx60et59ApBn9gQisvJ7JQ/4 4iT3iz+97d1A/LNTy/ypTdoDTNnWneqlaCW2DVJhMxikw9SiXfw1KzwS3mdIoPMbGDL1 ErM2JcntuzraVvl2PhVjZxWLCFiiPkKVSyFYK6lzmXLIkB8mjqbFzhtGLgm87H2wKoOW ZS377rgbkSN+rk2nGnxDa8sVtp/Pc0erj24VJeU7GXIlC+f08uXEvjUblMaPpU/PrCer 5R6iZcpqYlEtY/SIrmJzeOY6jTyU46ZFB0HhREIiCkZQqx/oPt0B9KywpwgQL81xD9i+ ZqgA== X-Gm-Message-State: AJIora8QwUVp3Z78HiFoRX6rTQjGbdSMx3g1K4bCshCHv8eSpTQnozS9 sMhB+L+z9GK5HS+pf7D2bmwKjQ0nNR+gJ4bD0MQ= X-Google-Smtp-Source: AGRyM1vTGOYH3lN4sx3xFH7nEcrh9iZbSrIflM8pvvSQTnIL6qCoLSc2CA1Eo02Nbi6n5Sf1RIHf9EKWglptlHb3fM8= X-Received: by 2002:a81:e46:0:b0:318:3b3a:9ac0 with SMTP id 67-20020a810e46000000b003183b3a9ac0mr1147481ywo.453.1656465478741; Tue, 28 Jun 2022 18:17:58 -0700 (PDT) In-Reply-To: <87bkudrnl6.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:235587 Archived-At: --00000000000071712605e28bec55 Content-Type: text/plain; charset="UTF-8" Cool, thanks for applying it! Cheers. On Tue, Jun 28, 2022 at 8:15 AM Lars Ingebrigtsen wrote: > Zachary Kanfer writes: > > > It differs in a few ways: > > > > 1. set-visited-file-name doesn't save the file to the new location. > > 2. set-visited-file-name leaves the file on disk in the old location. > > But Richard has a good point -- we can punt to set-visited-file-name to > change the visited file name (and this also fixes changing the major > mode etc if we're changing the name from .c to .el or something). > > So I've now adjusted your function to use `rename-file' and then call > `set-visited-file-name' and pushed to Emacs 29. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --00000000000071712605e28bec55 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Cool, thanks for applying it! Cheers.

On Tue, Jun 28, 2= 022 at 8:15 AM Lars Ingebrigtsen <lars= i@gnus.org> wrote:
Zachary Kanfer <zkanfer@gmail.com> writes:

> It differs in a few ways:
>
> 1. set-visited-file-name doesn't save the file to the new location= .
> 2. set-visited-file-name leaves the file on disk in the old location.<= br>
But Richard has a good point -- we can punt to set-visited-file-name to
change the visited file name (and this also fixes changing the major
mode etc if we're changing the name from .c to .el or something).

So I've now adjusted your function to use `rename-file' and then ca= ll
`set-visited-file-name' and pushed to Emacs 29.

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