Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Get The File Path For The Current Emacs Buffer

The absolute full path to the file in the current buffer is in the variable `buffer-file-name`. For example:

Code

(princ buffer-file-name)

Results

/Users/alan/Grimoire/emacs- Get the file path for the current buffer.org

You can see the value in the GUI with:

Code

C-h v buffer-file-name