Created
October 17, 2013 16:25
-
-
Save dhaley/7027929 to your computer and use it in GitHub Desktop.
describe-function-via-pman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; pman | |
;; sudo pear channel-update doc.php.net | |
;; sudo pear install doc.php.net/pman | |
(defun describe-function-via-pman (function) | |
"Display the full documentation of FUNCTION, using pman" | |
(interactive | |
(let ( | |
(fn (intern-soft (thing-at-point 'symbol) | |
obarray)) | |
(enable-recursive-minibuffers t) | |
val) | |
(setq val (completing-read (if fn | |
(format "Describe function (default %s): " fn) | |
"Describe function: ") | |
obarray 'fboundp t nil nil | |
(and fn (symbol-name fn)))) | |
(list (if (equal val "") | |
fn (intern val))))) | |
(if (null function) | |
(message "You didn't specify a function") | |
(help-setup-xref (list #'describe-function function) | |
(called-interactively-p 'interactive)) | |
(save-excursion | |
(let ((manual-program "pman")) | |
(man (symbol-name function)))))) | |
(define-key php-mode-map "\C-hf" 'describe-function-via-pman))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment