Gnus development mailing list
 help / color / mirror / Atom feed
* convert from setq to customization
@ 2003-03-01 21:20 Randal L. Schwartz
  2003-03-01 23:59 ` Ted Zlatanov
  2003-03-05 13:31 ` Per Abrahamsen
  0 siblings, 2 replies; 23+ messages in thread
From: Randal L. Schwartz @ 2003-03-01 21:20 UTC (permalink / raw)



The most heavily setq'ed part of my .emacs file is my .gnus.el, which
I constructed mostly before the customization stuff came along.

Is there any trivial way for me to tell the customization stuff to
look at the current values of things, and absorb them as customize
settings?  Am I making any sense?

Part of my concern is that I'm probably setting variables that have
been long deprecated now. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

* Re: convert from setq to customization
  2003-03-01 21:20 convert from setq to customization Randal L. Schwartz
@ 2003-03-01 23:59 ` Ted Zlatanov
  2003-03-03 13:41   ` Kai Großjohann
  2003-03-05 12:49   ` Per Abrahamsen
  2003-03-05 13:31 ` Per Abrahamsen
  1 sibling, 2 replies; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-01 23:59 UTC (permalink / raw)
  Cc: ding

On 01 Mar 2003, merlyn@stonehenge.com wrote:
> The most heavily setq'ed part of my .emacs file is my .gnus.el,
> which I constructed mostly before the customization stuff came
> along.
> 
> Is there any trivial way for me to tell the customization stuff to
> look at the current values of things, and absorb them as customize
> settings?  Am I making any sense?
> 
> Part of my concern is that I'm probably setting variables that have
> been long deprecated now. :)

AFAIK, customization is just a setq generator, so you should be able
to put all your setq variables in your custom.el.  Customize does not
remove variables that are not customizable, so you won't lose any
variables.

As for deprecated variables, it would be nice if Emacs Lisp had a
":deprecated t" property for defcustom.  It doesn't now, according
to the Elisp manual.

I personally prefer to keep my gnus.el full of setq statements,
because I do conditional evaluation based on the system-name.  I
*could* set a separate MACHINE-custom.el file for each system, but
then I can't have a common-custom.el that applies to all systems.  It
would be nice if both Emacs and the Customize code understood about
common and per-machine customizations, but I can imagine a lot of
issues with that.

Ted




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

* Re: convert from setq to customization
  2003-03-01 23:59 ` Ted Zlatanov
@ 2003-03-03 13:41   ` Kai Großjohann
  2003-03-03 15:56     ` Ted Zlatanov
  2003-03-05 12:49   ` Per Abrahamsen
  1 sibling, 1 reply; 23+ messages in thread
From: Kai Großjohann @ 2003-03-03 13:41 UTC (permalink / raw)


Ted Zlatanov <tzz@lifelogs.com> writes:

> AFAIK, customization is just a setq generator, so you should be able
> to put all your setq variables in your custom.el.  Customize does not
> remove variables that are not customizable, so you won't lose any
> variables.

But the customization settings use a different syntax??
-- 
A preposition is not a good thing to end a sentence with.



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

* Re: convert from setq to customization
  2003-03-03 13:41   ` Kai Großjohann
@ 2003-03-03 15:56     ` Ted Zlatanov
  2003-03-03 16:53       ` Kai Großjohann
  0 siblings, 1 reply; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-03 15:56 UTC (permalink / raw)


On Mon, 03 Mar 2003, kai.grossjohann@uni-duisburg.de wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:
> 
>> AFAIK, customization is just a setq generator, so you should be
>> able to put all your setq variables in your custom.el.  Customize
>> does not remove variables that are not customizable, so you won't
>> lose any variables.
> 
> But the customization settings use a different syntax??

I assumed the OP would be able to convert the old settings to the
custom-set-variables format, I've never had difficulties doing that.
Is there something I'm missing?

Ted



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

* Re: convert from setq to customization
  2003-03-03 15:56     ` Ted Zlatanov
