Gnus development mailing list
 help / color / mirror / Atom feed
* mm view PDF MIME part doesn't work, just exits
@ 2009-08-27 13:15 Ted Zlatanov
  2009-08-29 17:46 ` Mike Kupfer
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2009-08-27 13:15 UTC (permalink / raw)
  To: Ding Mailing List

This used to work but now doesn't:

on an application/pdf attachment, I hit `e'

I see "Displaying xpdf /tmp/emm.../file.pdf...done" and that's it.  xpdf
doesn't come up as it should.

I customized the mailcap and mailcap-mime-data to ensure the right thing
is called, but no luck.  What should I do to debug this?

Thanks
Ted



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

* Re: mm view PDF MIME part doesn't work, just exits
  2009-08-27 13:15 mm view PDF MIME part doesn't work, just exits Ted Zlatanov
@ 2009-08-29 17:46 ` Mike Kupfer
  2009-09-14 21:19   ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Kupfer @ 2009-08-29 17:46 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: Ding Mailing List

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

Ted> I see "Displaying xpdf /tmp/emm.../file.pdf...done" and that's it.
Ted> xpdf doesn't come up as it should.

Ted> I customized the mailcap and mailcap-mime-data to ensure the right
Ted> thing is called, but no luck.  What should I do to debug this?

The first thing I'd try is saving the attachment to a file, and then
starting xpdf from a shell to view it.

If that works, I'd create a wrapper script and use it instead of the
system xpdf.  For example, something like

  echo $* > $HOME/xpdf.args
  /usr/bin/xpdf $*

could verify that the command-line arguments are correct.

I recall seeing a thread not too long ago about problems that happen if
a viewer daemonizes itself.  The parent (Emacs in this case) thinks that
the viewer has finished, so it deletes the temp file, before the viewer
has actually read in the temp file.  I'd be surprised if xpdf were doing
that, but I suppose it's something you could check.

cheers,
mike



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

* Re: mm view PDF MIME part doesn't work, just exits
  2009-08-29 17:46 ` Mike Kupfer
@ 2009-09-14 21:19   ` Ted Zlatanov
  2009-09-15 11:58     ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2009-09-14 21:19 UTC (permalink / raw)
  To: ding; +Cc: Stefan Monnier, Reiner Steib, Katsumi Yamaoka

On Sat, 29 Aug 2009 10:46:18 -0700 Mike Kupfer <m.kupfer@acm.org> wrote: 

>>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:
Ted> I see "Displaying xpdf /tmp/emm.../file.pdf...done" and that's it.
Ted> xpdf doesn't come up as it should.

Ted> I customized the mailcap and mailcap-mime-data to ensure the right
Ted> thing is called, but no luck.  What should I do to debug this?

MK> The first thing I'd try is saving the attachment to a file, and then
MK> starting xpdf from a shell to view it.

That's what I've been using as a workaround.  The file is OK.

MK> If that works, I'd create a wrapper script and use it instead of the
MK> system xpdf.  For example, something like

MK>   echo $* > $HOME/xpdf.args
MK>   /usr/bin/xpdf $*

MK> could verify that the command-line arguments are correct.

That does not work.

MK> I recall seeing a thread not too long ago about problems that happen if
MK> a viewer daemonizes itself.  The parent (Emacs in this case) thinks that
MK> the viewer has finished, so it deletes the temp file, before the viewer
MK> has actually read in the temp file.  I'd be surprised if xpdf were doing
MK> that, but I suppose it's something you could check.

I debugged this down to mm-decode.el:mm-display-external which is a
pretty complicated process invoker.  The process sentinel gets process
status 'exit as soon as the process starts, and the `state' variable
says:

Displaying xpdf /tmp/emm.32715eef/KR090831.pdf...done (exited abnormally with code 1
)

(I changed the notification message to also display the state).

From the command line, all this works, e.g.:

zsh -c 'xpdf /tmp/emm.32715eef/KR090831.pdf'

which xpdf => /usr/bin/xpdf

Changing to explicitly launch /usr/bin/xpdf didn't make a difference, as
expected (/usr/bin is in PATH no matter what).

I'm really puzzled at this point.  I've CC-ed the people who have
touched mm-decode.el recently, hoping they can enlighten me.  FWIW this
used to work and I'm sure I haven't changed any settings that may have
changed its behavior.  This affects both RET and `e' on an external MIME
part so I'm surprised no one else has noticed it.

Ted




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

* Re: mm view PDF MIME part doesn't work, just exits
  2009-09-14 21:19   ` Ted Zlatanov
@ 2009-09-15 11:58     ` Katsumi Yamaoka
  2009-09-15 12:27       ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2009-09-15 11:58 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding, Stefan Monnier, Reiner Steib

>>>>> Ted Zlatanov wrote:
> I debugged this down to mm-decode.el:mm-display-external which is a
> pretty complicated process invoker.  The process sentinel gets process
> status 'exit as soon as the process starts, and the `state' variable
> says:

> Displaying xpdf /tmp/emm.32715eef/KR090831.pdf...done (exited abnormally with code 1
> )

`mm-display-external' deletes a temp file 2 seconds after starting
an external command.  The number of seconds is hard-coded, and may
be too short.  How does it work if increasing the value?  That is
in the 918th line.



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

* Re: mm view PDF MIME part doesn't work, just exits
  2009-09-15 11:58     ` Katsumi Yamaoka
