15.6 Keeping File and Buffer Names in Registers

C-x r F r

Store the currently visited file or directory in register r (file-to-register).

C-x r B r

Store the currently visited buffer in register r (buffer-to-register).

If you visit certain files or buffers frequently, you can visit them more conveniently if you put their names in registers.

Typing C-x r F (file-to-register), followed by a character r, saves a reference to the currently visited file in register r. You can then visit the file using jump-to-register by typing C-x r j r. With a prefix argument, file-to-register prompts for a file name to store in the register.

Typing C-x r B (buffer-to-register), followed by a character r, saves a reference to the currently visited buffer in register r. You can then revisit the buffer using jump-to-register. With a prefix argument, buffer-to-register prompts for a buffer name to store in the register.

If you store a buffer name which is visiting a file in a register, and the buffer is then closed, the register is automatically converted to a file reference, allowing you to quickly re-open the closed file.