Gnus development mailing list
 help / color / mirror / Atom feed
* smtpmail.el: set-buffer-file-coding-system takes too many args
@ 2007-01-03 15:30 David Z Maze
  2007-01-06 14:50 ` Reiner Steib
  0 siblings, 1 reply; 13+ messages in thread
From: David Z Maze @ 2007-01-03 15:30 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

I ran 'cvs update' after a long drought and suddenly couldn't send any
mail!  I tracked this down to a change in smtpmail.el that sets the
coding system on outgoing mail buffers; it calls
set-buffer-file-coding-system with four arguments, but my Emacs ("GNU
Emacs 21.4.1 (sparc-sun-solaris2.10, X toolkit) of 2005-05-31 on
maytag.mit.edu") only takes three.

To make things work I needed the following:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 979 bytes --]

--- smtpmail.el 27 Nov 2006 00:39:24 -0000      7.5
+++ smtpmail.el 3 Jan 2007 15:25:57 -0000
@@ -248,7 +248,7 @@
          ;; buffer, otherwise any write-region invocations (e.g., in
          ;; mail-do-fcc below) will annoy with asking for a suitable
          ;; encoding.
-         (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+         (set-buffer-file-coding-system smtpmail-code-conv-from nil)
          (insert-buffer-substring mailbuf)
          (goto-char (point-max))
          ;; require one newline at the end.
@@ -394,7 +394,7 @@
                (make-directory smtpmail-queue-dir t))
              (with-current-buffer buffer-data
                (erase-buffer)
-               (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+               (set-buffer-file-coding-system smtpmail-code-conv-from nil)
                (insert-buffer-substring tembuf)
                (write-file file-data)
                (set-buffer buffer-elisp)

[-- Attachment #3: Type: text/plain, Size: 173 bytes --]


Is the last arg necessary on some other Emacs?  Is there some Gnus
compatability shim that'll work here?  Does its status in "contrib"
affect things any?

Thanks,

  --dzm

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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-03 15:30 smtpmail.el: set-buffer-file-coding-system takes too many args David Z Maze
@ 2007-01-06 14:50 ` Reiner Steib
  2007-01-06 17:59   ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-01-06 14:50 UTC (permalink / raw)
  Cc: Simon Josefsson, ding

On Wed, Jan 03 2007, David Z Maze wrote:

