unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: PATCH: Use parent links for customization items with no links
Date: Sun, 30 Nov 2003 15:13:57 +0100	[thread overview]
Message-ID: <rjd6bandui.fsf@sheridan.dina.kvl.dk> (raw)

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  <abraham@dina.kvl.dk>

	* 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.

                 reply	other threads:[~2003-11-30 14:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rjd6bandui.fsf@sheridan.dina.kvl.dk \
    --to=abraham@dina.kvl.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).