xemacs version : 21.4.5
* description:
`find-function' erroneously fails, when all of the following
conditions are met:
- the function to find (call it ffunc) is in a file being displayed
in a buffer somewhere (call it fbuff)
- fbuff is narrowed
- ffunc is defined in an area outside the narrowed region in fbuff
* steps to reproduce:
(progn
(require 'bookmark)
(find-function #'bookmark-bmenu-load)
(narrow-to-defun)
(find-function #'bookmark-bmenu-save))
then widen the buffer, and notice that #'bookmark-bmenu-save is
defined just before the definition of #'bookmark-bmenu-load
* how should we fix this?
;; a suggestion in pseudocode
;; note: i haven't taken a look at the find-func code; not sure how
;; easy it would be to implement this
(let* ((fbuff (get-file-buffer (path-to library-of-function)))
(tempbuff (and fbuff
(make-indirect-buffer fbuff
(generate-new-buffer-name " find-function")))))
(if (not fbuff)
(find-function-as-usual)
(find-function-in-buffer tempbuff)
(let ((pt (point)))
(set-buffer fbuff)
(goto-char pt))
(kill-buffer tempbuff)))
;; sounds good (enough)?