2

Can you recommend, a good bookmark package?

  • Yes, emacs standard has bookmarks. Although, hate naming them.
  • Just want something small, not uber sophisticated (like bookmark+). (It crashes my setup, at the moment, had to remove it.)
  • All I want is a hotkey to mark one location, per file.
  • Don't care about saving, between sessions. (Great if just during session.)
  • Although, I do have "save last edited place" working now. (Don't know, name of package off top of head.)

Really after, just a remember position (in key), then other hotkey to recall. Yes, plain Emacs bookmark could do this? With a name in macro.

  • But, is that the best way?
  • Or easiest way?
  • Check out the bm package. – Kaushal Modi Aug 12 '16 at 17:44
  • Ah yes, thank you very much! @KaushalModi (*) Some links. A Visual Bookmarks package for Emacs, and VisibleBookmarks. In joodland's GitHub repository: bm. – Bob Nelson Gcdr Aug 12 '16 at 18:00
  • 2
    FWIW: Bookmark+ does everything library bm does (and more). There is nothing uber-sophisticated about it: Just because you can do more with it does not mean that you must or that you cannot do less. Could you please report details of the problem you encountered ("crashes my setup"), by clicking the link Send Bug Report after doing M-x customize-group bookmark-plus? That might reveal and help fix a Bookmark+ problem, or it might help reveal a pilot error, which could help you. Most people use Bookmark+ in simple ways like what you describe. – Drew Aug 12 '16 at 18:12
2

I use this function to quickly create meaningful bookmarks with a single keypress, without having to think about it:

(defun my/quick-save-bookmark ()
  "Save bookmark with name as 'buffer:row:col'"
  (interactive)
  (bookmark-set (format "%s:%s:line %s:column %s"
            (thing-at-point 'symbol)
            (buffer-name)
            (line-number-at-pos)
            (current-column)))
  (message "Bookmarked saved at current position"))

(global-set-key (kbd "C-S-b") 'my/quick-save-bookmark)

Not sure if this is what you are looking for, but it seems to basically meet your description. I have found it to be very useful and lightweight. I also use helm and this to quickly see my bookmarks:

(bind-key "<menu>" 'helm-bookmarks)
|improve this answer|||||
  • Yes! Also, exactly what I am looking for. Thank you elethan. Although, I should see, if I can get bookmark+ working again. Maybe, the current updates - have repaired it since then, for @Drew – Bob Nelson Gcdr Aug 12 '16 at 18:39
0

If you wonder how to use the current line's contents as bookmark description, here it is:

(defun my/quick-save-bookmark ()
  "Save bookmark with name as 'buffer:row:line-contents'"
  (interactive)
  (bookmark-set (format "%s:%s:%s"
        ;; (thing-at-point 'symbol)
        (buffer-name)
        (line-number-at-pos)
        (string-trim (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
        ;; (current-column)
    ))
  (message "Bookmarked saved at current position"))
(define-key global-map [remap bookmark-set] 'my/quick-save-bookmark)

Replaces the usual bookmark-set shortcut C-x r m. Works nicely with helm. Also, helm displays bookmarks in chronological order, which automatically assigns sort of a context to them. BTW: you can mark bookmarks in helm using C-SPC and then use C-d to delete them.

|improve this answer|||||
  • OP: Bookmark+ also has such autonaming of bookmarks (so no prompt for the name when setting a bookmark). See Autonamed Bookmarks. – Drew Mar 21 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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