0

I googled for this with no success. im looking to "bookmark" a lisp code block so that it appears in the emacs/bookmark+ bookmark lists. for example i want to launch this lisp code when i launch a bookmark "xxz"

(defun xxz ()
 "jump"
  (interactive)
  (bmkp-dired-jump "h.nyc" )
  (org-narrow-to-subtree)
   )

anyone know if this is possible at all?

  • 1
    You might also consider using either bookmark-after-jump-hook or bmkp-before-jump-hook. You also have bmkp-jump-display-function. And you can put predefined bookmark tag "bmkp-jump" on any bookmark - give it any function as value - see Tags as Attributes. – Drew Oct 8 '16 at 23:08
  • hmm cool. so i tried this T v bmkp-jump RET (lambda () (org-narrow-to-subtree)) with no apparent success. is that correct syntax? – zeltak Oct 10 '16 at 12:31
  • Yes. What does (bmkp-get-tag-value BOOKMARK "bmkp-jump") tell you for your BOOKMARK? Be sure that the right buffer is really current when you invoke org-narrow-to-subtree (I know nothing about that function, but its doc talks about the current buffer). – Drew Oct 10 '16 at 14:00
  • this is the output Debugger entered--Lisp error: (void-variable h\.nyc) (bmkp-get-tag-value h\.nyc "bmkp-jump") eval((bmkp-get-tag-value h\.nyc "bmkp-jump") nil) eval-expression((bmkp-get-tag-value h\.nyc "bmkp-jump") nil) funcall-interactively(eval-expression (bmkp-get-tag-value h\.nyc "bmkp-jump") nil) call-interactively(eval-expression nil nil) command-execute(eval-expression) – zeltak Oct 11 '16 at 6:41
  • ah, i does seem to work..i could have sworn yesterday it didnt narrow..i did restart emacs server today..but hey as long as it works ;-) thx! – zeltak Oct 11 '16 at 7:25
2

I should have read the bookmark+ deeper. There is a way to do that with

bmkp-make-function-bookmark

This works perfectly.

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.