Gnus development mailing list
 help / color / mirror / Atom feed
* start'ing attachments under Windows
@ 2000-01-06 16:54 John S Cooper
  2000-04-21 14:05 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: John S Cooper @ 2000-01-06 16:54 UTC (permalink / raw)


In the Windows world, it can be useful to have attachments launched via the
`start' command, e.g., in my .mailcap file:

application/msword; start %s
application/msexcel; start %s
application/vnd.ms-excel; start %s
application/octet-stream; start %s

However, the start command doesn't seem to grok files that contain spaces (I
tried various quoting), and unfortunately many Windows-originating attachments
I receive are given names containing spaces.

To address this I've made the appended modification to mm-decode.el which will
replace spaces with underscores in the filenames associated with attachments
(both for temporary files and attachments explicity saved by typing `o' on the
MIME button).

Could this be added to the distribution?  (mm-filename-space-char would need to
be a `defvar', and probably renamed, for real use.)

In my .emacs:
  (setq mm-filename-space-char ?-)

    --- John

$ diff -c mm-decode.el.sav mm-decode.el
*** mm-decode.el.sav	Fri Dec 17 13:12:06 1999
--- mm-decode.el	Fri Dec 17 13:15:07 1999
***************
*** 355,362 ****
  	(make-directory dir)
  	(set-file-modes dir 448)
  	(if filename
! 	    (setq file (expand-file-name (file-name-nondirectory filename)
! 					 dir))
  	  (setq file (make-temp-name (expand-file-name "mm." dir))))
  	(let ((coding-system-for-write mm-binary-coding-system))
  	  (write-region (point-min) (point-max) file nil 'nomesg))
--- 355,366 ----
  	(make-directory dir)
  	(set-file-modes dir 448)
  	(if filename
! 	    (progn
! 	      (and mm-filename-space-char
! 		   (while (string-match " " filename)
! 		     (setq filename (replace-match (char-to-string mm-filename-space-char) nil nil filename))))
! 	      (setq file (expand-file-name (file-name-nondirectory filename)
! 					 dir)))
  	  (setq file (make-temp-name (expand-file-name "mm." dir))))
  	(let ((coding-system-for-write mm-binary-coding-system))
  	  (write-region (point-min) (point-max) file nil 'nomesg))
***************
*** 597,603 ****
  		    (mm-handle-disposition handle) 'filename))
  	 file)
      (when filename
!       (setq filename (file-name-nondirectory filename)))
      (setq file
  	  (read-file-name "Save MIME part to: "
  			  (expand-file-name
--- 601,611 ----
  		    (mm-handle-disposition handle) 'filename))
  	 file)
      (when filename
!       (setq filename (file-name-nondirectory filename))
!       (and mm-filename-space-char
! 	   (while (string-match " " filename)
! 	     (setq filename (replace-match (char-to-string mm-filename-space-char) nil nil filename)))))
! 
      (setq file
  	  (read-file-name "Save MIME part to: "
  			  (expand-file-name
$ 




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

* Re: start'ing attachments under Windows
  2000-01-06 16:54 start'ing attachments under Windows John S Cooper
@ 2000-04-21 14:05 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2000-04-21 14:05 UTC (permalink / raw)


John S Cooper <John.Cooper@citrix.com> writes:

> In the Windows world, it can be useful to have attachments launched via the
> `start' command, e.g., in my .mailcap file:
> 
> application/msword; start %s
> application/msexcel; start %s
> application/vnd.ms-excel; start %s
> application/octet-stream; start %s
> 
> However, the start command doesn't seem to grok files that contain
> spaces (I tried various quoting), and unfortunately many
> Windows-originating attachments I receive are given names containing
> spaces.

If you have a proper shell, shouldn't that fix things?  (At least
that's what I'm told...)

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

end of thread, other threads:[~2000-04-21 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-06 16:54 start'ing attachments under Windows John S Cooper
2000-04-21 14:05 ` Lars Magne Ingebrigtsen

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