Commit 456e761b authored by Steven Tamm's avatar Steven Tamm
Browse files

* macterm.c (SelectionRange): Add Xcode position apple event struct.

	(do_ae_open_documents): Handle Xcode-style file position open
	events.
* term/mac-win.el (mac-drag-n-drop): Handle drag-n-drop events
	that include line numbers.
parent c4cb00d0
2004-12-29 Sanghyuk Suh <han9kin@mac.com>
* term/mac-win.el (mac-drag-n-drop): Handle drag-n-drop events
that include line numbers.
2004-12-29 Milan Zamazal <pdm@zamazal.org>
 
* files.el (hack-local-variables): If no PREFIX, set it to "^".
......
......@@ -1567,21 +1567,29 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
"Edit the files listed in the drag-n-drop EVENT.
Switch to a buffer editing the last file dropped."
(interactive "e")
(save-excursion
;; Make sure the drop target has positive co-ords
;; before setting the selected frame - otherwise it
;; won't work. <skx@tardis.ed.ac.uk>
(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))
(mapcar (lambda (file-name)
(x-dnd-handle-one-url window 'private
(concat "file:" file-name)))
(car (cdr (cdr event)))))
(raise-frame)))
;; Make sure the drop target has positive co-ords
;; before setting the selected frame - otherwise it
;; won't work. <skx@tardis.ed.ac.uk>
(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))
(mapcar (lambda (file-name)
(if (listp file-name)
(let ((line (car file-name))
(start (car (cdr file-name)))
(end (car (cdr (cdr file-name)))))
(if (> line 0)
(goto-line line)
(if (and (> start 0) (> end 0))
(progn (set-mark start)
(goto-char end)))))
(x-dnd-handle-one-url window 'private
(concat "file:" file-name))))
(car (cdr (cdr event)))))
(raise-frame))
(global-set-key [drag-n-drop] 'mac-drag-n-drop)
......
2004-12-29 Sanghyuk Suh <han9kin@mac.com>
* macterm.c (SelectionRange): Add Xcode position apple event struct.
(do_ae_open_documents): Handle Xcode-style file position open
events.
2004-12-29 Luc Teirlinck <teirllm@auburn.edu>
 
* buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo.
......
......@@ -7928,6 +7928,17 @@ path_from_vol_dir_name (char *, int, short, long, char *);
/* Called when we receive an AppleEvent with an ID of
"kAEOpenDocuments". This routine gets the direct parameter,
extracts the FSSpecs in it, and puts their names on a list. */
#pragma options align=mac68k
typedef struct SelectionRange {
short unused1; // 0 (not used)
short lineNum; // line to select (<0 to specify range)
long startRange; // start of selection range (if line < 0)
long endRange; // end of selection range (if line < 0)
long unused2; // 0 (not used)
long theDate; // modification date/time
} SelectionRange;
#pragma options align=reset
static pascal OSErr
do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
{
......@@ -7936,11 +7947,19 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
AEKeyword keyword;
DescType actual_type;
Size actual_size;
SelectionRange position;
err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc);
if (err != noErr)
goto descriptor_error_exit;
err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size);
if (err == noErr)
drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1),
make_number (position.startRange + 1),
make_number (position.endRange + 1)),
drag_and_drop_file_list);
/* Check to see that we got all of the required parameters from the
event descriptor. For an 'odoc' event this should just be the
file list. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment