76 |
;;(require 'select) |
;;(require 'select) |
77 |
(require 'menu-bar) |
(require 'menu-bar) |
78 |
(require 'fontset) |
(require 'fontset) |
79 |
;;(require 'x-dnd) |
(require 'x-dnd) |
80 |
|
|
81 |
(defvar x-invocation-args) |
(defvar x-invocation-args) |
82 |
|
|
1564 |
(mouse-wheel-mode 1) |
(mouse-wheel-mode 1) |
1565 |
|
|
1566 |
(defun mac-drag-n-drop (event) |
(defun mac-drag-n-drop (event) |
1567 |
"Edit the files listed in the drag-n-drop event.\n\ |
"Edit the files listed in the drag-n-drop EVENT. |
1568 |
Switch to a buffer editing the last file dropped." |
Switch to a buffer editing the last file dropped." |
1569 |
(interactive "e") |
(interactive "e") |
1570 |
(save-excursion |
(save-excursion |
1577 |
(y (cdr coords))) |
(y (cdr coords))) |
1578 |
(if (and (> x 0) (> y 0)) |
(if (and (> x 0) (> y 0)) |
1579 |
(set-frame-selected-window nil window)) |
(set-frame-selected-window nil window)) |
1580 |
(mapcar |
(mapcar (lambda (file-name) |
1581 |
'(lambda (file) |
(x-dnd-handle-one-url window 'private |
1582 |
(find-file |
(concat "file:" file-name))) |
1583 |
(decode-coding-string |
(car (cdr (cdr event))))) |
1584 |
file |
(raise-frame))) |
|
(or file-name-coding-system |
|
|
default-file-name-coding-system)))) |
|
|
(car (cdr (cdr event))))) |
|
|
(raise-frame) |
|
|
(recenter))) |
|
1585 |
|
|
1586 |
(global-set-key [drag-n-drop] 'mac-drag-n-drop) |
(global-set-key [drag-n-drop] 'mac-drag-n-drop) |
1587 |
|
|