From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54993 Path: main.gmane.org!not-for-mail From: Per Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Adding :link '(custom-manual ...) in defcustom Date: Sun, 30 Nov 2003 15:07:30 +0100 Organization: The Church of Emacs Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070201275 3874 80.91.224.253 (30 Nov 2003 14:07:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2003 14:07:55 +0000 (UTC) Original-X-From: ding-owner+M3533@lists.math.uh.edu Sun Nov 30 15:07:52 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQSEq-0006RH-00 for ; Sun, 30 Nov 2003 15:07:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AQSEd-0001d3-00; Sun, 30 Nov 2003 08:07:39 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AQSEX-0001cy-00 for ding@lists.math.uh.edu; Sun, 30 Nov 2003 08:07:33 -0600 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id 339D13A0025 for ; Sun, 30 Nov 2003 08:07:33 -0600 (CST) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQSEW-0001ll-00 for ; Sun, 30 Nov 2003 15:07:32 +0100 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQSEV-0001ld-00 for ; Sun, 30 Nov 2003 15:07:31 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQSEV-0000zt-00 for ; Sun, 30 Nov 2003 15:07:31 +0100 Original-Lines: 86 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: +kRV2]2q}lixHkE{U)mY#+6]{AH=yN~S9@IFiOa@X6?GM|8MBp/ Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:8zkXFO/lQEhQRO5Sss4RLK4YUkI= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54993 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54993 Jesper Harder writes: > You can currently add a link in `defgroup'. If the link in > `defcustom' would be same as in the group it can be omitted -- it > ought to be enough to list the same link just once per group. > > If `customize-option' was changed to grab links from the parent > group of the option, then we wouldn't need to add links to > individual options (unless the link is different from the group's). Here is a patch that does that. I'll submit it to emacs-devel. 2003-11-30 Per Abrahamsen * cus-edit.el (custom-add-parent-links): Add documentation links for parent, if the item has none of its own. Index: lisp/cus-edit.el =================================================================== RCS file: /cvsroot/emacs//emacs/lisp/cus-edit.el,v retrieving revision 1.187 diff -c -r1.187 cus-edit.el *** lisp/cus-edit.el 1 Sep 2003 15:45:09 -0000 1.187 --- lisp/cus-edit.el 30 Nov 2003 14:03:56 -0000 *************** *** 1956,1962 **** (type (widget-type widget)) (buttons (widget-get widget :buttons)) (start (point)) ! found) (insert (or initial-string "Parent groups:")) (mapatoms (lambda (symbol) (let ((entry (assq name (get symbol 'custom-group)))) --- 1956,1962 ---- (type (widget-type widget)) (buttons (widget-get widget :buttons)) (start (point)) ! (parents nil)) (insert (or initial-string "Parent groups:")) (mapatoms (lambda (symbol) (let ((entry (assq name (get symbol 'custom-group)))) *************** *** 1967,1978 **** :tag (custom-unlispify-tag-name symbol) symbol) buttons) ! (setq found t))))) ! (widget-put widget :buttons buttons) ! (if found ! (insert "\n") (delete-region start (point))) ! found)) ;;; The `custom-comment' Widget. --- 1967,1995 ---- :tag (custom-unlispify-tag-name symbol) symbol) buttons) ! (setq parents (cons symbol parents)))))) ! (and (null (get symbol 'custom-links)) ;No links of its own. ! (= (length parents) 1) ;A single parent. ! (let ((links (get (car parents) 'custom-links))) ! (when links ! (insert "\nParent documentation: ") ! (while links ! (push (widget-create-child-and-convert widget (car links)) ! buttons) ! (setq links (cdr links)) ! (cond ((null links) ! (insert ".\n")) ! ((null (cdr links)) ! (if many ! (insert ", and ") ! (insert " and "))) ! (t ! (insert ", "))))))) ! (if parents ! (insert "\n") (delete-region start (point))) ! (widget-put widget :buttons buttons) ! parents)) ;;; The `custom-comment' Widget.