help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: rename file in dired based on current [T2C round 3]


From: Drew Adams
Subject: RE: rename file in dired based on current [T2C round 3]
Date: Tue, 27 Oct 2020 21:23:09 -0700 (PDT)

> How do you rename a file in dired, and get the previous/current as
> a suggestion?
> 
> Let's say it is called salma-hayek.png and you want to rename it
> salma-hayek-bandidas-2006.png, it is useful to get the first part
> spelled out, right?
> 
> (defun dired-do-rename-suggest ()
>   (interactive)
>   (let*((file     (dired-get-filename))
>         (old-name (dired-get-filename 'no-dir))
>         (new-name (read-from-minibuffer "rename to: " old-name)) )
>     (dired-rename-file file new-name nil) ; (NOT) OK-IF-ALREADY-EXISTS
>     (revert-buffer) ))

In Dired?

`R M-n'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]