Gnus development mailing list
 help / color / mirror / Atom feed
From: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: Patch for customizing topics (was: Re: Customize topic?)
Date: 28 Oct 1998 19:21:52 +0100	[thread overview]
Message-ID: <rjzpago8cf.fsf@zuse.+dina.kvl.dk> (raw)
In-Reply-To: <vafiuh7enoz.fsf@ramses.cs.uni-dortmund.de>

This patch is for Gnus v5.6.42, I haven't installed pgnus yet.  But it
might apply cleanly to pgnus nonetheless.

1998-10-28  Per Abrahamsen  <abraham@dina.kvl.dk>

	* gnus-cus-new.el (gnus-custom-topic): New free variable.
	(gnus-group-customize): Support editing topic parameters.

cd ~/emacs/gnus/lisp/
diff -c gnus-cus.el gnus-cus-new.el
*** gnus-cus.el	Thu Aug 27 11:03:56 1998
--- gnus-cus-new.el	Wed Oct 28 19:10:38 1998
***************
*** 169,178 ****
  (defvar gnus-custom-params)
  (defvar gnus-custom-method)
  (defvar gnus-custom-group)
  
! (defun gnus-group-customize (group)
!   "Edit the group on the current line."
!   (interactive (list (gnus-group-group-name)))
    (let (info
  	(types (mapcar (lambda (entry)
  			 `(cons :format "%v%h\n"
--- 169,179 ----
  (defvar gnus-custom-params)
  (defvar gnus-custom-method)
  (defvar gnus-custom-group)
+ (defvar gnus-custom-topic)
  
! (defun gnus-group-customize (group topic)
!   "Edit the group or topicon the current line."
!   (interactive (list (gnus-group-group-name) (gnus-group-topic-name)))
    (let (info
  	(types (mapcar (lambda (entry)
  			 `(cons :format "%v%h\n"
***************
*** 180,188 ****
  				(const :format "" ,(nth 0 entry))
  				,(nth 1 entry)))
  		       gnus-group-parameters)))
!     (unless group
        (error "No group on current line"))
!     (unless (setq info (gnus-get-info group))
        (error "Killed group; can't be edited"))
      ;; Ready.
      (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
--- 181,191 ----
  				(const :format "" ,(nth 0 entry))
  				,(nth 1 entry)))
  		       gnus-group-parameters)))
!     (unless (or group topic)
        (error "No group on current line"))
!     (when (and group topic)
!       (error "Both a group an topic on current line"))
!     (unless (or topic (setq info (gnus-get-info group)))
        (error "Killed group; can't be edited"))
      ;; Ready.
      (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
***************
*** 190,202 ****
      (gnus-custom-mode)
      (make-local-variable 'gnus-custom-group)
      (setq gnus-custom-group group)
      (widget-insert "Customize the ")
!     (widget-create 'info-link
! 		   :help-echo "Push me to learn more."
! 		   :tag "group parameters"
! 		   "(gnus)Group Parameters")
      (widget-insert " for <")
!     (widget-insert group)
      (widget-insert "> and press ")
      (widget-create 'push-button
  		   :tag "done"
--- 193,212 ----
      (gnus-custom-mode)
      (make-local-variable 'gnus-custom-group)
      (setq gnus-custom-group group)
+     (make-local-variable 'gnus-custom-topic)
+     (setq gnus-custom-topic topic)
      (widget-insert "Customize the ")
!     (if group 
! 	(widget-create 'info-link
! 		       :help-echo "Push me to learn more."
! 		       :tag "group parameters"
! 		       "(gnus)Group Parameters")
!       (widget-create 'info-link
! 		     :help-echo "Push me to learn more."
! 		     :tag  "topic parameters"
! 		     "(gnus)Topic Parameters"))
      (widget-insert " for <")
!     (widget-insert (or group topic))
      (widget-insert "> and press ")
      (widget-create 'push-button
  		   :tag "done"
***************
*** 206,220 ****
      (make-local-variable 'gnus-custom-params)
      (setq gnus-custom-params
  	  (widget-create 'group
! 			 :value (gnus-info-params info)
  			 `(set :inline t
  			       :greedy t
  			       :tag "Parameters"
  			       :format "%t:\n%h%v"
  			       :doc "\
  These special paramerters are recognized by Gnus.
! Check the [ ] for the parameters you want to apply to this group, then
! edit the value to suit your taste."
  			       ,@types)
  			 '(repeat :inline t
  				  :tag "Variables"
--- 216,232 ----
      (make-local-variable 'gnus-custom-params)
      (setq gnus-custom-params
  	  (widget-create 'group
! 			 :value (if group 
! 				    (gnus-info-params info)
! 				  (gnus-topic-parameters topic))
  			 `(set :inline t
  			       :greedy t
  			       :tag "Parameters"
  			       :format "%t:\n%h%v"
  			       :doc "\
  These special paramerters are recognized by Gnus.
! Check the [ ] for the parameters you want to apply to this group or
! to the groups in this topic, then edit the value to suit your taste."
  			       ,@types)
  			 '(repeat :inline t
  				  :tag "Variables"
***************
*** 240,265 ****
  			 '(repeat :inline t
  				  :tag "Unknown entries"
  				  sexp)))
!     (widget-insert "\n\nYou can also edit the ")
!     (widget-create 'info-link
! 		   :tag "select method"
! 		   :help-echo "Push me to learn more about select methods."
! 		   "(gnus)Select Methods")
!     (widget-insert " for the group.\n")
!     (setq gnus-custom-method
! 	  (widget-create 'sexp
! 			 :tag "Method"
! 			 :value (gnus-info-method info)))
      (use-local-map widget-keymap)
      (widget-setup)))
  
  (defun gnus-group-customize-done (&rest ignore)
    "Apply changes and bury the buffer."
    (interactive)
!   (gnus-group-edit-group-done 'params gnus-custom-group
! 			      (widget-value gnus-custom-params))
!   (gnus-group-edit-group-done 'method gnus-custom-group
! 			      (widget-value gnus-custom-method))
    (bury-buffer))
  
  ;;; Score Customization:
--- 252,281 ----
  			 '(repeat :inline t
  				  :tag "Unknown entries"
  				  sexp)))
!     (when group
!       (widget-insert "\n\nYou can also edit the ")
!       (widget-create 'info-link
! 		     :tag "select method"
! 		     :help-echo "Push me to learn more about select methods."
! 		     "(gnus)Select Methods")
!       (widget-insert " for the group.\n")
!       (setq gnus-custom-method
! 	    (widget-create 'sexp
! 			   :tag "Method"
! 			   :value (gnus-info-method info))))
      (use-local-map widget-keymap)
      (widget-setup)))
  
  (defun gnus-group-customize-done (&rest ignore)
    "Apply changes and bury the buffer."
    (interactive)
!   (if gnus-custom-topic
!       (gnus-topic-set-parameters gnus-custom-topic 
! 				 (widget-value gnus-custom-params))
!     (gnus-group-edit-group-done 'params gnus-custom-group
! 				(widget-value gnus-custom-params))
!     (gnus-group-edit-group-done 'method gnus-custom-group
! 				(widget-value gnus-custom-method)))
    (bury-buffer))
  
  ;;; Score Customization:

Compilation exited abnormally with code 1 at Wed Oct 28 19:14:13


      reply	other threads:[~1998-10-28 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-26  8:23 Customize topic? Kai Grossjohann
1998-10-28 18:21 ` 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=rjzpago8cf.fsf@zuse.+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).