Gnus development mailing list
 help / color / mirror / Atom feed
From: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: Re: Adding :link '(custom-manual ...) in defcustom
Date: Sun, 30 Nov 2003 15:07:30 +0100	[thread overview]
Message-ID: <rjisl2ne59.fsf@sheridan.dina.kvl.dk> (raw)
In-Reply-To: <m3r7zry2dc.fsf@defun.localdomain>

Jesper Harder <harder@ifa.au.dk> 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  <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:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1APqoO-0003Ah-00@quimby.gnus.org>
2003-11-28 22:26 ` CVS update of gnus/lisp (ChangeLog message.el) Jesper Harder
2003-11-28 22:58   ` Adding :link '(custom-manual ...) in defcustom (was: CVS update of gnus/lisp (ChangeLog message.el)) Reiner Steib
2003-11-28 23:52     ` Adding :link '(custom-manual ...) in defcustom Reiner Steib
2003-11-29  9:01     ` Jesper Harder
2003-11-30 14:07       ` Per Abrahamsen [this message]

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

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

  git send-email \
    --in-reply-to=rjisl2ne59.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.
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 NNTP newsgroup(s).