@ 2003-03-03 16:53       ` Kai Großjohann
  2003-03-03 19:42         ` Randal L. Schwartz
  0 siblings, 1 reply; 23+ messages in thread
From: Kai Großjohann @ 2003-03-03 16:53 UTC (permalink / raw)


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Mon, 03 Mar 2003, kai.grossjohann@uni-duisburg.de wrote:
>> Ted Zlatanov <tzz@lifelogs.com> writes:
>> 
>>> AFAIK, customization is just a setq generator, so you should be
>>> able to put all your setq variables in your custom.el.  Customize
>>> does not remove variables that are not customizable, so you won't
>>> lose any variables.
>> 
>> But the customization settings use a different syntax??
>
> I assumed the OP would be able to convert the old settings to the
> custom-set-variables format, I've never had difficulties doing that.
> Is there something I'm missing?

Probably not.  (I'd probably try to get Customize to do that
conversion for me :-)

-- 
A preposition is not a good thing to end a sentence with.



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

* Re: convert from setq to customization
  2003-03-03 16:53       ` Kai Großjohann
@ 2003-03-03 19:42         ` Randal L. Schwartz
  2003-03-03 19:51           ` Kai Großjohann
  2003-03-03 20:50           ` Randal L. Schwartz
  0 siblings, 2 replies; 23+ messages in thread
From: Randal L. Schwartz @ 2003-03-03 19:42 UTC (permalink / raw)
  Cc: ding

>>>>> "Kai" == Kai Großjohann <kai.grossjohann@uni-duisburg.de> writes:

>> I assumed the OP would be able to convert the old settings to the
>> custom-set-variables format, I've never had difficulties doing that.
>> Is there something I'm missing?

Kai> Probably not.  (I'd probably try to get Customize to do that
Kai> conversion for me :-)

Which is what started this conversation. :)

I'm lazy.  I wondered if there was something that would do this
automatically.

Apparently not.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

* Re: convert from setq to customization
  2003-03-03 19:42         ` Randal L. Schwartz
@ 2003-03-03 19:51           ` Kai Großjohann
  2003-03-03 20:50           ` Randal L. Schwartz
  1 sibling, 0 replies; 23+ messages in thread
From: Kai Großjohann @ 2003-03-03 19:51 UTC (permalink / raw)
  Cc: ding

merlyn@stonehenge.com (Randal L. Schwartz) writes:

>>>>>> "Kai" == Kai Großjohann <kai.grossjohann@uni-duisburg.de> writes:
>
>>> I assumed the OP would be able to convert the old settings to the
>>> custom-set-variables format, I've never had difficulties doing that.
>>> Is there something I'm missing?
>
> Kai> Probably not.  (I'd probably try to get Customize to do that
> Kai> conversion for me :-)
>
> Which is what started this conversation. :)

It appears that you can replace (setq foo bar) with
(customize-set-variable foo bar) and then eval those statements.
That should put it into the Customize database.  After that, they can
be deleted.

Maybe you need (customize-set-variable 'foo bar).
-- 
A preposition is not a good thing to end a sentence with.



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

* Re: convert from setq to customization
  2003-03-03 19:42         ` Randal L. Schwartz
  2003-03-03 19:51           ` Kai Großjohann
@ 2003-03-03 20:50           ` Randal L. Schwartz
  1 sibling, 0 replies; 23+ messages in thread
From: Randal L. Schwartz @ 2003-03-03 20:50 UTC (permalink / raw)
  Cc: ding

>>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:

Randal> I'm lazy.  I wondered if there was something that would do this
Randal> automatically.

Randal> Apparently not.

Ahh, but I found that it wasn't as hard as I thought.  Here's what
I've been doing in my .gnus.el and .emacs files:

1) hover on a setq or add-hook variable
2) hit ^H v RET
3) if the help buffer contains "customize", select it
4) select "save customized value" if it isn't the default
5) delete the setq
6) go on to the next one

