Xah Lee
Xah Lee

Reputation: 17565

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?

Upvotes: 4

Views: 290

Answers (2)

Drew
Drew

Reputation: 30708

It can even set two positions (the region), if you use Bookmark+.

Upvotes: 1

R. P. Dillon
R. P. Dillon

Reputation: 2850

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.

Upvotes: 5

Related Questions