In Emacs, how to print the name of the current file that I am editing? The built-in function buffer-file-name gives the full path of your file. To get the file name: M-: buffer-file-name Read more: How to merge a commit from another branch to my current branch in git? Linux Kernel: xt_quota: report initial quota value instead of current value to userspace How to get a FILE pointer from a file descriptor and how to get a file descriptor from a FILE pointer in C on Linux? How to convert between dos and unix file coding in Emacs? Generating TAGS file for Emacs recursively? How to print a plain text file to printers from a terminal in Linux How to Print Notes on a PDF File with Acrobat, Adobe Reader and Foxit Reader Replacing with a string with newline in Emacs?