From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: [drew.adams@oracle.com: links in Help buffer aren't alwayscorrect] Date: Tue, 13 Dec 2005 16:53:56 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134518281 31045 80.91.229.2 (13 Dec 2005 23:58:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2005 23:58:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 00:57:53 2005 Return-path: Original-Received: from [199.232.75.2] (helo=lists.gnu.org) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmK10-0004Fm-6o for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2005 00:57:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmK1Z-0000aQ-5V for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 18:57:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EmK1N-0000a3-No for emacs-devel@gnu.org; Tue, 13 Dec 2005 18:57:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EmK1M-0000Zq-3A for emacs-devel@gnu.org; Tue, 13 Dec 2005 18:57:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmK1L-0000Zn-UX for emacs-devel@gnu.org; Tue, 13 Dec 2005 18:57:24 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EmK3K-00081P-A3 for emacs-devel@gnu.org; Tue, 13 Dec 2005 18:59:26 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EmK01-0003k3-PC for emacs-devel@gnu.org; Wed, 14 Dec 2005 00:56:01 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Dec 2005 00:56:01 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Dec 2005 00:56:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 64 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-Broken-Reverse-DNS: no host name found for IP address 199.232.75.2 Xref: news.gmane.org gmane.emacs.devel:47658 Archived-At: Drew Adams wrote: > There may not be a `describe-frame-parameter' function, but the > `help-make-xrefs' code could use a preceding "frame parameter" to link to > the Info section describing the `buffer-list' parameter. Or, at the very > least, it could test for preceding "frame parameter" in order to do nothing > (add no link) if it is present. Here's a start, cobbled together from describe-variable and your idea of linking to the Info node: (defun describe-frame-parameter (parameter &optional frame) "Display the full documentation of frame PARAMETER (a symbol) in FRAME. If FRAME is nil, describe the selected frame's parameter value." (interactive (let* ((enable-recursive-minibuffers t) (default-param (symbol-at-point)) (param-alist (frame-parameters nil)) (param-name (completing-read (if (assq default-param param-alist) (format "Describe parameter (default %s): " default-param) "Describe parameter: ") obarray (lambda (p) (assq p param-alist)) t nil nil (if default-param (symbol-name default-param))))) (list (if (equal param-name "") default-param (intern param-name))))) (if (null frame) (setq frame (selected-frame))) (if (null parameter) (message "You did not specify a frame parameter") (with-output-to-temp-buffer "*Help*" (prin1 parameter) (princ "'s value is ") (terpri) (let ((param-value (frame-parameter frame parameter))) (with-current-buffer standard-output (let ((from (point))) (pp param-value) ;; (help-xref-on-pp from (point)) (if (< (point) (+ from 20)) (save-excursion (goto-char from) (delete-char -1)))))) (terpri) (terpri) (princ "Documentation (see Info node `(elisp)Window Frame Parameters'):") (terpri) (save-excursion (save-window-excursion (Info-goto-node "(elisp)Window Frame Parameters") (princ (buffer-substring (re-search-forward (concat "^`" (symbol-name parameter) "'")) (1- (or (re-search-forward "^`" nil t) (point-max)))))))))) -- Kevin Rodgers