Emacs: Bookmark

By Xah Lee. Date: . Last updated: .

Emacs's Bookmarks is similar to browser's bookmark. It lets you easily open frequently needed files.

emacs bookmark 2017 04 11
Emacs Bookmark. M-x list-bookmark

Add a Bookmark

Open a file you want to bookmark. Then, Alt+x bookmark-setCtrl+x r m】. It'll add current file to bookmark file. It will prompt you for a name.

Bookmark can be a file or a directory.

List Bookmarks

Alt+x list-bookmarkCtrl+x r l】 → Open bookmark file.

When in bookmark file, press Enter to open the item under cursor.

Open a Bookmark

To open a bookmarked item, Alt+x bookmark-jumpCtrl+x r b】, then type a name.

You can type a asterisk * for wildcard. For example, “*today” will match “todo today”.

Remove / Rename Bookmark

When in the bookmark file:

Save Bookmark File

Alt+x bookmark-save to save the bookmark file. (Press s while in bookmark file)

Bookmarks are automatically saved when emacs quit. (since ~2014) [see Emacs 24.4 Features (released 2014-10) (2014-10)]

You can control bookmark auto save behavior by bookmark-save-flag.

;; everytime bookmark is changed, automatically save it
(setq bookmark-save-flag 1)

How to Remember Bookmark Commands or Shortcuts?

Bookmark commands are under the menu 〖Edit ▸ Bookmarks〗.

emacs bookmark menu
emacs bookmark menu

When you are in bookmark file, Alt+x describe-mode to see its commands and shortcuts.

Set Emacs to Open Bookmark File on Start

To have emacs open bookmark file on startup, add this to the end of your elisp init file:

(setq inhibit-splash-screen t)
(require 'bookmark)
(switch-to-buffer "*Bookmark List*")

Bookmark File Location

In emacs 24.x, bookmark file is at ~/.emacs.d/bookmarks.

In emacs 23.x, bookmark file is at ~/.emacs.bmk.

The default bookmark file path is stored in the variable bookmark-default-file. Alt+x describe-variableCtrl+h v】 to see its value.

If you have a question, put $5 at patreon and message me on xah discord.
Or support me by Buy Xah Emacs Tutorial

Emacs Tutorial

Emacs Init

Emacs Keys


ELisp Examples

ELisp Write Major Mode

Emacs Tutorial

Quick Start

Manage Windows



Find Replace




Rectangle Edit

Line Wrap


View Doc

Working with Brackets

Power Editing

Org Mode


Emacs Efficiency