From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [ihs_4664@yahoo.com: drag-n-drop can't be customized by the target buffer] Date: Sat, 28 Aug 2004 12:48:17 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1093711751 25126 80.91.224.253 (28 Aug 2004 16:49:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 Aug 2004 16:49:11 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 28 18:49:04 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C16Nz-0008DR-00 for ; Sat, 28 Aug 2004 18:49:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C16Si-0001Fb-T3 for ged-emacs-devel@m.gmane.org; Sat, 28 Aug 2004 12:53:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C16SJ-000179-Nf for emacs-devel@gnu.org; Sat, 28 Aug 2004 12:53:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C16SI-00016R-CM for emacs-devel@gnu.org; Sat, 28 Aug 2004 12:53:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C16SI-00016H-8A for emacs-devel@gnu.org; Sat, 28 Aug 2004 12:53:30 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C16NF-0007pZ-Gx for emacs-devel@gnu.org; Sat, 28 Aug 2004 12:48:17 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1C16NF-0000dx-6Y; Sat, 28 Aug 2004 12:48:17 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26594 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26594 Would the people who work on drag-n-drop please think about this idea? ------- Start of forwarded message ------- To: gnu-emacs-bug@moderators.isc.org From: Kevin Rodgers Newsgroups: gnu.emacs.bug Date: Fri, 27 Aug 2004 11:56:49 -0600 X-Orig-X-Trace: news.uni-berlin.de Nh+o2aku0MLBGtYAyGjzpwgNH8hH4wBq+aJybFTCUbIftZpW4= X-Accept-Language: en-us Cc: Subject: drag-n-drop can't be customized by the target buffer Sender: bug-gnu-emacs-bounces+rms=gnu.org@gnu.org X-Spam-Status: No, hits=2.4 required=5.0 tests=EMAIL_ATTRIBUTION,FORGED_YAHOO_RCVD,FROM_ENDS_IN_NUMS, QUOTED_EMAIL_TEXT,RCVD_IN_ORBS,USER_AGENT_MOZILLA_UA, X_ACCEPT_LANG version=2.55 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) This is a multi-part message in MIME format. - --------------040309070504020707020408 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit It would be better if each of the term/foo-win.el files had something like: (defvar drag-n-drop-function 'find-file) (defun foo-drag-n-drop (event) ... (mapc drag-n-drop-function (car (cdr (cdr event)))) ... ) so that vm-mail-mode etc. could say: (set (make-local-variable 'drag-n-drop-function) (lambda (file) (vm-mime-attach-file file (or (vm-mime-default-type-from-filename file) "application/octet-stream")))) instead of hacking foo-drag-n-drop as below. Thanks, - -- Kevin Rodgers - --------------040309070504020707020408 Content-Type: message/rfc822; name="Re: Drag-and-drop to attach file in vm mail composition buffer" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Re: Drag-and-drop to attach file in vm mail composition buffer" Path: uni-berlin.de!fu-berlin.de!peer01.cox.net!cox.net!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny03.POSTED!9056c659!not-for-mail Newsgroups: gnu.emacs.vm,gnu.emacs.vm.info Subject: Re: Drag-and-drop to attach file in vm mail composition buffer References: From: kosowsky@consult.pretender (Jeffrey J. Kosowsky) Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 26 Aug 2004 18:03:50 GMT NNTP-Posting-Host: 141.154.253.43 X-Complaints-To: abuse@verizon.net X-Trace: trndny03 1093543430 141.154.253.43 (Thu, 26 Aug 2004 14:03:50 EDT) NNTP-Posting-Date: Thu, 26 Aug 2004 14:03:50 EDT Xref: uni-berlin.de gnu.emacs.vm.info:17200 kosowsky@consult.pretender (Jeffrey J. Kosowsky) writes: > Using gnuserv, I can use drag-and-drop to open a file in emacs. > > I would like to modify the behavior when the buffer that is exposed is > a mail composition buffer so that the dragged file is attached to the > mail composition buffer rather than opening the file in a new buffer. > > Notionally, instead of doing something like '(find-file file)', I > would do something like '(vm-mime-attach-file file)'. > > However, despite reading gnuserv.el, I can't figure out how and where > to patch this in. > > Any thoughts on how to do this? > OK, I figured it out. Win32 drag-n-drop doesen't use gnuserv/gnuclientw. The relevant functions are documented in term/w32-win.el. I was able to get the desired affect by making some slight modifications to the function: (defun w32-drag-n-drop (event) "Edit the files listed in the drag-n-drop EVENT. Switch to a buffer editing the last file dropped. JJK: Added logic so that adds mime attachments if dragged over a buffer in \"Mail\" mode" (interactive "e") (save-excursion ;; Make sure the drop target has positive co-ords ;; before setting the selected frame - otherwise it ;; won't work. (let* ((window (posn-window (event-start event))) (coords (posn-x-y (event-start event))) (x (car coords)) (y (cdr coords))) (if (and (> x 0) (> y 0)) (set-frame-selected-window nil window)) ; JJK addition start (if (string= mode-name "Mail") (mapcar (lambda (file) (vm-mime-attach-file file "application/octet-stream")) (car (cdr (cdr event)))) (mapcar 'find-file (car (cdr (cdr event)))))) ; JJK addition end ; (mapcar 'find-file (car (cdr (cdr event))))) (raise-frame))) - --------------040309070504020707020408 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs - --------------040309070504020707020408-- ------- End of forwarded message -------