From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Per Abrahamsen Newsgroups: gmane.emacs.devel Subject: PATCH: Use parent links for customization items with no links Date: Sun, 30 Nov 2003 15:13:57 +0100 Organization: The Church of Emacs Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070201715 4646 80.91.224.253 (30 Nov 2003 14:15:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2003 14:15:15 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Nov 30 15:15:13 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQSLx-0006dH-00 for ; Sun, 30 Nov 2003 15:15:13 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQSLw-0002wg-00 for ; Sun, 30 Nov 2003 15:15:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQTIy-0002aE-5u for emacs-devel@quimby.gnus.org; Sun, 30 Nov 2003 10:16:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AQTIo-0002Wc-1t for emacs-devel@gnu.org; Sun, 30 Nov 2003 10:16:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AQTIE-0002Ln-66 for emacs-devel@gnu.org; Sun, 30 Nov 2003 10:15:57 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQTID-0002JT-4l for emacs-devel@gnu.org; Sun, 30 Nov 2003 10:15:25 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQSKk-0001rr-00 for ; Sun, 30 Nov 2003 15:13:58 +0100 Mail-Followup-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQSKj-0001rj-00 for ; Sun, 30 Nov 2003 15:13:57 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQSKj-0001Ah-00 for ; Sun, 30 Nov 2003 15:13:57 +0100 Original-Lines: 88 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:9J3UXKAoz/u3zZo4Buyru4KYH2g= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18219 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18219 On the Gnus developers mailing list, there were a discussion of what to do with :link in the case where a single section in the info file documents a number of options all belonging to the same custom group. If you add a :link to each option, it will clutter display if you customize the group. On the other hand, if you only add the :link to the group, it will not appear when you customize the individual options. Here is a patch to cus-edit.el to handle that case. It will display the links of the parent group, if the item (option/group/face) you are customizing doesn't have any links of its own. Ok to commit? 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.