annotate tests/Dnd/droptest.el @ 5885:c8bbb32fe124

Always return a string, #'current-message. lisp/ChangeLog addition: 2015-04-04 Aidan Kehoe <kehoea@parhasard.net> * gutter-items.el (append-progress-feedback): * gutter-items.el (abort-progress-feedback): Correct comments in both these functions, it's the progress stack being adjusted, not the message stack. * simple.el (message-stack): Describe my recent change in the structure of this. * simple.el (current-message): Adjust the implementation of this to always return the string displayed.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 04 Apr 2015 13:49:30 +0100
parents d88ad9ccfa66
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;; a short example how to use the new Drag'n'Drop API in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 ;; combination with extents.
5423
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
3
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
4 ;; Copyright (C) 1998 Oliver Graf <ograf@fga.de>
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
5
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
6 ;; This file is part of XEmacs.
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
7
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
8 ;; XEmacs is free software: you can redistribute it and/or modify it
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
9 ;; under the terms of the GNU General Public License as published by the
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
10 ;; Free Software Foundation, either version 3 of the License, or (at your
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
11 ;; option) any later version.
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
12
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
13 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
14 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
15 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
16 ;; for more details.
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
17
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
18 ;; You should have received a copy of the GNU General Public License
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
19 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
20
d88ad9ccfa66 Migrate the rest of tests/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents: 4790
diff changeset
21 ;;; Synched up with: Not in FSF.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 (defun dnd-drop-message (event object text)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 (message "Dropped %s with :%s" text object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; signal that we have done something with the data
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 (defun do-nothing (event object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;; signal that the data is still unprocessed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 (defun start-drag (event what &optional typ)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 ;; short drag interface, until the real one is implemented
4790
bc4f2511bbea Remove support for the OffiX drag-and-drop protocol. See xemacs-patches
Jerry James <james@xemacs.org>
parents: 428
diff changeset
34 (cond ((featurep 'cde)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 (if (not typ)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 (funcall (intern "cde-start-drag-internal") event nil (list what))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 (funcall (intern "cde-start-drag-internal") event t what)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 (t display-message 'error "no valid drag protocols implemented")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 (defun start-region-drag (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 (interactive "_e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 (if (click-inside-extent-p event zmacs-region-extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 ;; okay, this is a drag
4790
bc4f2511bbea Remove support for the OffiX drag-and-drop protocol. See xemacs-patches
Jerry James <james@xemacs.org>
parents: 428
diff changeset
44 (cond ((featurep 'cde)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 (cde-start-drag-region event
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 (extent-start-position zmacs-region-extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 (extent-end-position zmacs-region-extent)))
4790
bc4f2511bbea Remove support for the OffiX drag-and-drop protocol. See xemacs-patches
Jerry James <james@xemacs.org>
parents: 428
diff changeset
48 (t (error "No CDE support compiled in")))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 (defun make-drop-targets ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 (let ((buf (get-buffer-create "*DND misc-user extent test buffer*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 (s nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 (e nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 (set-buffer buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 (pop-to-buffer buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 (insert "[ DROP TARGET 1]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 (set-extent-property ext
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 'experimental-dragdrop-drop-functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 '((do-nothing t t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (dnd-drop-message t t "on target 1")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 (set-extent-property ext 'mouse-face 'highlight)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 (insert " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 (insert "[ DROP TARGET 2]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (set-extent-property ext
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 'experimental-dragdrop-drop-functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 '((dnd-drop-message t t "on target 2")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 (set-extent-property ext 'mouse-face 'highlight)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 (insert " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 (insert "[ DROP TARGET 3]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 (set-extent-property ext
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 'experimental-dragdrop-drop-functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 '((dnd-drop-message t t "on target 3")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 (set-extent-property ext 'mouse-face 'highlight)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 (newline 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 (defun make-drag-starters ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 (let ((buf (get-buffer-create "*DND misc-user extent test buffer*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 (s nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 (e nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 (ext nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 (kmap nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 (set-buffer buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 (pop-to-buffer buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (erase-buffer buf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 (insert "Try to drag data from one of the upper extents to one\nof the lower extents. Make sure that your minibuffer is big\ncause it is used to display the data.\n\nYou may also try to select some of this text and drag it with button2.\n\nTo ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 (insert "EXIT")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 (insert " this demo, press 'q'.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (setq kmap (make-keymap))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 (define-key kmap [button1] 'end-dnd-demo)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (set-extent-property ext 'keymap kmap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 (set-extent-property ext 'mouse-face 'highlight)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 (newline 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 (insert "[ TEXT DRAG TEST ]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 (set-extent-property ext 'mouse-face 'isearch)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 (setq kmap (make-keymap))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 (define-key kmap [button1] 'text-drag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (set-extent-property ext 'keymap kmap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 (insert " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 (insert "[ FILE DRAG TEST ]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 (set-extent-property ext 'mouse-face 'isearch)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 (setq kmap (make-keymap))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 (if (featurep 'cde)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 (define-key kmap [button1] 'cde-file-drag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 (define-key kmap [button1] 'file-drag))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 (set-extent-property ext 'keymap kmap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 (insert " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 (insert "[ FILES DRAG TEST ]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 (set-extent-property ext 'mouse-face 'isearch)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 (setq kmap (make-keymap))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 (define-key kmap [button1] 'files-drag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 (set-extent-property ext 'keymap kmap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 (insert " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 (setq s (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 (insert "[ URL DRAG TEST ]")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 (setq e (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 (setq ext (make-extent s e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 (set-extent-property ext 'mouse-face 'isearch)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (setq kmap (make-keymap))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 (if (featurep 'cde)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 (define-key kmap [button1] 'cde-file-drag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 (define-key kmap [button1] 'url-drag))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 (set-extent-property ext 'keymap kmap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 (newline 3)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (defun text-drag (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 (interactive "@e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 (start-drag event "That's a test"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (defun file-drag (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 (interactive "@e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 (start-drag event "/tmp/DropTest.xpm" 2))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 (defun cde-file-drag (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 (interactive "@e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 (start-drag event '("/tmp/DropTest.xpm") t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 (defun url-drag (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 (interactive "@e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 (start-drag event "http://www.xemacs.org/" 8))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 (defun files-drag (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 (interactive "@e")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 (start-drag event '("/tmp/DropTest.html" "/tmp/DropTest.xpm" "/tmp/DropTest.tex") 3))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 (setq experimental-dragdrop-drop-functions '((do-nothing t t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 ;; CDE does not have any button info...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 (dnd-drop-message 0 t "cde-drop somewhere else")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 (dnd-drop-message 2 t "region somewhere else")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 (dnd-drop-message 1 t "drag-source somewhere else")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 (do-nothing t t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (make-drag-starters)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 (make-drop-targets)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 (defun end-dnd-demo ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 (global-set-key [button2] button2-func)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 (bury-buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 (setq lmap (make-keymap))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 (use-local-map lmap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 (local-set-key [q] 'end-dnd-demo)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 (setq button2-func (lookup-key global-map [button2]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 (global-set-key [button2] 'start-region-drag)