crux icon indicating copy to clipboard operation
crux copied to clipboard

More robust `crux-rename-file-and-buffer`.

Open wyuenho opened this issue 3 years ago • 4 comments

Currently if you rename a new buffer that hasn't been saved yet, crux-rename-file-and-buffer will only rename the buffer but not reset the visited file name, so saving after renaming will still save to the file name before renaming. The PR also let the user know if we are renaming to an existing buffer.

  • Offer to save file first if modified or new unsaved buffer.
  • Message user if new file name is the same.

Before submitting a PR make sure the following things have been done (and denote this by checking the relevant checkboxes):

  • [x] The commits are consistent with our contribution guidelines
  • [x] The new code is not generating bytecode or M-x checkdoc warnings
  • [x] You've updated the changelog (if adding/changing user-visible functionality)
  • [ ] You've updated the readme (if adding/changing user-visible functionality)

Thanks!

wyuenho avatar Jan 01 '22 19:01 wyuenho

@bbatsov how does this look?

wyuenho avatar Jan 22 '22 02:01 wyuenho

The messages can be a bit clearer, but your proposal looks good to me overall.

bbatsov avatar Jan 23 '22 18:01 bbatsov

Do you have a better message? What's unclear?

wyuenho avatar Jan 23 '22 18:01 wyuenho

@bbatsov ping.

wyuenho avatar Feb 14 '22 08:02 wyuenho