I'm running into the error "Marker does not point anywhere" when I try to print a message both in after-change-functions and buffer-list-update-hook. Curiously if only one hook or the other is active the error does not occur, you have to have both! Precise code and steps to reproduce are below. Any advice on how to fix while keeping the message?

Tested on emacs 24.4.1 with -Q flag, on Ubuntu.

;; To reproduce:
;; 1. emacs -Q
;; 2. Have your frame display the scratch buffer, eval the code below in it
;; 3. Create a second frame (C-x,5,2)
;; 4. Have the second frame display the *Messages* buffer.
;; 5. Rapidly switch focus between the two frames
;; You should get the error: (error "Marker does not point anywhere")
;; Why? How do I prevent?

(setq-default debug-on-error t) ;; so you notice the error

(defun common-test (&optional a b c)
  (message "test"))

(add-hook 'after-change-functions #'common-test)
(add-hook 'buffer-list-update-hook #'common-test)

Also here is an example backtrace:

Debugger entered--Lisp error: (error "Marker does not point anywhere")
  handle-switch-frame((switch-frame #<frame *Backtrace* 0x1218168>))
  call-interactively(handle-switch-frame nil nil)
  • Rapidly asking emacs to do anything is asking for trouble. There is something about the way emacs works, probably deep in dynamic (run-time scope) variables of elisp, where the user must not go faster than the editor or an error will appear. Note: I am having the "marker does not point anywhere" problem closing buffers. It is happening during window-before-delete-windows.
    – Paul
    Sep 6, 2021 at 13:34

1 Answer 1


Sounds like a bug to me. Consider reporting it: M-x report-emacs-bug.

  • Hmm, tried it but the mail bounced, "550-Callout verification failed: 550 550 Unrouteable address". I tried sending to [email protected], I had to paste into gmail though since email within emacs isn't setup. Jan 24, 2015 at 6:23
  • Sending mail to [email protected] is sufficient, however you do it. Note that you can use report-emacs-bug with an external mailer (e.g. Outlook, Thunderbird). I do that. You can also use report-emacs-bug to compose your bug report and then just copy it manually into an external mail message, if you don't want to have report-emacs-bug automatically open your external mailer. An advantage of report-emacs-bug is that it captures your Emacs build information.
    – Drew
    Jan 24, 2015 at 16:04

Your Answer

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

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