emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A plea for sanity from a frustrated hacker.


From: Juri Linkov
Subject: Re: A plea for sanity from a frustrated hacker.
Date: Sun, 10 Jun 2007 01:45:43 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>> > Would somebody help me find this function, please?
>
>>   [help-mode.el]
>
>>   (define-button-type 'help-function-def
>>     :supertype 'help-xref
>>     'help-function (lambda (fun file)
>>                      (require 'find-func)
>>                      (when (eq file 'C-source)
>>                        (setq file
>>                              (help-C-file-name (indirect-function fun) 
>> 'fun)))
>>                      ;; Don't use find-function-noselect because it follows
>>                      ;; aliases (which fails for built-in functions).
>>                      (let ((location
>>                             (find-function-search-for-symbol fun nil file)))
>>                        (pop-to-buffer (car location))
>>                        (if (cdr location)
>>                            (goto-char (cdr location))
>>                          (message "Unable to find location in file"))))
>>     'help-echo (purecopy "mouse-2, RET: find function's definition"))
>
> Thanks!

The problem is that you can't arrive to this definition by studying
text properties in the *Help* buffer and debugging because
`define-button-type' doesn't define a function or variable.

BTW, I have another frustration with this function.  I like to view
the Help buffer and visit source code from it in the *same* window.
The former is achieved by

    (add-hook 'same-window-regexps "\\*Help\\*\\(\\|<[0-9]+>\\)")

But the latter is impossible since as can be seen in code above
`help-function-def' calls the function `pop-to-buffer' which displays
the source code buffer in a different window.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]