0

This function makes a temporary buffer, inserting text stored in msg. Hitting q will quit the temporary buffer.

My problem is that The cursor does not move to the temporary buffer as is done with *Backtrace*.

(defun help-show (bfname msg)
  "Display the output of MSG"

  (when (stringp msg)
    (with-output-to-temp-buffer bfname
      (pop-to-buffer bfname)
      (print msg))))
1
  • This seems to be an issue with your Emacs config, probably your display-buffer-alist config. Running M-: (help-show "*gahh*" "test") pops the temporary buffer and locates active point into it. Run Emacs with `emacs -Q" and try yourself.
    – jue
    Aug 24, 2022 at 8:05

1 Answer 1

0

Have solved the problem by taking out pop-to-buffer from inside with-output-to-temp-buffer.

(defun help-show (bfname msg)
  "Display the output of MSG"

  (when (stringp msg)
    (with-output-to-temp-buffer bfname
      (print msg))
    (pop-to-buffer bfname)))
1
  • Please mark the answer as accepted, thank you!
    – Trevoke
    Jul 27, 2023 at 18:24

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.