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 >