@ 2009-09-15 12:27       ` Ted Zlatanov
  2009-09-15 23:57         ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2009-09-15 12:27 UTC (permalink / raw)
  To: ding

On Tue, 15 Sep 2009 20:58:36 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote: 

>>>>>> Ted Zlatanov wrote:
>> I debugged this down to mm-decode.el:mm-display-external which is a
>> pretty complicated process invoker.  The process sentinel gets process
>> status 'exit as soon as the process starts, and the `state' variable
>> says:

>> Displaying xpdf /tmp/emm.32715eef/KR090831.pdf...done (exited abnormally with code 1
>> )

KY> `mm-display-external' deletes a temp file 2 seconds after starting
KY> an external command.  The number of seconds is hard-coded, and may
KY> be too short.  How does it work if increasing the value?  That is
KY> in the 918th line.

I tried 2000 seconds, no difference.  I also changed the process call to:

		    (start-process "*display*"
				   (setq buffer
					 (generate-new-buffer " *mm*"))
				   shell-file-name
				   shell-command-switch "/usr/bin/xpdf /home/tzz/work/gdb-refcard.pdf")

which definitely works from the command line.  It still failed the same
way, "exited abnormally with code 1".  Maybe zsh is doing something
strange, but this was working fine until about a month ago so I'm not
sure what's causing it to fail.  Am I the only one seeing this problem?

Ted




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

* Re: mm view PDF MIME part doesn't work, just exits
  2009-09-15 12:27       ` Ted Zlatanov
@ 2009-09-15 23:57         ` Katsumi Yamaoka
  2009-09-16 16:05           ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2009-09-15 23:57 UTC (permalink / raw)
  To: ding

>>>>> Ted Zlatanov wrote:
> (start-process "*display*"
> 	       (setq buffer
> 		     (generate-new-buffer " *mm*"))
> 	       shell-file-name
> 	       shell-command-switch
> 	       "/usr/bin/xpdf /home/tzz/work/gdb-refcard.pdf")

> which definitely works from the command line.  It still failed the same
> way, "exited abnormally with code 1".  Maybe zsh is doing something
> strange, but this was working fine until about a month ago so I'm not
> sure what's causing it to fail.  Am I the only one seeing this problem?

Hm.  No problem here.

uname -a
Linux pastis 2.6.30.5-43.fc11.i686.PAE #1 SMP Thu Aug 27 21:34:36 EDT 2009 i686 i686 i386 GNU/Linux

zsh --version
zsh 4.3.9 (i386-redhat-linux-gnu)

xpdf -v
xpdf version 3.02



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

* Re: mm view PDF MIME part doesn't work, just exits
  2009-09-15 23:57         ` Katsumi Yamaoka
@ 2009-09-16 16:05           ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2009-09-16 16:05 UTC (permalink / raw)
  To: ding

On Wed, 16 Sep 2009 08:57:38 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote: 

>>>>>> Ted Zlatanov wrote:
>> (start-process "*display*"
>> (setq buffer
>> (generate-new-buffer " *mm*"))
>> shell-file-name
>> shell-command-switch
>> "/usr/bin/xpdf /home/tzz/work/gdb-refcard.pdf")

>> which definitely works from the command line.  It still failed the same
>> way, "exited abnormally with code 1".  Maybe zsh is doing something
>> strange, but this was working fine until about a month ago so I'm not
>> sure what's causing it to fail.  Am I the only one seeing this problem?

KY> Hm.  No problem here.

KY> uname -a
KY> Linux pastis 2.6.30.5-43.fc11.i686.PAE #1 SMP Thu Aug 27 21:34:36 EDT 2009 i686 i686 i386 GNU/Linux

KY> zsh --version
KY> zsh 4.3.9 (i386-redhat-linux-gnu)

KY> xpdf -v
KY> xpdf version 3.02

Turns out a customization for MacOS X (disabling DISPLAY so w3m won't
block) was leaking into my Linux setup.

This was hard to debug because mm-display-external doesn't show much
information about the process status.  To debug I used the patch below,
but the function should really capture STDOUT and STDERR of the process.
Is that possible?

Thanks
Ted

Index: mm-decode.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-decode.el,v
retrieving revision 7.70
diff -c -r7.70 mm-decode.el
*** mm-decode.el	23 Jun 2009 22:39:00 -0000	7.70
--- mm-decode.el	16 Sep 2009 16:03:34 -0000
***************
*** 930,936 ****
  				 (timer-set-function timer fn)
  			       (funcall fn))
  			     (ignore-errors (eval fm))
! 			     (message "%s" done)))))))
  		(mm-handle-set-external-undisplayer
  		 handle (cons file buffer)))
  	      (message "Displaying %s..." command))
--- 930,936 ----
  				 (timer-set-function timer fn)
  			       (funcall fn))
  			     (ignore-errors (eval fm))
! 			     (message "%s (%s)" done state)))))))
  		(mm-handle-set-external-undisplayer
  		 handle (cons file buffer)))
  	      (message "Displaying %s..." command))




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

end of thread, other threads:[~2009-09-16 16:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-27 13:15 mm view PDF MIME part doesn't work, just exits Ted Zlatanov
2009-08-29 17:46 ` Mike Kupfer
2009-09-14 21:19   ` Ted Zlatanov
2009-09-15 11:58     ` Katsumi Yamaoka
2009-09-15 12:27       ` Ted Zlatanov
2009-09-15 23:57         ` Katsumi Yamaoka
2009-09-16 16:05           ` Ted Zlatanov

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