> I ran 'cvs update' after a long drought and suddenly couldn't send any
> mail!  I tracked this down to a change in smtpmail.el that sets the
> coding system on outgoing mail buffers; it calls
> set-buffer-file-coding-system with four arguments, but my Emacs ("GNU
> Emacs 21.4.1 (sparc-sun-solaris2.10, X toolkit) of 2005-05-31 on
> maytag.mit.edu") only takes three.
>
> To make things work I needed the following:
>
> --- smtpmail.el 27 Nov 2006 00:39:24 -0000      7.5
> +++ smtpmail.el 3 Jan 2007 15:25:57 -0000
> @@ -248,7 +248,7 @@
>           ;; buffer, otherwise any write-region invocations (e.g., in
>           ;; mail-do-fcc below) will annoy with asking for a suitable
>           ;; encoding.
> -         (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
> +         (set-buffer-file-coding-system smtpmail-code-conv-from nil)
[...]
> Is the last arg necessary on some other Emacs?

If I understand Eli's comment correctly, it seems to be necessary (at
least for mail-do-fcc).

> Is there some Gnus compatability shim that'll work here?  Does its
> status in "contrib" affect things any?

The version in contrib/ is synced from Emacs CVS:

,----[ contrib/README ]
| sendmail.el
| smtpmail.el
| 
| 	Copies of the corresponding files from the Emacs lisp/mail/
| 	directory, to provide features (occasionally) needed by Gnus which
| 	may not be provided by the versions of these files in older Emacs
| 	distributions.
`----

IIRC, smtpmail.el is also included with XEmacs.  Simon, is
`smtpmail.el' (from Emacs CVS) supposed to work with XEmacs without
modifications?  If so `smtpmail.el' should probably not use the
NOMODIFY argument or provide some compatibility code.

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



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-06 14:50 ` Reiner Steib
@ 2007-01-06 17:59   ` Simon Josefsson
  2007-01-06 20:11     ` Reiner Steib
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2007-01-06 17:59 UTC (permalink / raw)
  Cc: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> The version in contrib/ is synced from Emacs CVS:
>
> ,----[ contrib/README ]
> | sendmail.el
> | smtpmail.el
> | 
> | 	Copies of the corresponding files from the Emacs lisp/mail/
> | 	directory, to provide features (occasionally) needed by Gnus which
> | 	may not be provided by the versions of these files in older Emacs
> | 	distributions.
> `----
>
> IIRC, smtpmail.el is also included with XEmacs.  Simon, is
> `smtpmail.el' (from Emacs CVS) supposed to work with XEmacs without
> modifications?

No.  There are several modifications between XEmacs and Emacs
smtpmail.el, alas.

> If so `smtpmail.el' should probably not use the NOMODIFY argument or
> provide some compatibility code.

XEmacs users should use the smtpmail.el from mail-lib, there should be
no reason to use the Emacs CVS stuff (if there is, a bug report would
be most welcome!).

I installed the patch below, to hopefully clarify this.

2007-01-06  Simon Josefsson  <simon@josefsson.org>

	* README: Mention that smtpmail.el doesn't work on XEmacs.

--- README	15 Feb 2006 14:51:02 +0100	7.7
+++ README	06 Jan 2007 18:57:10 +0100	
@@ -46,7 +46,8 @@
 	Copies of the corresponding files from the Emacs lisp/mail/
 	directory, to provide features (occasionally) needed by Gnus which
 	may not be provided by the versions of these files in older Emacs
-	distributions.
+	distributions.  XEmacs users should NOT use this, since it doesn't
+	work.  See the XEmacs mail-lib module instead.
 
 ssl.el
 



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-06 17:59   ` Simon Josefsson
@ 2007-01-06 20:11     ` Reiner Steib
  2007-01-07 10:12       ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-01-06 20:11 UTC (permalink / raw)
  Cc: David Z Maze

On Sat, Jan 06 2007, Simon Josefsson wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> IIRC, smtpmail.el is also included with XEmacs.  Simon, is
>> `smtpmail.el' (from Emacs CVS) supposed to work with XEmacs without
>> modifications?
>
> No.  There are several modifications between XEmacs and Emacs
> smtpmail.el, alas.
>
>> If so `smtpmail.el' should probably not use the NOMODIFY argument or
>> provide some compatibility code.
>
> XEmacs users should use the smtpmail.el from mail-lib, there should be
> no reason to use the Emacs CVS stuff (if there is, a bug report would
> be most welcome!).

What do you suggest for contrib/smtpmail.el?  As `contrib/smtpmail.el'
should only be used with Emacs 21, we probably can simply remove the
NOMODIFY argument (and add a comment to explain it).

Suggestion (similar for the second location):

--8<---------------cut here---------------start------------->8---
--- smtpmail.el	04 Dec 2006 23:32:00 +0100	7.5
+++ smtpmail.el	06 Jan 2007 20:58:24 +0100	
@@ -248,7 +248,11 @@
 	  ;; buffer, otherwise any write-region invocations (e.g., in
 	  ;; mail-do-fcc below) will annoy with asking for a suitable
 	  ;; encoding.
-	  (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+	  ;; (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+	  (set-buffer-file-coding-system smtpmail-code-conv-from nil)
+	  ;; This file (`gnus/contrib/smtpmail.el') is only useful for Emacs
+	  ;; which doesn't support the thried argument (NOMODIFY) of
+	  ;; `set-buffer-file-coding-system'.
 	  (insert-buffer-substring mailbuf)
 	  (goto-char (point-max))
 	  ;; require one newline at the end.
--8<---------------cut here---------------end--------------->8---

BTW: Is NOMODIFY really useful here?  In both cases,
`set-buffer-file-coding-system' is followed by
`insert-buffer-substring' which will mark the buffer modified anyhow.
What am I missing?

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



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-06 20:11     ` Reiner Steib
@ 2007-01-07 10:12       ` Simon Josefsson
  2007-01-07 12:07         ` Reiner Steib
  2007-01-07 12:09         ` Reiner Steib
  0 siblings, 2 replies; 13+ messages in thread
From: Simon Josefsson @ 2007-01-07 10:12 UTC (permalink / raw)
  Cc: David Z Maze

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> What do you suggest for contrib/smtpmail.el?  As `contrib/smtpmail.el'
> should only be used with Emacs 21, we probably can simply remove the
> NOMODIFY argument (and add a comment to explain it).
>
> Suggestion (similar for the second location):
>
> --- smtpmail.el	04 Dec 2006 23:32:00 +0100	7.5
> +++ smtpmail.el	06 Jan 2007 20:58:24 +0100	
> @@ -248,7 +248,11 @@
>  	  ;; buffer, otherwise any write-region invocations (e.g., in
>  	  ;; mail-do-fcc below) will annoy with asking for a suitable
>  	  ;; encoding.
> -	  (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
> +	  ;; (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
> +	  (set-buffer-file-coding-system smtpmail-code-conv-from nil)
> +	  ;; This file (`gnus/contrib/smtpmail.el') is only useful for Emacs
> +	  ;; which doesn't support the thried argument (NOMODIFY) of
> +	  ;; `set-buffer-file-coding-system'.
>  	  (insert-buffer-substring mailbuf)
>  	  (goto-char (point-max))
>  	  ;; require one newline at the end.

If there is sufficient interest to maintain yet another smtpmail.el,
different from both Emacs CVS and XEmacs mail-lib, sure.  Another
approach would be to stop synchronizing smtpmail.el, and use the copy
that worked fine before the changes in CVS.

> BTW: Is NOMODIFY really useful here?  In both cases,
> `set-buffer-file-coding-system' is followed by
> `insert-buffer-substring' which will mark the buffer modified anyhow.
> What am I missing?

Hm, I agree that it looks funny.  Maybe you could ask whomever applied
this, if it is really needed?  I agree that it doesn't seem very
useful, and the modified-flag seems rather pointless for temporary
buffers anyway.

/Simon



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-07 10:12       ` Simon Josefsson
@ 2007-01-07 12:07         ` Reiner Steib
  2007-01-08  8:54           ` Simon Josefsson
  2007-01-07 12:09         ` Reiner Steib
  1 sibling, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-01-07 12:07 UTC (permalink / raw)
  Cc: David Z Maze

On Sun, Jan 07 2007, Simon Josefsson wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>> What do you suggest for contrib/smtpmail.el?  As `contrib/smtpmail.el'
>> should only be used with Emacs 21, we probably can simply remove the
>> NOMODIFY argument (and add a comment to explain it).
[...]
> If there is sufficient interest to maintain yet another smtpmail.el,
> different from both Emacs CVS and XEmacs mail-lib, sure.  

It would be better to avoid it, of course.

> Another approach would be to stop synchronizing smtpmail.el, and use
> the copy that worked fine before the changes in CVS.

I think Miles' syncing could cope with this, i.e. exclude this
difference when syncing (similar to exclude version numbers and
similar when syncing Emacs-CVS <-> v5-10).  But it would be better if
we'd have the same file.

> Maybe you could ask whomever applied this, if it is really needed?
> I agree that it doesn't seem very useful, and the modified-flag
> seems rather pointless for temporary buffers anyway.

It was installed by Eli.  I'll include him in a separate mail.

Bye, Reiner.

P.S.: Anyhow, I think your change to contrib/README WRT XEmacs
      mail-lib should be installed (in v5-10 and the trunk).
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-07 10:12       ` Simon Josefsson
  2007-01-07 12:07         ` Reiner Steib
@ 2007-01-07 12:09         ` Reiner Steib
  2007-03-24 12:30           ` Reiner Steib
  1 sibling, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-01-07 12:09 UTC (permalink / raw)
  Cc: ding, David Z Maze

On Sun, Jan 07 2007, Simon Josefsson wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> BTW: Is NOMODIFY really useful here?  In both cases,
>> `set-buffer-file-coding-system' is followed by
>> `insert-buffer-substring' which will mark the buffer modified anyhow.
>> What am I missing?
>
> Hm, I agree that it looks funny.  Maybe you could ask whomever applied
> this, if it is really needed?  I agree that it doesn't seem very
> useful, and the modified-flag seems rather pointless for temporary
> buffers anyway.

Eli, we wonder if the NOMODIFY argument to
`set-buffer-file-coding-system' in your 2006-11-24 change of
`smtpmail.el' (see below) is useful.  NOMODIFY breaks compatibility
with Emacs 21.  Although it's not a goal for `smtpmail.el' in Emacs
CVS to be compatible with Emacs 21, it would be "nice-to-have" because
`smtpmail.el' provides very useful features for Gnus user on Emacs 21
(SMTP-AUTH, STARTTLS, ...).  This was the reason why we include a copy
of `smtpmail.el' from Emacs in Gnus' contrib directory.

(See
http://thread.gmane.org/gmane.emacs.gnus.general/64222/focus=64233 for
the rest of this thread.)

,----
| 2006-11-24  Eli Zaretskii  <eliz@gnu.org>
| 
| 	* mail/smtpmail.el (smtpmail-send-it):
| 	Copy buffer-file-coding-system from the mail buffer.  Possibly add a
| 	MIME header for the message encoding.
| 	Bind coding-system-for-write around the call to mail-do-fcc.
| 	Use smtpmail-code-conv-from to encode queued mail messages.
`----

--8<---------------cut here---------------start------------->8---
--- smtpmail.el	18 Oct 2006 11:11:32 -0000	1.88
+++ smtpmail.el	24 Nov 2006 14:32:19 -0000	1.89
@@ -244,6 +244,11 @@
 	(save-excursion
 	  (set-buffer tembuf)
 	  (erase-buffer)
+	  ;; Use the same buffer-file-coding-system as in the mail
+	  ;; buffer, otherwise any write-region invocations (e.g., in
+	  ;; mail-do-fcc below) will annoy with asking for a suitable
+	  ;; encoding.
+	  (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
 	  (insert-buffer-substring mailbuf)
 	  (goto-char (point-max))
 	  ;; require one newline at the end.

[...]
@@ -370,6 +394,7 @@
 		(make-directory smtpmail-queue-dir t))
 	      (with-current-buffer buffer-data
 		(erase-buffer)
+		(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
 		(insert-buffer-substring tembuf)
 		(write-file file-data)
 		(set-buffer buffer-elisp)
--8<---------------cut here---------------end--------------->8---

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



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-07 12:07         ` Reiner Steib
@ 2007-01-08  8:54           ` Simon Josefsson
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Josefsson @ 2007-01-08  8:54 UTC (permalink / raw)
  Cc: David Z Maze

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> P.S.: Anyhow, I think your change to contrib/README WRT XEmacs
>       mail-lib should be installed (in v5-10 and the trunk).

Installed.

/Simon



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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-01-07 12:09         ` Reiner Steib
@ 2007-03-24 12:30           ` Reiner Steib
  2007-03-24 17:07             ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-03-24 12:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: David Z Maze, ding, emacs-devel

Eli,

could comment on this (your 2006-11-24 change to smtpmail.el), please?

Bye, Reiner.


Original message follows...

On Sun, Jan 07 2007, Reiner Steib wrote:

> On Sun, Jan 07 2007, Simon Josefsson wrote:
>
>> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>>> BTW: Is NOMODIFY really useful here?  In both cases,
>>> `set-buffer-file-coding-system' is followed by
>>> `insert-buffer-substring' which will mark the buffer modified anyhow.
>>> What am I missing?
>>
>> Hm, I agree that it looks funny.  Maybe you could ask whomever applied
>> this, if it is really needed?  I agree that it doesn't seem very
>> useful, and the modified-flag seems rather pointless for temporary
>> buffers anyway.
>
> Eli, we wonder if the NOMODIFY argument to
> `set-buffer-file-coding-system' in your 2006-11-24 change of
> `smtpmail.el' (see below) is useful.  NOMODIFY breaks compatibility
> with Emacs 21.  Although it's not a goal for `smtpmail.el' in Emacs
> CVS to be compatible with Emacs 21, it would be "nice-to-have" because
> `smtpmail.el' provides very useful features for Gnus user on Emacs 21
> (SMTP-AUTH, STARTTLS, ...).  This was the reason why we include a copy
> of `smtpmail.el' from Emacs in Gnus' contrib directory.
>
> (See
> http://thread.gmane.org/gmane.emacs.gnus.general/64222/focus=64233 for
> the rest of this thread.)
>
> ,----
> | 2006-11-24  Eli Zaretskii  <eliz@gnu.org>
> | 
> | 	* mail/smtpmail.el (smtpmail-send-it):
> | 	Copy buffer-file-coding-system from the mail buffer.  Possibly add a
> | 	MIME header for the message encoding.
> | 	Bind coding-system-for-write around the call to mail-do-fcc.
> | 	Use smtpmail-code-conv-from to encode queued mail messages.
> `----
>
> --- smtpmail.el	18 Oct 2006 11:11:32 -0000	1.88
> +++ smtpmail.el	24 Nov 2006 14:32:19 -0000	1.89
> @@ -244,6 +244,11 @@
>  	(save-excursion
>  	  (set-buffer tembuf)
>  	  (erase-buffer)
> +	  ;; Use the same buffer-file-coding-system as in the mail
> +	  ;; buffer, otherwise any write-region invocations (e.g., in
> +	  ;; mail-do-fcc below) will annoy with asking for a suitable
> +	  ;; encoding.
> +	  (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
>  	  (insert-buffer-substring mailbuf)
>  	  (goto-char (point-max))
>  	  ;; require one newline at the end.
>
> [...]
> @@ -370,6 +394,7 @@
>  		(make-directory smtpmail-queue-dir t))
>  	      (with-current-buffer buffer-data
>  		(erase-buffer)
> +		(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
>  		(insert-buffer-substring tembuf)
>  		(write-file file-data)
>  		(set-buffer buffer-elisp)

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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-03-24 12:30           ` Reiner Steib
@ 2007-03-24 17:07             ` Eli Zaretskii
  2007-03-24 19:18               ` Reiner Steib
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2007-03-24 17:07 UTC (permalink / raw)
  To: Reiner Steib; +Cc: dmaze, ding, emacs-devel

> From: Reiner Steib <reinersteib+gmane@imap.cc>
> Cc: ding@gnus.org, David Z Maze <dmaze@MIT.EDU>, <emacs-devel@gnu.org>
> Date: Sat, 24 Mar 2007 13:30:56 +0100
> 
> Eli,
> 
> could comment on this (your 2006-11-24 change to smtpmail.el), please?

I don't know why I used the NOMODIFY argument, but the code suggests I
had some reason at the time.  While I agree to removing it, can we
please wait until after the release?  I'd like to avoid unnecessarily
breaking the current code, even though the risk looks all but
nonexistent.

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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-03-24 17:07             ` Eli Zaretskii
@ 2007-03-24 19:18               ` Reiner Steib
  2007-03-25  2:14                 ` Miles Bader
  0 siblings, 1 reply; 13+ messages in thread
From: Reiner Steib @ 2007-03-24 19:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, dmaze, ding, Miles Bader

On Sat, Mar 24 2007, Eli Zaretskii wrote:

> I don't know why I used the NOMODIFY argument, but the code suggests I
> had some reason at the time.  While I agree to removing it, can we
> please wait until after the release?  I'd like to avoid unnecessarily
> breaking the current code, even though the risk looks all but
> nonexistent.

Agreed.

I've installed the change in Gnus (trunk and v5-10) to make
contrib/smtpmail.el work with Emacs 21 again.  Additionally, it now
errors out if used with Emacs 22+ or XEmacs.

Miles, please don't sync these changes to Emacs.  Is it feasible to
sync other future changes from Emacs to Gnus, but keep these [1]
differences in place?

The following entry was missing in contrib/ChangeLog in the trunk:

2007-02-20  Juanma Barranquero  <lekktu@gmail.com>

	* smtpmail.el (smtpmail-smtp-service, smtpmail-queue-index-file):
	Fix typos in docstrings.
	(smtpmail-local-domain, smtpmail-queue-mail): Doc fixes.

In the CVS logs of revision 7.7 and 7.1.2.7, this ChangeLog entry
isn't included.

Bye, Reiner.

[1]
--8<---------------cut here---------------start------------->8---
--- smtpmail.el	20 Feb 2007 00:21:33 -0000	7.1.2.7
+++ smtpmail.el	24 Mar 2007 19:17:04 -0000	7.1.2.9
@@ -68,6 +68,12 @@
 
 ;;; Code:
 
+;; This version of `smtpmail.el' should only be used with Emacs 21.
+(if (featurep 'xemacs)
+    (error "Please use `smtpmail.el' from the mail-lib package.")
+  (when (>= emacs-major-version 22)
+    (error "Please use `smtpmail.el' bundled with Emacs.")))
+
 (require 'sendmail)
 (autoload 'starttls-open-stream "starttls")
 (autoload 'starttls-negotiate "starttls")
@@ -248,7 +254,13 @@
 	  ;; buffer, otherwise any write-region invocations (e.g., in
 	  ;; mail-do-fcc below) will annoy with asking for a suitable
 	  ;; encoding.
-	  (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+	  ;;
+	  ;; This file (`gnus/contrib/smtpmail.el') is only useful for Emacs
+	  ;; which doesn't support the third argument (NOMODIFY) of
+	  ;; `set-buffer-file-coding-system'.
+	  (set-buffer-file-coding-system smtpmail-code-conv-from nil)
+	  (set-buffer-modified-p nil)
+	  (force-mode-line-update)
 	  (insert-buffer-substring mailbuf)
 	  (goto-char (point-max))
 	  ;; require one newline at the end.
@@ -394,7 +406,7 @@
 		(make-directory smtpmail-queue-dir t))
 	      (with-current-buffer buffer-data
 		(erase-buffer)
-		(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+		(set-buffer-file-coding-system smtpmail-code-conv-from nil)
 		(insert-buffer-substring tembuf)
 		(write-file file-data)
 		(set-buffer buffer-elisp)
--8<---------------cut here---------------end--------------->8---
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-03-24 19:18               ` Reiner Steib
@ 2007-03-25  2:14                 ` Miles Bader
  2007-03-31 21:18                   ` Reiner Steib
  0 siblings, 1 reply; 13+ messages in thread
From: Miles Bader @ 2007-03-25  2:14 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii, dmaze, ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:
> Miles, please don't sync these changes to Emacs.  Is it feasible to
> sync other future changes from Emacs to Gnus, but keep these [1]
> differences in place?

Of course.

If _no_ (future) changes to smtpmail.el should be copied between Emacs
and Gnus, then I could just change the arch-tag: in contrib/smtpmail.el,
which will effectively make them different files.

[Syncing applies _changes_ to files (using patches), so it's quite
possible to drop one change but still apply future changes.]

-Miles
-- 
97% of everything is grunge

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

* Re: smtpmail.el: set-buffer-file-coding-system takes too many args
  2007-03-25  2:14                 ` Miles Bader
@ 2007-03-31 21:18                   ` Reiner Steib
  0 siblings, 0 replies; 13+ messages in thread
From: Reiner Steib @ 2007-03-31 21:18 UTC (permalink / raw)
  To: Miles Bader; +Cc: ding, emacs-devel

On Sun, Mar 25 2007, Miles Bader wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> Miles, please don't sync these changes to Emacs.  Is it feasible to
>> sync other future changes from Emacs to Gnus, but keep these [1]
>> differences in place?
>
> Of course.
>
> If _no_ (future) changes to smtpmail.el should be copied between Emacs
> and Gnus, then I could just change the arch-tag: in contrib/smtpmail.el,
> which will effectively make them different files.
>
> [Syncing applies _changes_ to files (using patches), so it's quite
> possible to drop one change but still apply future changes.]

Good.  So let's try to continue syncing the `smtpmail.el'.

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

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

end of thread, other threads:[~2007-03-31 21:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-03 15:30 smtpmail.el: set-buffer-file-coding-system takes too many args David Z Maze
2007-01-06 14:50 ` Reiner Steib
2007-01-06 17:59   ` Simon Josefsson
2007-01-06 20:11     ` Reiner Steib
2007-01-07 10:12       ` Simon Josefsson
2007-01-07 12:07         ` Reiner Steib
2007-01-08  8:54           ` Simon Josefsson
2007-01-07 12:09         ` Reiner Steib
2007-03-24 12:30           ` Reiner Steib
2007-03-24 17:07             ` Eli Zaretskii
2007-03-24 19:18               ` Reiner Steib
2007-03-25  2:14                 ` Miles Bader
2007-03-31 21:18                   ` Reiner Steib

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