[mew-dist 29547] Re: Q: attach file by drag&drop

moto kawasaki <[email protected]> Sun, 30 Dec 2012 20:20:20 +0900 (JST)
Newsgroups gmane.mail.mew.general.japanese
Message-ID <[email protected]>


 ~/.mew.el 



-- 
moto kawasaki <[email protected]>

From: Hideyuki SHIRAI () <[email protected]>
To: [email protected]
Subject: [mew-dist 29546] Re: Q: attach file by drag&drop
Date:Sun, 30 Dec 2012 16:38:03 +0900 (JST)
Message-ID: <[email protected]>

shirai>  MBA 
shirai> 
shirai> From: moto kawasaki <[email protected]> 
shirai> Subject: [mew-dist 29545] Q: attach file by drag&drop
shirai> Message-ID: <[email protected]>
shirai> Date: Sun, 30 Dec 2012 11:33:12 +0900 (JST)
shirai> 
shirai> > OS/Emacs/Mew 
shirai> > 
shirai> > 
shirai> >     Mew 
shirai> >     
shirai> > 
shirai> > 
shirai> > 
shirai> >  C-c C-a 
shirai> > 
shirai> > 
shirai> > 
shirai> >     OS:     Mac OS X 10.7.5 (Darwin 11.4.2 x86_64)
shirai> >     Emacs:  GNU Emacs 24.2.50.2 (x86_64-apple-darwin11.4.2, NS
shirai> >             apple-appkit-1138.51) of 2012-10-13
shirai> >     Mew:    Mew version 6.5
shirai> 
shirai> OSX  drag & drop  ns-drag-file  key  ns-find-file
shirai> OSX 
shirai> 
shirai> 
shirai> (add-hook
shirai>  'mew-draft-mode-hook
shirai>  (lambda ()
shirai>    (define-key mew-draft-body-map [ns-drag-file] 'mew-draft-ns-attach-file)
shirai>    (define-key mew-draft-header-map [ns-drag-file] 'mew-draft-ns-attach-file)
shirai>    (define-key mew-draft-attach-map [ns-drag-file] 'mew-draft-ns-attach-file)))
shirai> 
shirai> (defun mew-draft-ns-attach-file ()
shirai>   "File attach with the `ns-input-file' as argument."
shirai>   (interactive)
shirai>   (let* ((from (file-truename
shirai> 		(expand-file-name (pop ns-input-file)
shirai> 				  command-line-default-directory)))
shirai> 	 (to (file-name-nondirectory from)))
shirai>     (when from
shirai>       (unless (mew-attach-p)
shirai> 	(mew-draft-prepare-attachments))
shirai>       (goto-char (point-max))
shirai>       (forward-line -2)
shirai>       (mew-attach-next)
shirai>       (cond
shirai>        ((file-directory-p from)
shirai> 	(message "Directory cannot be attached"))
shirai>        (t
shirai> 	(mew-attach-copy from to))))))
shirai> 
shirai> ()
shirai> 
shirai> -- 
shirai>  (mailto:[email protected])