Emacs bookmark +: How to create a bookmark file for a specific file?

bookmark + package provides a function (bmkp-this-file-bmenu-list) . This, I suppose, downloads the bookmarks file of a specific file and filters only the bookmarks related to the file.

Question: how to create this specific bookmark file for a specific file?

The result should be a filtered bookmark list when using the Cx p , command Cx p , (which is attached to (bmkp-this-file-bmenu-list) ).

Edit: I use only one default bookmark file ~/.emacs.d/bookmarks . This file has bookmarks for ~/.emacs file . Now when I visit, say, the ~/.emacs file, then run Cx p , I get the following error: bmkp-this-file-bmenu-list: No bookmarks for file ~/.emacs.

+5
source share
2 answers

No, actually, the bmkp-this-file-bmenu-list does this (from the doc line):

 Show the bookmark list just for bookmarks for the current file. Set `bmkp-last-specific-file` to the current file name. If the current buffer is not visiting a file, prompt for the file name. 

The *Bookmark List* screen is displayed, only the list and all bookmarks intended for the current file.

So, if you use this command in the file buffer, you will see in the *Bookmark List* buffer all the bookmarks for the current file and only those bookmarks.

This has nothing to do with using another bookmark. .


Besides what this team does, I don’t understand what kind of behavior you would like. What, for example, do you mean by β€œa specific bookmark file for a specific file”?

+3
source

You can create another bookmark file using bookmark + using Mx bookmark-load . You will be prompted for a file name. You can either combine bookmarks from different files, or completely replace the current set of bookmarks with this set of files by providing a prefix argument.

Saving bookmarks bookmark-save will write all current bookmarks to the current value of the bmkp-current-bookmark-file variable, or if you provide the arg prefix, you can select the bookmark file name to save them.

If you need a set of bookmarks in a separate file associated with specific files, you could achieve this by loading the bookmarks and saving the bookmark with prefixes. Perhaps you can even automate this with hooks to fit your editing contexts, although I expect this to be a little tricky.

It looks like your question may come up in some confusion regarding the behavior of existing bookmarks, and you may not even need to maintain separate bookmark files.

+2
source

Source: https://habr.com/ru/post/1207225/


All Articles