I am following the Introduction to Programming in Emacs Lisp tutorial built in in Emacs and have arrived at the Buffer Walk-through section.

In the 4.1 Finding more information the function xref-find-definitions is mentioned. As suggested - I try to find the definition of the mark-whole-buffer function.

when I run the function by typing M-. and mark-whole-buffer it returns:

No definitions found for: mark-whole-buffer

Before that I have done/tried the following

  • Installed ctags.io like so: brew install --HEAD universal-ctags/universal-ctags/universal-ctags
  • run the ctags command in my ~/.emacs.d/ folder like so: ctags -R also tried ctags -R *.el - it generates a TAGS file and I can open it in Emacs and search with C-s and there is no mark-whole-buffer entry in there.
  • tried similar approach in other folders (running Emacs on macOS)

    • in the /Applications/Emacs.app/Contents/ folder - using same commands as in the .emacs.d folder
    • in the /Applications/Emacs.app/Contents/Resources/lisp folder - using same commands as in the .emacs.d folder
  • something else that I have tried is M-x visit-tags-table and when trying on for example the contents folder like Visit tags table (default TAGS): /Applications/Emacs.app/Contents/ it returns File /Applications/Emacs.app/Contents/TAGS is not a valid tags table

Can you please clarify the two following points?

  • Where to find the mark-whole-buffer function definition
  • How to do so from within Emacs
  • M-x xref-find-definitions has different behaviors for different buffers, in Emacs Lisp related buffers, it will use Emacs Lisp specific backend (which is not tag) to find definitions, and tag is not needed, actually Emacs can automatically remember where a function is defined.
    – xuchunyang
    Oct 6, 2019 at 4:27

1 Answer 1


C-h f mark-whole-buffer tells us that the function is defined in simple.el. If you click on the link in the help buffer to simple.el, it takes you right to the definition of the function.

  • It may be that the Elisp sources are not installed. In that case there is no link in the help buffer.
    – Tobias
    Oct 5, 2019 at 23:33
  • Thank you for this helpful answer and also thank you for the help and suggestions by commenters and editors. It works for me now.
    – Henrik K
    Oct 6, 2019 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.