🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #700

Re: Can't launch attachments with "spaces" in file name

#700
From: Jeffrey J. Kosowsky
Date: Wed, 28 Jan 2004 16:05
69 lines
3910 bytes
newsspam5REMOVETHIS@robf.de writes:
> Hmm from the code in `vm-make-tempfile-name' I would guess, that
> it hangs in the while-loop trying to find an unused name ...
> [looking at it] ... IMHO it is a bug indeed, there was a
> miss-placed parenthesis in the second case of the cond, at least
> in VM 7.18.
> 
> Apply the patch below and DONE is set to terminate the loop
> correctly [untested].
> 
> --- .hacking/vm-7.18/vm-misc.el	2003-11-03 16:37:56.000000000 +0100
> +++ .xemacs/xemacs-packages/vm/lisp/vm-misc.el	2004-01-22 16:54:01.000000000 +0100
> @@ -635,8 +646,8 @@
>  					vm-tempfile-counter
>  					proposed-filename)
>  				vm-temp-file-directory))
> -		     vm-tempfile-counter (1+ vm-tempfile-counter))
> -	       done (not (file-exists-p filename)))))
> +		     vm-tempfile-counter (1+ vm-tempfile-counter)
> +                     done (not (file-exists-p filename))))))
>  	  (t
>  	   (let ((done nil))
>  	     (while (not done)


OK -- this last patch solved most of my problems. But I am now
encountering a more subtle problem on just a few of my email
attachments that only affects launching programs in Windoze and not Linux.

Specifically, everything works fine when using oocalc/oowriter
etc. under Linux/Gnome to launch attached M$ documents.

However, when I try to read the very same email message and launch the
same attachments under Windoze, the files are detached to my Windoze
temp directory but the relevant MS Office application fails to launch.
The problem appears to be due to characaters like "&" in the filename
which somehow must not get parsed properly by the windoze launcher.

Note I am using the following code to trigger the launch of the
external applications: 

(add-to-lists 
 'vm-mime-external-content-types-alist
 (cond
  ((equal window-system 'x)
   '(("audio/x-wav" "mplayer -quiet")
	 ("application/msword" "oowriter")
;	 ("application/rtf" "oowriter")
	 ("application/vnd.ms-powerpoint" "ooimpress")
	 ("application/vnd.ms-excel" "oocalc")
	 ("application/msexcel" "oocalc")
	 ("application/pdf" "acroread")))
  ((equal window-system 'w32)
   '(("application" "cmd" "/C" "%f")
	 ("audio" "cmd" "/c" "%f")
	 ("image" "cmd" "/c" "%f")
	 ("video" "cmd" "/c" "%f")))
  ))

[Note: add-to-lists is my own mapcar version of the add-to-list function.]

Do I need to add any extra quoting somehow to make sure that the
filenames are passed properly?
[note again that the files are detached properly to the temp
directory, they just fail to launch the appropriate viewer
application]

Thanks,
Jeff
Technical Details
Message-ID: <m2y8rscb3z.fsf@consult.pretender>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!9056c659!not-for-mail
References: <m2fzekj10g.fsf@consult.pretender> <400320B7.5060408@yahoo.com> <m2k73n2nrb.fsf@consult.pretender> <400D5599.10709@yahoo.com> <m2isj6m7a4.fsf@consult.pretender> <861xpth8a1.fsf@robf.deREMOVETHIS> <m2smi88qsy.fsf@consult.pretender> <86hdyoc6n9.fsf@robf.deREMOVETHIS>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6829,6e83a1235cadfbbe
X-Google-Attributes: gidf6829,public
X-Google-ArrivalTime: 2004-01-28 08:07:01 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!9056c659!not-for-mail
Newsgroups: gnu.emacs.vm.bug
Subject: Re: Can't launch attachments with "spaces" in file name
References: <m2fzekj10g.fsf@consult.pretender> <400320B7.5060408@yahoo.com> <m2k73n2nrb.fsf@consult.pretender> <400D5599.10709@yahoo.com> <m2isj6m7a4.fsf@consult.pretender> <861xpth8a1.fsf@robf.deREMOVETHIS> <m2smi88qsy.fsf@consult.pretender> <86hdyoc6n9.fsf@robf.deREMOVETHIS>
From: kosowsky@consult.pretender (Jeffrey J. Kosowsky)
Message-ID: <m2y8rscb3z.fsf@consult.pretender>
Lines: 69
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Wed, 28 Jan 2004 16:05:20 GMT
NNTP-Posting-Host: 141.154.120.29
X-Complaints-To: abuse@verizon.net
X-Trace: nwrdny01.gnilink.net 1075305920 141.154.120.29 (Wed, 28 Jan 2004 11:05:20 EST)
NNTP-Posting-Date: Wed, 28 Jan 2004 11:05:20 EST