Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] select-method widget
@ 2000-05-22 13:16 Didier Verna
  2000-05-22 14:24 ` Per Abrahamsen
  0 siblings, 1 reply; 3+ messages in thread
From: Didier Verna @ 2000-05-22 13:16 UTC (permalink / raw)



	Dear folks,

If there's no objection, I will apply the following patch to the CVS archive.

When using personal backends and notably loading them after gnus itself, the
select-method widget should be recomputed in order to know the new backend and
avoid mismatches in custom buffers.


2000-05-22  Didier Verna  <didier@lrde.epita.fr>

	* gnus.el (gnus-redefine-select-method-widget): new function, call
	it once.
	* gnus-start.el (gnus-declare-backend): use it.


Index: lisp/gnus.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v
retrieving revision 5.136
diff -u -w -r5.136 gnus.el
--- lisp/gnus.el	2000/05/06 21:43:18	5.136
+++ lisp/gnus.el	2000/05/22 13:14:13
@@ -1288,6 +1288,9 @@
 				   (const :format "%v " virtual)
 				   (const respool)))))

+(defun gnus-redefine-select-method-widget ()
+  "Recomputes the select-method widget based on the value of
+`gnus-valid-select-methods'."
 (define-widget 'gnus-select-method 'list
   "Widget for entering a select method."
   :value '(nntp "")
@@ -1302,8 +1305,11 @@
 		  :inline t
 		  (list :format "%v"
 			variable
-			(sexp :tag "Value")))))
+			  (sexp :tag "Value"))))
+    ))

+(gnus-redefine-select-method-widget)
+
 (defcustom gnus-updated-mode-lines '(group article summary tree)
   "List of buffers that should update their mode lines.
 The list may contain the symbols `group', `article', `tree' and
Index: lisp/gnus-start.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-start.el,v
retrieving revision 5.53
diff -u -w -r5.53 gnus-start.el
--- lisp/gnus-start.el	2000/05/17 04:18:53	5.53
+++ lisp/gnus-start.el	2000/05/22 13:14:18
@@ -2651,7 +2651,8 @@
   "Declare backend NAME with ABILITIES as a Gnus backend."
   (setq gnus-valid-select-methods
 	(nconc gnus-valid-select-methods
-	       (list (apply 'list name abilities)))))
+	       (list (apply 'list name abilities))))
+  (gnus-redefine-select-method-widget))

 (defun gnus-set-default-directory ()
   "Set the default directory in the current buffer to `gnus-default-directory'.

--
    /     /   _   _       Didier Verna        http://www.inf.enst.fr/~verna/
 - / / - / / /_/ /        EPITA / LRDE         mailto:didier@lrde.epita.fr
/_/ / /_/ / /__ /      14-16 rue Voltaire        Tel. +33 (1) 44 08 01 77
                   94276 Kremlin-Bicêtre cedex   Fax. +33 (1) 44 08 01 99



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] select-method widget
  2000-05-22 13:16 [PATCH] select-method widget Didier Verna
@ 2000-05-22 14:24 ` Per Abrahamsen
  2000-05-22 15:13   ` Didier Verna
  0 siblings, 1 reply; 3+ messages in thread
From: Per Abrahamsen @ 2000-05-22 14:24 UTC (permalink / raw)


Didier Verna <didier@lrde.epita.fr> writes:

Didier Verna <didier@lrde.epita.fr> writes:

> If there's no objection, I will apply the following patch to the CVS archive.

Looks fine to me, interesting solution to the lack of dynamic custom
types. 

> When using personal backends and notably loading them after gnus
> itself, the select-method widget should be recomputed in order to
> know the new backend and avoid mismatches in custom buffers.

It doesn't really solve this problem though, if you attempt to
customize the value before all backends are loaded.  There should be
an "other/unknown" entry as well.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] select-method widget
  2000-05-22 14:24 ` Per Abrahamsen
@ 2000-05-22 15:13   ` Didier Verna
  0 siblings, 0 replies; 3+ messages in thread
From: Didier Verna @ 2000-05-22 15:13 UTC (permalink / raw)
  Cc: ding

Per Abrahamsen wrote:

> There should be an "other/unknown" entry as well.

        Like this:

Index: gnus.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v
retrieving revision 5.136
diff -u -w -r5.136 gnus.el
--- gnus.el	2000/05/06 21:43:18	5.136
+++ gnus.el	2000/05/22 15:16:22
@@ -1288,6 +1288,9 @@
 				   (const :format "%v " virtual)
 				   (const respool)))))
 
+(defun gnus-redefine-select-method-widget ()
+  "Recomputes the select-method widget based on the value of
+`gnus-valid-select-methods'."
 (define-widget 'gnus-select-method 'list
   "Widget for entering a select method."
   :value '(nntp "")
@@ -1296,14 +1299,18 @@
 		  ,@(mapcar (lambda (entry)
 			      (list 'const :format "%v\n"
 				    (intern (car entry))))
-			    gnus-valid-select-methods))
+			      gnus-valid-select-methods)
+		    (symbol :tag "other"))
 	  (string :tag "Address")
 	  (repeat :tag "Options"
 		  :inline t
 		  (list :format "%v"
 			variable
-			(sexp :tag "Value")))))
+			  (sexp :tag "Value"))))
+    ))
 
+(gnus-redefine-select-method-widget)
+
 (defcustom gnus-updated-mode-lines '(group article summary tree)
   "List of buffers that should update their mode lines.
 The list may contain the symbols `group', `article', `tree' and



-- 
    /     /   _   _       Didier Verna        http://www.inf.enst.fr/~verna/
 - / / - / / /_/ /        EPITA / LRDE         mailto:didier@lrde.epita.fr
/_/ / /_/ / /__ /      14-16 rue Voltaire        Tel. +33 (1) 44 08 01 77
                   94276 Kremlin-Bicêtre cedex   Fax. +33 (1) 44 08 01 99



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-05-22 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-22 13:16 [PATCH] select-method widget Didier Verna
2000-05-22 14:24 ` Per Abrahamsen
2000-05-22 15:13   ` Didier Verna

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