1. Add the following to .spacemacs:
      (defun my-bookmark-set (char)
        (interactive "cPlease enter a bookmark name to set: ")
        (bookmark-set (char-to-string char)))

      (defun my-bookmark-jump (char)
        (interactive "cPlease enter a bookmark name to jump to: ")
        (bookmark-jump (char-to-string char)))

      (define-key evil-normal-state-map (kbd "'") 'my-bookmark-jump)
      (define-key evil-normal-state-map (kbd "m") 'my-bookmark-set)
  1. Set a bookmark a with C-x r m a or ma, and quit and restart emacs

  2. Navigation to bookmark a fails with "Invalid bookmark a" displayed

  1. Navigation to bookmark a succeeds
C-x r b a
  1. Move cursor to another location

  2. Navigation to bookmark a succeeds


Why does the action at step 3. fail, when at step 6. and subsequently it succeeds?


It's not clear what error you're getting, and when. First you say that you get an Invalid bookmark error, without providing a recipe. Then you provide a recipe, I think, for the void-function-definition error. What's the real problem/question?

Anyway, ignoring the invalid-bookmark problem, do you see the same void-function-definition problem if you start Emacs using emacs -Q (no init file)? If not, bisect your init file to find the culprit.

If you do see the same thing, do M-x debug-on-entry my-bookmark-jump and show the Backtrace you get when you invoke my-bookmark-jump.

| improve this answer | |

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.