Gnus development mailing list
 help / color / mirror / Atom feed
* attachment problems found but not fixed
@ 2004-02-23 19:14 Wes Hardaker
  2004-02-23 22:34 ` Reiner Steib
  0 siblings, 1 reply; 10+ messages in thread
From: Wes Hardaker @ 2004-02-23 19:14 UTC (permalink / raw)



A while ago I mentioned that trying to send attachments for me was
failing, but no one else seemed to have the problem, so I've tracked
it down a bit further.  When I try to attach a file, I hit c-c c-a,
fill in the dialog boxes using the defaults for everything and get a
#part line which looks ok, but it turns out that this attribute:

  disposition=attachment

is causing mml-read-tag to fail because forward-sexp is failing.
I manually switched this to:

  disposition="attachment"

and everything worked.

So:

1) the sexp list needs work.
2) and/or the default for 'attachment' should be '"attachment"' instead?

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett



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

* Re: attachment problems found but not fixed
  2004-02-23 19:14 attachment problems found but not fixed Wes Hardaker
@ 2004-02-23 22:34 ` Reiner Steib
  2004-02-23 23:25   ` Wes Hardaker
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Reiner Steib @ 2004-02-23 22:34 UTC (permalink / raw)


On Mon, Feb 23 2004, Wes Hardaker wrote:

> When I try to attach a file, I hit c-c c-a, fill in the dialog boxes
> using the defaults for everything and get a #part line which looks
> ok, but it turns out that this attribute:
>
>   disposition=attachment
>
> is causing mml-read-tag to fail because forward-sexp is failing.
> I manually switched this to:
>
>   disposition="attachment"
>
> and everything worked.
>
> So:
>
> 1) the sexp list needs work.
> 2) and/or the default for 'attachment' should be '"attachment"' instead?

Well, I have changed `mml-minibuffer-read-disposition' recently, so it
might be my fault.  But also `mml.el' from Gnus 5.8.8 inserts
»disposition=attachment« without any quotes.  And reading
`mml-insert-tag', it seems that omitting the quotes is intended unless
there are "suspicious characters":

(defun mml-insert-tag (name &rest plist)
  "Insert an MML tag described by NAME and PLIST."
[...]
	;; Quote VALUE if it contains suspicious characters.
	(when (string-match "[\"'\\~/*;() \t\n]" value)
	  (setq value (with-output-to-string
			(let (print-escape-nonascii)
			  (prin1 value)))))
	(insert (format " %s=%s" key value))))) [...]

Does this only happen in XEmacs 21.5?

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




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

* Re: attachment problems found but not fixed
  2004-02-23 22:34 ` Reiner Steib
@ 2004-02-23 23:25   ` Wes Hardaker
  2004-02-23 23:27   ` Katsumi Yamaoka
  2004-02-23 23:31   ` attachment problems found but not fixed Wes Hardaker
  2 siblings, 0 replies; 10+ messages in thread
From: Wes Hardaker @ 2004-02-23 23:25 UTC (permalink / raw)


>>>>> On Mon, 23 Feb 2004 23:34:57 +0100, Reiner Steib <4.uce.03.r.s@nurfuerspam.de> said:

Reiner> Does this only happen in XEmacs 21.5?

Don't know, as it's all I use at the moment.

To me, though, it looks like a sexp problem or at least that was my
best guess.

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett



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

* Re: attachment problems found but not fixed
  2004-02-23 22:34 ` Reiner Steib
  2004-02-23 23:25   ` Wes Hardaker
@ 2004-02-23 23:27   ` Katsumi Yamaoka
  2004-02-24  1:18     ` Katsumi Yamaoka
  2004-02-23 23:31   ` attachment problems found but not fixed Wes Hardaker
  2 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2004-02-23 23:27 UTC (permalink / raw)


>>>>> In <v9u11h2zn2.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib <4.uce.03.r.s@nurfuerspam.de> wrote:

> On Mon, Feb 23 2004, Wes Hardaker wrote:

[...]

>> 1) the sexp list needs work.
>> 2) and/or the default for 'attachment' should be '"attachment"' instead?

> Well, I have changed `mml-minibuffer-read-disposition' recently, so it
> might be my fault.  But also `mml.el' from Gnus 5.8.8 inserts
> »disposition=attachment« without any quotes.  And reading
> `mml-insert-tag', it seems that omitting the quotes is intended unless
> there are "suspicious characters":

[...]

> Does this only happen in XEmacs 21.5?

