Search code examples
emacselispbookmarks

Using bookmark to open a file but always in a given position


When using bookmarks to open a file, is there a way to always open at a particular position of the file?


Solution

  • Emacs default behavior when bookmarking with C-x r m is to bookmark the file AND the position. So, if you use that command (bookmark-set) it will have the behavior you're asking for.

    If you C-h k C-x r m to view the documentation:

    C-x r m runs the command bookmark-set, which is an interactive compiled Lisp function in `bookmark.el'.

    It is bound to C-x r m, .

    (bookmark-set &optional NAME NO-OVERWRITE)

    Set a bookmark named NAME at the current location.