Sometimes I edit files that have a certain suffix and files with same basename but another suffix. Since the basenames are long and awkward I would like to reuse the existing filename to construct the other name.
What I do currently is:
C-x C-b (This shows me the Buffer List)
C-x o (Now I am in the Buffer List)
M-right M-left (At the beginning of the basename)
C-space M-right ... M-w (Copying the basename)
C-x o (Back where I came from)
…
There must be a more canonical way to do this! (I am not interested in a way that involves the definition of a command proper, I have too many of them already…)
Edit: actually, what I wanted is to do something with that very name, most often create or read a related file. @Trey Jackson’s C-x C-v is it!
Strictly speaking this command does what you want, even if you don’t want a command:
But, if you’re really just using this name to do something else… perhaps a better solution is to make doing that something else easier.
Try the command C-x C-v (aka M-x find-alternate-file) if what you want to do is create a new name based on the current name.