+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 "^".
"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.
/* 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)
{
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. */