Emacs is freezing when running the following custom find-function and I'm looking for some assistance, please, to debug it.
I'd like the prefix argument C-u
to make the difference between switch-to-buffer-other-window
or switch-to-buffer
. By removing find-function-read
from the interactive statement, that function no longer returns a symbol -- so that is why I am using make-symbol
. I did not see an example by Googling that shows how to use an interactive command of "P"
and another function such as find-function-read
all in the same interactive statement.
(defun my-find-function (arg)
"Find, in another window, the definition of FUNCTION near point.
See `find-function' for more details."
(interactive "P")
(let ((function (make-symbol (format "%s" (car (find-function-read))))))
(if (eq arg '(4))
(find-function-do-it function nil 'switch-to-buffer-other-window)
(find-function-do-it function nil 'switch-to-buffer))))