I've recently started using the BookmarkPlus package and I've been loving it.
However there is one thing that I can't seem to figure out. I want, from my big list of bookmarks,
to create a set of smaller lists, that would function as sort of projects, so I can have only the
bookmarks related to a certain project in the *Bookmark List*
visible.
Edit: Maybe I should also mention I'm working on Windows 10 with the windows version of emacs. What I tried was this (It was based on the description here).
I will describe my problem in the form of a minimum working example. Let's say we have a bookmark file with three bookmarks:
Bookmark file:
c:/Users/me/.emacs.d/bookmark_test.bmkp
All Bookmarks
-------------
t file A fileA.txt
t file B fileB.txt
t file C fileC.txt
with tags:
file A
has tagproj1
file B
has tagproj2
file C
has tagproj1
Then to view just the files from "Project 1", I do one of the following:
- In the
*Bookmark List*
buffer useP T proj1 <ret>
which gives me the filtered view:
Bookmark file:
c:/Users/me/.emacs.d/bookmark_test.bmkp
Bookmarks with Tags Matching Regexp `proj1'
-------------------------------------------
t file A fileA.txt
t file C fileC.txt
Now I wish to save this view as for later use so I do C-x r m Project1 <ret>
.
This throws me back to the bookmark list with a new bookmark like so:
Bookmark file:
c:/Users/me/.emacs.d/bookmark_test.bmkp
All Bookmarks
-------------
t file A fileA.txt
t file B fileB.txt
t file C fileC.txt
Project1 *Bookmark List*
Now when I go to the bookmark Project1
and press <ret>
, I expect to get back to the filtered view like above, yet this does not happen and doing so simply
moves point to the bookmark file A
.
- The second approach is much the same, except instead of filtering with
P T
I useT m * proj1 <ret> <ret>
to first tag the files and then filter them with>
and again save withC-x r m
. The end result is the same.
My init file for the example is the following
(let ((default-directory "~/.emacs.d/packages/"))
(normal-top-level-add-subdirs-to-load-path))
(require 'bookmark+)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(bmkp-last-as-first-bookmark-file "c:/Users/me/.emacs.d/bookmark_test.bmkp")
'(bookmark-default-file "~/.emacs.d/bookmark_test.bmkp"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
The file bookmark_test.bmkp
looks like:
;;;; Emacs Bookmark Format Version 1 ;;;; -*- coding: utf-8 -*-
;;; This format is meant to be slightly human-readable;
;;; nevertheless, you probably don't want to edit it.
;;; -*- End Of Bookmark File Format Version Stamp -*-
(#1=(#("file C" 0 6
(bmkp-full-record #1#))
(tags "proj1")
(filename . "~/Documents/fileC.txt")
(buffer-name . "fileC.txt")
(front-context-string)
(rear-context-string . "s the last file.")
(front-context-region-string)
(rear-context-region-string)
(visits . 1)
(time 24513 1396 891997 0)
(created 24512 60521 908157 0)
(position . 23))
#1=(#("file B" 0 6
(bmkp-full-record #1#))
(tags "proj2")
(filename . "~/Documents/fileB.txt")
(buffer-name . "fileB.txt")
(front-context-string)
(rear-context-string . "is the last one.")
(front-context-region-string)
(rear-context-region-string)
(visits . 1)
(time 24513 355 491409 0)
(created 24512 60464 541235 0)
(position . 69))
#1=(#("file A" 0 6
(bmkp-full-record #1#))
(tags "proj1")
(filename . "~/Documents/fileA.txt")
(buffer-name . "fileA.txt")
(front-context-string)
(rear-context-string . "t has two lines.")
(front-context-region-string)
(rear-context-region-string)
(visits . 0)
(time . #2=(24512 60394 692321 0))
(created . #2#)
(position . 42))
)
Saving the filtered view adds the following bookmark to the bookmark file:
(#1=(#("Project1" 0 8
(bmkp-full-record #1#))
(buffer-name . "*Bookmark List*")
(visits . 1)
(time 24513 2965 108585 0)
(created 24513 2958 669730 0)
(position . 147)
(filename . " - no file -")
(bookmark-list
(last-sort-comparer
(bmkp-info-node-name-cp bmkp-gnus-cp bmkp-url-cp bmkp-local-file-type-cp)
bmkp-alpha-p)
(last-reverse-sort-p)
(last-reverse-multi-sort-p)
(last-bmenu-filter-function)
(last-bmenu-filter-pattern . "proj1")
(last-bmenu-omitted-bookmarks)
(last-bmenu-title . "")
(last-bmenu-toggle-filenames . t))
(handler . bmkp-jump-bookmark-list))