That's already cleaned up a significant portion of my config files.  Cool.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

* Re: convert from setq to customization
  2003-03-01 23:59 ` Ted Zlatanov
  2003-03-03 13:41   ` Kai Großjohann
@ 2003-03-05 12:49   ` Per Abrahamsen
  2003-03-05 20:38     ` Ted Zlatanov
  1 sibling, 1 reply; 23+ messages in thread
From: Per Abrahamsen @ 2003-03-05 12:49 UTC (permalink / raw)


Ted Zlatanov <tzz@lifelogs.com> writes:

> AFAIK, customization is just a setq generator, 

That is definitely not the case.




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

* Re: convert from setq to customization
  2003-03-01 21:20 convert from setq to customization Randal L. Schwartz
  2003-03-01 23:59 ` Ted Zlatanov
@ 2003-03-05 13:31 ` Per Abrahamsen
  2003-03-05 17:38   ` David S Goldberg
                     ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Per Abrahamsen @ 2003-03-05 13:31 UTC (permalink / raw)


merlyn@stonehenge.com (Randal L. Schwartz) writes:

> Is there any trivial way for me to tell the customization stuff to
> look at the current values of things, and absorb them as customize
> settings?  Am I making any sense?

Interesting idea, try this function.  It list all user options that
have been changed outside customize.

(defun customize-rogue ()
  "Customize all user options modified outside customize."
  (interactive)
  (let ((found nil))
    (mapatoms (lambda (symbol)
		(let ((cval (or (get symbol 'customized-value)
				(get symbol 'saved-value)
				(get symbol 'standard-value))))
		  (when (and cval 	;Declared with defcustom.
			     (boundp symbol) ;Has a value.
			     (not (equal (eval (car cval)) 
					 ;; Which does not match customize.
					 (default-value symbol))))
		    (push (list symbol 'custom-variable) found)))))
    (if (not found)
	(error "No rogue user options")
      (custom-buffer-create (custom-sort-items found t nil)
			    "*Customize Rogue*"))))

Unfortuntely, there is too much rude Lisp code that changes user
setings for this to be really useful.




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

* Re: convert from setq to customization
  2003-03-05 13:31 ` Per Abrahamsen
@ 2003-03-05 17:38   ` David S Goldberg
  2003-03-06  8:01     ` Per Abrahamsen
  2003-03-05 18:39   ` Reiner Steib
       [not found]   ` <4nadg9fsw2.fsf@lockgroove.bwh.harvard.edu>
  2 siblings, 1 reply; 23+ messages in thread
From: David S Goldberg @ 2003-03-05 17:38 UTC (permalink / raw)


>>>>> On Wed, 05 Mar 2003 14:31:17 +0100, Per Abrahamsen <abraham@dina.kvl.dk> said:

> merlyn@stonehenge.com (Randal L. Schwartz) writes:
>> Is there any trivial way for me to tell the customization stuff to
>> look at the current values of things, and absorb them as customize
>> settings?  Am I making any sense?

> Interesting idea, try this function.  It list all user options that
> have been changed outside customize.

