Gnus development mailing list
 help / color / mirror / Atom feed
From: John S Cooper <John.Cooper@citrix.com>
Subject: start'ing attachments under Windows
Date: 06 Jan 2000 16:54:57 +0000	[thread overview]
Message-ID: <u902387j2.fsf@KONTIKI.citrix.com> (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
$ 




             reply	other threads:[~2000-01-06 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-06 16:54 John S Cooper [this message]
2000-04-21 14:05 ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u902387j2.fsf@KONTIKI.citrix.com \
    --to=john.cooper@citrix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).