Yes.  I saw that using forward-sexp in mml-read-tag causes an
infloop only in XEmacs 21.5.  However, it is actually a problem
that forward-sexp doesn't split disposition=attachment in all
Emacsen.  So,

3) forward-sexp should be replaced with re-search.

Here's a quick hack.  Though I haven't widly tested it yet.

(defun mml-read-tag ()
  "Read a tag and return the contents."
  (let ((orig-point (point))
	contents name elem val)
    (forward-char 2)
    (setq name (buffer-substring-no-properties
		(point) (progn (forward-sexp 1) (point))))
    (save-match-data
      (while (and (not (looking-at ">[ \t]*\n?"))
		  (re-search-forward "\\([a-z]+\\)=\"?\\([^\t\n \">]+\\)"
				     nil t))
	(push (cons (intern (match-string-no-properties 1))
		    (match-string-no-properties 2))
	      contents)))
    (goto-char (match-end 0))
    ;; Don't skip the leading space.
    ;;(skip-chars-forward " \t\n")
    ;; Put the tag location into the returned contents
    (setq contents (append (list (cons 'tag-location orig-point)) contents))
    (cons (intern name) (nreverse contents))))
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

* Re: attachment problems found but not fixed
  2004-02-23 22:34 ` Reiner Steib
  2004-02-23 23:25   ` Wes Hardaker
  2004-02-23 23:27   ` Katsumi Yamaoka
@ 2004-02-23 23:31   ` Wes Hardaker
  2 siblings, 0 replies; 10+ messages in thread
From: Wes Hardaker @ 2004-02-23 23:31 UTC (permalink / raw)


>>>>> On Mon, 23 Feb 2004 23:34:57 +0100, Reiner Steib <4.uce.03.r.s@nurfuerspam.de> said:

>> I manually switched this to:
>> 
>> disposition="attachment"
>> 
>> and everything worked.

Actually, it turns out it didn't.  The messages go out with a
zero-length attachment.  It just *looked* like it worked.

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett



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

* Re: attachment problems found but not fixed
  2004-02-23 23:27   ` Katsumi Yamaoka
@ 2004-02-24  1:18     ` Katsumi Yamaoka
  2004-02-24  9:13       ` Katsumi Yamaoka
  2004-02-24 15:16       ` mml-read-tag broken in XEmacs 21.5 (was: attachment problems found but not fixed) Reiner Steib
  0 siblings, 2 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2004-02-24  1:18 UTC (permalink / raw)


>>>>> In <b9y1xolidfo.fsf@jpl.org> Katsumi Yamaoka wrote:

> 3) forward-sexp should be replaced with re-search.

Sorry, please ignore it.  That seems a syntax-table bug in
XEmacs 21.5:

(with-temp-buffer
  (require 'mml)
  (insert "disposition=attachment")
  (goto-char (point-min))
  (with-syntax-table mml-syntax-table
    (forward-sexp 1)
    (buffer-substring (point) (point-max))))
 => ""

The with-syntax-table macro makes a copy of mml-syntax-table
but it doesn't seem to copy modified syntax entries.  So, the
problem can be fixed by using the Emacs version of the
with-syntax-table macro which doesn't use copy-syntax-table.
Should we do so in dgnushack.el?
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

* Re: attachment problems found but not fixed
  2004-02-24  1:18     ` Katsumi Yamaoka
@ 2004-02-24  9:13       ` Katsumi Yamaoka
  2004-02-25  1:21         ` Wes Hardaker
  2004-02-24 15:16       ` mml-read-tag broken in XEmacs 21.5 (was: attachment problems found but not fixed) Reiner Steib
  1 sibling, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2004-02-24  9:13 UTC (permalink / raw)


>>>>> In <b9yfzd1tgvd.fsf@jpl.org> Katsumi Yamaoka wrote:

> [...] That seems a syntax-table bug in XEmacs 21.5:

> (with-temp-buffer
>   (require 'mml)
>   (insert "disposition=attachment")
>   (goto-char (point-min))
>   (with-syntax-table mml-syntax-table
>     (forward-sexp 1)
>     (buffer-substring (point) (point-max))))
>  => ""

> The with-syntax-table macro makes a copy of mml-syntax-table
> but it doesn't seem to copy modified syntax entries.  So, the
> problem can be fixed by using the Emacs version of the
> with-syntax-table macro which doesn't use copy-syntax-table.
> Should we do so in dgnushack.el?

I've done.  Please note, you need to load dgnushack.el when
compiling Gnus Lisp modules with XEmacs 21.5.  The best way is
to type `configure; make install'.  It also means that the Gnus
XEmacs package built with XEmacs 21.4 cannot be used with 21.5.
So, If there is a better way, this should be replaced by it.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

* mml-read-tag broken in XEmacs 21.5 (was: attachment problems found but not fixed)
  2004-02-24  1:18     ` Katsumi Yamaoka
  2004-02-24  9:13       ` Katsumi Yamaoka
@ 2004-02-24 15:16       ` Reiner Steib
  1 sibling, 0 replies; 10+ messages in thread
From: Reiner Steib @ 2004-02-24 15:16 UTC (permalink / raw)
  Cc: XEmacs Beta

[ Cc-ing xemacs-beta ...

`mml-read-tag' as used in Gnus at least since 5.8.8 stopped working in
XEmacs 21.5.

See <URL:http://thread.gmane.org/sdd685fw0w.fsf@wes.hardakers.net> for
the complete thread. ]

On Tue, Feb 24 2004, Katsumi Yamaoka wrote:

>>>>>> In <b9y1xolidfo.fsf@jpl.org> Katsumi Yamaoka wrote:
[...]
> That seems a syntax-table bug in XEmacs 21.5:
>
> (with-temp-buffer
>   (require 'mml)
>   (insert "disposition=attachment")
>   (goto-char (point-min))
>   (with-syntax-table mml-syntax-table
>     (forward-sexp 1)
>     (buffer-substring (point) (point-max))))
>  => ""

In XEmacs 21.4.12, I get "=attachment".

> The with-syntax-table macro makes a copy of mml-syntax-table
> but it doesn't seem to copy modified syntax entries.  So, the
> problem can be fixed by using the Emacs version of the
> with-syntax-table macro which doesn't use copy-syntax-table.
> Should we do so in dgnushack.el?
[...]
> It also means that the Gnus XEmacs package built with XEmacs 21.4
> cannot be used with 21.5.  So, If there is a better way, this should
> be replaced by it.

Shouldn't this be fixed in XEmacs 21.5 instead?  If the change in
XEmacs 21.5 was intended, it might break other lisp packages too.

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



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

* Re: attachment problems found but not fixed
  2004-02-24  9:13       ` Katsumi Yamaoka
@ 2004-02-25  1:21         ` Wes Hardaker
  2004-02-25  1:31           ` Katsumi Yamaoka
  0 siblings, 1 reply; 10+ messages in thread
From: Wes Hardaker @ 2004-02-25  1:21 UTC (permalink / raw)
  Cc: ding

>>>>> On Tue, 24 Feb 2004 18:13:28 +0900, Katsumi Yamaoka <yamaoka@jpl.org> said:

>> The with-syntax-table macro makes a copy of mml-syntax-table
>> but it doesn't seem to copy modified syntax entries.  So, the
>> problem can be fixed by using the Emacs version of the
>> with-syntax-table macro which doesn't use copy-syntax-table.
>> Should we do so in dgnushack.el?

Katsumi> I've done.

Worked for me.  The right solution is probably Reiner said which is to
fix xemacs...

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett



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

* Re: attachment problems found but not fixed
  2004-02-25  1:21         ` Wes Hardaker
@ 2004-02-25  1:31           ` Katsumi Yamaoka
  0 siblings, 0 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2004-02-25  1:31 UTC (permalink / raw)


>>>>> In <sd4qtg6jk1.fsf@wes.hardakers.net>
>>>>>	Wes Hardaker <wes@hardakers.net> wrote:

> Worked for me.  The right solution is probably Reiner said which is to
> fix xemacs...

It is completely right.  I want XEmacs people to improve it
immediately.  And then, I should remove the funny thing in
dgnushack.el.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

end of thread, other threads:[~2004-02-25  1:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-23 19:14 attachment problems found but not fixed Wes Hardaker
2004-02-23 22:34 ` Reiner Steib
2004-02-23 23:25   ` Wes Hardaker
2004-02-23 23:27   ` Katsumi Yamaoka
2004-02-24  1:18     ` Katsumi Yamaoka
2004-02-24  9:13       ` Katsumi Yamaoka
2004-02-25  1:21         ` Wes Hardaker
2004-02-25  1:31           ` Katsumi Yamaoka
2004-02-24 15:16       ` mml-read-tag broken in XEmacs 21.5 (was: attachment problems found but not fixed) Reiner Steib
2004-02-23 23:31   ` attachment problems found but not fixed Wes Hardaker

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