> (defun customize-rogue ()

Not that I need it any more :-( but would this work for faces set by X
resources?  Moving to the Windows environment was quite a painful
experience in and of itself.  Having to customize all those faces by
hand just made it worse.  I was never able to figure out a way to
generate the custom-set-faces call needed to replicate the settings
from my X resources on the UNIX side.

-- 
Dave Goldberg
david.goldberg6@verizon.net





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

* Re: convert from setq to customization
  2003-03-05 13:31 ` Per Abrahamsen
  2003-03-05 17:38   ` David S Goldberg
@ 2003-03-05 18:39   ` Reiner Steib
  2003-03-06  7:55     ` Per Abrahamsen
       [not found]   ` <4nadg9fsw2.fsf@lockgroove.bwh.harvard.edu>
  2 siblings, 1 reply; 23+ messages in thread
From: Reiner Steib @ 2003-03-05 18:39 UTC (permalink / raw)


On Wed, Mar 05 2003, Per Abrahamsen wrote:

> Interesting idea, try this function.  It list all user options that
> have been changed outside customize.
>
> (defun customize-rogue ()
>   "Customize all user options modified outside customize."
[...]

Starting emacs (21.2.95.2) with "-no-site-file -q" `customize-rogue'
lists the following variables:

current-language-environment debug-ignored-errors default-frame-alist
default-input-method eol-mnemonic-dos eol-mnemonic-mac exec-path
file-coding-system-alist help-event-list menu-bar-mode
mode-line-format normal-erase-is-backspace pop-up-frame-function
same-window-buffer-names same-window-regexps shell-file-name
site-run-file special-display-function text-mode-hook tooltip-mode
unify-8859-on-encoding-mode user-full-name user-mail-address

Would it make sense to omit them in your function?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

* Re: convert from setq to customization
  2003-03-05 12:49   ` Per Abrahamsen
@ 2003-03-05 20:38     ` Ted Zlatanov
  0 siblings, 0 replies; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-05 20:38 UTC (permalink / raw)


On Wed, 05 Mar 2003, abraham@dina.kvl.dk wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:
> 
>> AFAIK, customization is just a setq generator, 
> 
> That is definitely not the case.

In the context of the thread that statement made sense (we were
talking about converting setq statements to the custom-set-variables
format), but alone it *is* overly simplistic.  Of course, I didn't
mean that customization is trivial by any means, I was only referring
to migrating setq statements.  Thanks for customize-rogue, that is
very neat code.

Ted



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

* Re: convert from setq to customization
  2003-03-05 18:39   ` Reiner Steib
@ 2003-03-06  7:55     ` Per Abrahamsen
  0 siblings, 0 replies; 23+ messages in thread
From: Per Abrahamsen @ 2003-03-06  7:55 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> On Wed, Mar 05 2003, Per Abrahamsen wrote:
>
>> Interesting idea, try this function.  It list all user options that
>> have been changed outside customize.
>>
>> (defun customize-rogue ()
>>   "Customize all user options modified outside customize."
> [...]
>
> Starting emacs (21.2.95.2) with "-no-site-file -q" `customize-rogue'
> lists the following variables:
>
> current-language-environment debug-ignored-errors default-frame-alist
> default-input-method eol-mnemonic-dos eol-mnemonic-mac exec-path
> file-coding-system-alist help-event-list menu-bar-mode
> mode-line-format normal-erase-is-backspace pop-up-frame-function
> same-window-buffer-names same-window-regexps shell-file-name
> site-run-file special-display-function text-mode-hook tooltip-mode
> unify-8859-on-encoding-mode user-full-name user-mail-address
>
> Would it make sense to omit them in your function?

No, but it would make sense to fix them, some of them just need to
have the correct standard-value.  I suspect menu-bar-mode has already
been fixed in CVS.




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

* Re: convert from setq to customization
  2003-03-05 17:38   ` David S Goldberg
@ 2003-03-06  8:01     ` Per Abrahamsen
  0 siblings, 0 replies; 23+ messages in thread
From: Per Abrahamsen @ 2003-03-06  8:01 UTC (permalink / raw)


David S Goldberg <david.goldberg6@verizon.net> writes:

> Not that I need it any more :-( but would this work for faces set by X
> resources? 

Nope.  Variables only.





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

* Re: convert from setq to customization
       [not found]     ` <rju1ehc501.fsf@zuse.dina.kvl.dk>
@ 2003-03-06 17:56       ` Ted Zlatanov
  2003-03-06 20:13         ` Simon Josefsson
  2003-03-07  9:02         ` Per Abrahamsen
  0 siblings, 2 replies; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-06 17:56 UTC (permalink / raw)


On Thu, 06 Mar 2003, abraham@dina.kvl.dk wrote:
> User options, i.e. anything declared by defcustom or defface, should
> only be modified the user, either by setq's in .emacs or
> interactivly through customize.
> 
> If it is done by other Lisp packages, they risk conflicting with the
> users choices.

What if package A has variable A1, which needs to be overridden by
package B because of variable B1?

For example, spam.el requires nnimap-split-download-body in nnimap.el
to be set if a statistical filter is selected, so the whole message
body is downloaded.

Thanks
Ted



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

* Re: convert from setq to customization
  2003-03-06 17:56       ` Ted Zlatanov
@ 2003-03-06 20:13         ` Simon Josefsson
  2003-03-07 16:19           ` Ted Zlatanov
  2003-03-07  9:02         ` Per Abrahamsen
  1 sibling, 1 reply; 23+ messages in thread
From: Simon Josefsson @ 2003-03-06 20:13 UTC (permalink / raw)


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 06 Mar 2003, abraham@dina.kvl.dk wrote:
>> User options, i.e. anything declared by defcustom or defface, should
>> only be modified the user, either by setq's in .emacs or
>> interactivly through customize.
>> 
>> If it is done by other Lisp packages, they risk conflicting with the
>> users choices.
>
> What if package A has variable A1, which needs to be overridden by
> package B because of variable B1?
>
> For example, spam.el requires nnimap-split-download-body in nnimap.el
> to be set if a statistical filter is selected, so the whole message
> body is downloaded.

This crossed my mind as well... spam.el should not setq n-s-d-b.

Either spam.el should bind the variable temporarily, or if that
doesn't work, we can add a undocumented variable nnimap-using-spam
which spam.el can set instead.




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

* Re: convert from setq to customization
  2003-03-06 17:56       ` Ted Zlatanov
  2003-03-06 20:13         ` Simon Josefsson
@ 2003-03-07  9:02         ` Per Abrahamsen
  1 sibling, 0 replies; 23+ messages in thread
From: Per Abrahamsen @ 2003-03-07  9:02 UTC (permalink / raw)
  Cc: emacs-custom

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 06 Mar 2003, abraham@dina.kvl.dk wrote:
>> User options, i.e. anything declared by defcustom or defface, should
>> only be modified the user, either by setq's in .emacs or
>> interactivly through customize.
>> 
>> If it is done by other Lisp packages, they risk conflicting with the
>> users choices.
>
> What if package A has variable A1, which needs to be overridden by
> package B because of variable B1?

Split the variable in two, A1-user and A1-default the first being
defcustom (for the user) and the second defvar (for other packages),
with the first taking precedence over the second if changed .

> For example, spam.el requires nnimap-split-download-body in nnimap.el
> to be set if a statistical filter is selected, so the whole message
> body is downloaded.

If ann option explicitly set by the user prevent another package from
running, that package should give an error, not overwrite the EXPLICIT
user choice.

Defaults is another case, covered by my suggestion above.





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

* Re: convert from setq to customization
  2003-03-06 20:13         ` Simon Josefsson
@ 2003-03-07 16:19           ` Ted Zlatanov
  2003-03-07 16:36             ` Simon Josefsson
  0 siblings, 1 reply; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-07 16:19 UTC (permalink / raw)


On Thu, 06 Mar 2003, jas@extundo.com wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:

>> For example, spam.el requires nnimap-split-download-body in
>> nnimap.el to be set if a statistical filter is selected, so the
>> whole message body is downloaded.
> 
> This crossed my mind as well... spam.el should not setq n-s-d-b.
> 
> Either spam.el should bind the variable temporarily, or if that
> doesn't work, we can add a undocumented variable nnimap-using-spam
> which spam.el can set instead.

How about spam.el generating an error if n-s-d-b is nil and a
statistical splitter function is selected?  What kind of error is
reasonable, a showstopper (error) or a Gnus message?  I am not sure
because this is not a critical problem, it only means that incoming
spam may not be properly classified.  Also, can I set n-s-d-b in the
middle of splitting, or does it have to be set at the beginning of the
IMAP conversation with the server?  If I could set it, I could ask the
user if he wants to set it automatically, and then come back and
resume splitting.  Hmm, but then the IMAP session might time out.

Ted



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

* Re: convert from setq to customization
  2003-03-07 16:19           ` Ted Zlatanov
@ 2003-03-07 16:36             ` Simon Josefsson
  2003-03-07 17:33               ` Ted Zlatanov
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Josefsson @ 2003-03-07 16:36 UTC (permalink / raw)


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 06 Mar 2003, jas@extundo.com wrote:
>> Ted Zlatanov <tzz@lifelogs.com> writes:
>
>>> For example, spam.el requires nnimap-split-download-body in
>>> nnimap.el to be set if a statistical filter is selected, so the
>>> whole message body is downloaded.
>> 
>> This crossed my mind as well... spam.el should not setq n-s-d-b.
>> 
>> Either spam.el should bind the variable temporarily, or if that
>> doesn't work, we can add a undocumented variable nnimap-using-spam
>> which spam.el can set instead.
>
> How about spam.el generating an error if n-s-d-b is nil and a
> statistical splitter function is selected?  What kind of error is
> reasonable, a showstopper (error) or a Gnus message?  I am not sure
> because this is not a critical problem, it only means that incoming
> spam may not be properly classified.

Yes, an error seems too much.  Using a separate, non-customized,
nnimap variable that spam.el can set seems like a better approach, and
this approach is used in similar situations already.  It would also
allow people to set n-s-d-b to override the spam.el decision, if they
wanted that.

> Also, can I set n-s-d-b in the middle of splitting, or does it have
> to be set at the beginning of the IMAP conversation with the server?

It is only used by n-request-scan, and it can be set and changed at
any point.

> If I could set it, I could ask the user if he wants to set it
> automatically, and then come back and resume splitting.  Hmm, but
> then the IMAP session might time out.

But you would need to remember the decision so it isn't asked every
time...  the solution above seems better, IMHO.




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

* Re: convert from setq to customization
  2003-03-07 16:36             ` Simon Josefsson
@ 2003-03-07 17:33               ` Ted Zlatanov
  2003-03-07 18:38                 ` Simon Josefsson
  0 siblings, 1 reply; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-07 17:33 UTC (permalink / raw)


On Fri, 07 Mar 2003, jas@extundo.com wrote:
> Yes, an error seems too much.  Using a separate, non-customized,
> nnimap variable that spam.el can set seems like a better approach,
> and this approach is used in similar situations already.  It would
> also allow people to set n-s-d-b to override the spam.el decision,
> if they wanted that.

OK with me, let me know when you have that in place.  Also I have to
load nnimap.el to avoid the 

** assignment to free variable nnimap-split-download-body 

error (I will get it with nnimap-using-spam as well, surely) - is
there something I can do without loading nnimap, maybe an autoloaded
function?  I don't want to load nnimap needlessly, and I don't want to
override gnus-get-new-news with a wrapper that does a lexical
let. 

There's no way to know that nnimap is needed by the user at any point!
Should I just load nnimap and live with the shame? :)

Thanks
Ted



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

* Re: convert from setq to customization
  2003-03-07 17:33               ` Ted Zlatanov
@ 2003-03-07 18:38                 ` Simon Josefsson
  2003-03-07 19:46                   ` Ted Zlatanov
  0 siblings, 1 reply; 23+ messages in thread
From: Simon Josefsson @ 2003-03-07 18:38 UTC (permalink / raw)


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Fri, 07 Mar 2003, jas@extundo.com wrote:
>> Yes, an error seems too much.  Using a separate, non-customized,
>> nnimap variable that spam.el can set seems like a better approach,
>> and this approach is used in similar situations already.  It would
>> also allow people to set n-s-d-b to override the spam.el decision,
>> if they wanted that.
>
> OK with me, let me know when you have that in place.

Done, use n-s-d-b-default instead.

(defvar nnimap-split-download-body-default nil
  "Internal variable with default value for `nnimap-split-download-body'.")

(defcustom nnimap-split-download-body 'default
  "Whether to download entire articles during splitting.
This is generally not required, and will slow things down considerably.
You may need it if you want to use an advanced splitting function that
analyses the body before splitting the article.
If this variable is nil, bodies will not be downloaded; if this
variable is the symbol `default' the default behaviour is
used (which currently is nil, unless you use a statistical
spam.el test); if this variable is another non-nil value bodies
will be downloaded."
  :group 'nnimap
  :type '(choice (const :tag "Let system decide" deault)
		 boolean))

> Also I have to load nnimap.el to avoid the
>
> ** assignment to free variable nnimap-split-download-body 
>
> error (I will get it with nnimap-using-spam as well, surely) - is
> there something I can do without loading nnimap, maybe an autoloaded
> function?  I don't want to load nnimap needlessly, and I don't want to
> override gnus-get-new-news with a wrapper that does a lexical
> let.
>
> There's no way to know that nnimap is needed by the user at any point!
> Should I just load nnimap and live with the shame? :)

No, add (defvar nnimap-split-download-body) to spam.el.  Or
(eval-when-compile (require 'nnimap)).  Or we can put an autoload
cookie on n-s-d-b-d.




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

* Re: convert from setq to customization
  2003-03-07 18:38                 ` Simon Josefsson
@ 2003-03-07 19:46                   ` Ted Zlatanov
  0 siblings, 0 replies; 23+ messages in thread
From: Ted Zlatanov @ 2003-03-07 19:46 UTC (permalink / raw)


On Fri, 07 Mar 2003, jas@extundo.com wrote:
> Done, use n-s-d-b-default instead.
> 
> (defvar nnimap-split-download-body-default nil
>   "Internal variable with default value for
>   `nnimap-split-download-body'.")
> 
> (defcustom nnimap-split-download-body 'default

Elegant solution, thanks Simon and Per.  spam.el is updated
correspondingly.

>> Also I have to load nnimap.el to avoid the
>>
>> ** assignment to free variable nnimap-split-download-body 
> 
> No, add (defvar nnimap-split-download-body) to spam.el.  Or
> (eval-when-compile (require 'nnimap)).  Or we can put an autoload
> cookie on n-s-d-b-d.

I did eval-when-compile, it seems like the best solution.

Ted



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

end of thread, other threads:[~2003-03-07 19:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-01 21:20 convert from setq to customization Randal L. Schwartz
2003-03-01 23:59 ` Ted Zlatanov
2003-03-03 13:41   ` Kai Großjohann
2003-03-03 15:56     ` Ted Zlatanov
2003-03-03 16:53       ` Kai Großjohann
2003-03-03 19:42         ` Randal L. Schwartz
2003-03-03 19:51           ` Kai Großjohann
2003-03-03 20:50           ` Randal L. Schwartz
2003-03-05 12:49   ` Per Abrahamsen
2003-03-05 20:38     ` Ted Zlatanov
2003-03-05 13:31 ` Per Abrahamsen
2003-03-05 17:38   ` David S Goldberg
2003-03-06  8:01     ` Per Abrahamsen
2003-03-05 18:39   ` Reiner Steib
2003-03-06  7:55     ` Per Abrahamsen
     [not found]   ` <4nadg9fsw2.fsf@lockgroove.bwh.harvard.edu>
     [not found]     ` <rju1ehc501.fsf@zuse.dina.kvl.dk>
2003-03-06 17:56       ` Ted Zlatanov
2003-03-06 20:13         ` Simon Josefsson
2003-03-07 16:19           ` Ted Zlatanov
2003-03-07 16:36             ` Simon Josefsson
2003-03-07 17:33               ` Ted Zlatanov
2003-03-07 18:38                 ` Simon Josefsson
2003-03-07 19:46                   ` Ted Zlatanov
2003-03-07  9:02         ` Per Abrahamsen

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