1

I am trying to use bookmark+, but I am unable to get the highlighting as I wish (or, maybe, as I wrongly expect?): When I change the default highlight of a bookmark, I only see the purple flag, but never the colored file name (e.g. tt) I do see colors like in the second line for dired bookmarks.

Snapshot of 2 bookmarks

What I would like to achieve: Change the color/highlighting of a bookmark name according to my own scheme, in a quite easy way. I noticed that I get a lot of questions about style and face when I try to change the highlighting - but it never made any difference for me.

1 Answer 1

0

Put the cursor on the bookmark name and use C-u C-x =. Near the bottom of buffer *Help* you'll see the name(s) of the face(s) on the text at the cursor. Then M-x customize-face for that face.

I'm guessing the face you need to customize is bmkp-local-file-without-region. By default it doesn't look different from the default font (e.g., just black text).

M-x list-faces-display shows all current faces. Those used by Bookmark+ have names with prefix bmkp:

  • bmkp-*-mark
  • bmkp->-mark
  • bmkp-D-mark
  • bmkp-X-mark
  • bmkp-a-mark
  • bmkp-bad-bookmark
  • bmkp-bookmark-file
  • bmkp-bookmark-list
  • bmkp-buffer
  • bmkp-desktop
  • bmkp-file-handler
  • bmkp-function
  • bmkp-gnus
  • bmkp-heading
  • bmkp-info
  • bmkp-light-autonamed
  • bmkp-light-autonamed-region
  • bmkp-light-fringe-autonamed
  • bmkp-light-fringe-non-autonamed
  • bmkp-light-mark
  • bmkp-light-non-autonamed
  • bmkp-light-non-autonamed-region
  • bmkp-local-directory
  • bmkp-local-file-with-region
  • bmkp-local-file-without-region
  • bmkp-man
  • bmkp-no-jump
  • bmkp-no-local
  • bmkp-non-file
  • bmkp-remote-file
  • bmkp-sequence
  • bmkp-snippet
  • bmkp-su-or-sudo
  • bmkp-t-mark
  • bmkp-url
  • bmkp-variable-list

In buffer *Bookmark List*, if you use ? or C-h m you'll see their descriptions listed, showing their highlights. E.g., face bmkp-local-file-without-region shows this description with that face (same as face default, by default): Local file with no region.


UPDATE after your comment that says that you tried HH and H+, and that you want to change how a bookmark is lighted in buffer *Bookmark List*.

Bookmarks are highlighted in various ways (customizable) at their bookmarked locations (destinations).

Bookmark names/lines in *Bookmark List* are highlighted according to their types. If a bookmark has its own (destination) highlighting defined then, in *Bookmark List* a "purple flag" (face bmkp-light-mark), as you mentioned and show, is shown next to each one whose location will be highlighted (when you visit it).

In *Bookmark List*, HH turns on (destination) highlighting for the bookmark listed on the current line. H+ defines how the bookmark on the current line will be highlighted (at its destination).

There's no feature to highlight arbitrary bookmarks in *Bookmark List*. That would interfere with highlighting to show the bookmark types. (You could copy the definition of function bmkp-bmenu-list-1 and modify it to do that, I guess.)

1
  • Thanks for your quick reply. If I edit and change bmkp-local-file-without-region, every bookmark of this kind (i.e. 99 percent in my case) ends up with this color, which makes no difference then. I was hoping that HH or H+ could be used to give different colors to bookmarks, but for some reason I do not see any change when I use these shortcuts. Maybe I just misunderstand what HH etc. are doing. But assigning colors to bookmarks would be really cool.
    – scfrank
    May 22, 2023 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.