diff options
| author | Steven Tamm | 2004-12-30 02:04:31 +0000 |
|---|---|---|
| committer | Steven Tamm | 2004-12-30 02:04:31 +0000 |
| commit | 456e761becb3d7dc0b7a707079b4f1259e9da598 (patch) | |
| tree | 454fbf8751a183ab52de718af3abc65f0e739c96 | |
| parent | c4cb00d05e5e3a227681de41a4aef0067bce106a (diff) | |
| download | emacs-456e761becb3d7dc0b7a707079b4f1259e9da598.tar.gz emacs-456e761becb3d7dc0b7a707079b4f1259e9da598.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/term/mac-win.el | 38 | ||||
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/macterm.c | 19 |
4 files changed, 53 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 25194e149ac..b8bdb1b1ea4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-12-29 Sanghyuk Suh <han9kin@mac.com> | ||
| 2 | |||
| 3 | * term/mac-win.el (mac-drag-n-drop): Handle drag-n-drop events | ||
| 4 | that include line numbers. | ||
| 5 | |||
| 1 | 2004-12-29 Milan Zamazal <pdm@zamazal.org> | 6 | 2004-12-29 Milan Zamazal <pdm@zamazal.org> |
| 2 | 7 | ||
| 3 | * files.el (hack-local-variables): If no PREFIX, set it to "^". | 8 | * files.el (hack-local-variables): If no PREFIX, set it to "^". |
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 19d25288448..4b3c7531e5a 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -1567,21 +1567,29 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman") | |||
| 1567 | "Edit the files listed in the drag-n-drop EVENT. | 1567 | "Edit the files listed in the drag-n-drop EVENT. |
| 1568 | Switch to a buffer editing the last file dropped." | 1568 | Switch to a buffer editing the last file dropped." |
| 1569 | (interactive "e") | 1569 | (interactive "e") |
| 1570 | (save-excursion | 1570 | ;; Make sure the drop target has positive co-ords |
| 1571 | ;; Make sure the drop target has positive co-ords | 1571 | ;; before setting the selected frame - otherwise it |
| 1572 | ;; before setting the selected frame - otherwise it | 1572 | ;; won't work. <skx@tardis.ed.ac.uk> |
| 1573 | ;; won't work. <skx@tardis.ed.ac.uk> | 1573 | (let* ((window (posn-window (event-start event))) |
| 1574 | (let* ((window (posn-window (event-start event))) | 1574 | (coords (posn-x-y (event-start event))) |
| 1575 | (coords (posn-x-y (event-start event))) | 1575 | (x (car coords)) |
| 1576 | (x (car coords)) | 1576 | (y (cdr coords))) |
| 1577 | (y (cdr coords))) | 1577 | (if (and (> x 0) (> y 0)) |
| 1578 | (if (and (> x 0) (> y 0)) | 1578 | (set-frame-selected-window nil window)) |
| 1579 | (set-frame-selected-window nil window)) | 1579 | (mapcar (lambda (file-name) |
| 1580 | (mapcar (lambda (file-name) | 1580 | (if (listp file-name) |
| 1581 | (x-dnd-handle-one-url window 'private | 1581 | (let ((line (car file-name)) |
| 1582 | (concat "file:" file-name))) | 1582 | (start (car (cdr file-name))) |
| 1583 | (car (cdr (cdr event))))) | 1583 | (end (car (cdr (cdr file-name))))) |
| 1584 | (raise-frame))) | 1584 | (if (> line 0) |
| 1585 | (goto-line line) | ||
| 1586 | (if (and (> start 0) (> end 0)) | ||
| 1587 | (progn (set-mark start) | ||
| 1588 | (goto-char end))))) | ||
| 1589 | (x-dnd-handle-one-url window 'private | ||
| 1590 | (concat "file:" file-name)))) | ||
| 1591 | (car (cdr (cdr event))))) | ||
| 1592 | (raise-frame)) | ||
| 1585 | 1593 | ||
| 1586 | (global-set-key [drag-n-drop] 'mac-drag-n-drop) | 1594 | (global-set-key [drag-n-drop] 'mac-drag-n-drop) |
| 1587 | 1595 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 2f974365cdc..4bc9e69ce12 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2004-12-29 Sanghyuk Suh <han9kin@mac.com> | ||
| 2 | |||
| 3 | * macterm.c (SelectionRange): Add Xcode position apple event struct. | ||
| 4 | (do_ae_open_documents): Handle Xcode-style file position open | ||
| 5 | events. | ||
| 6 | |||
| 1 | 2004-12-29 Luc Teirlinck <teirllm@auburn.edu> | 7 | 2004-12-29 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 8 | ||
| 3 | * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo. | 9 | * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo. |
diff --git a/src/macterm.c b/src/macterm.c index 745457f0ff3..4df30e74386 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -7928,6 +7928,17 @@ path_from_vol_dir_name (char *, int, short, long, char *); | |||
| 7928 | /* Called when we receive an AppleEvent with an ID of | 7928 | /* Called when we receive an AppleEvent with an ID of |
| 7929 | "kAEOpenDocuments". This routine gets the direct parameter, | 7929 | "kAEOpenDocuments". This routine gets the direct parameter, |
| 7930 | extracts the FSSpecs in it, and puts their names on a list. */ | 7930 | extracts the FSSpecs in it, and puts their names on a list. */ |
| 7931 | #pragma options align=mac68k | ||
| 7932 | typedef struct SelectionRange { | ||
| 7933 | short unused1; // 0 (not used) | ||
| 7934 | short lineNum; // line to select (<0 to specify range) | ||
| 7935 | long startRange; // start of selection range (if line < 0) | ||
| 7936 | long endRange; // end of selection range (if line < 0) | ||
| 7937 | long unused2; // 0 (not used) | ||
| 7938 | long theDate; // modification date/time | ||
| 7939 | } SelectionRange; | ||
| 7940 | #pragma options align=reset | ||
| 7941 | |||
| 7931 | static pascal OSErr | 7942 | static pascal OSErr |
| 7932 | do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) | 7943 | do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) |
| 7933 | { | 7944 | { |
| @@ -7936,11 +7947,19 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) | |||
| 7936 | AEKeyword keyword; | 7947 | AEKeyword keyword; |
| 7937 | DescType actual_type; | 7948 | DescType actual_type; |
| 7938 | Size actual_size; | 7949 | Size actual_size; |
| 7950 | SelectionRange position; | ||
| 7939 | 7951 | ||
| 7940 | err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); | 7952 | err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); |
| 7941 | if (err != noErr) | 7953 | if (err != noErr) |
| 7942 | goto descriptor_error_exit; | 7954 | goto descriptor_error_exit; |
| 7943 | 7955 | ||
| 7956 | err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size); | ||
| 7957 | if (err == noErr) | ||
| 7958 | drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1), | ||
| 7959 | make_number (position.startRange + 1), | ||
| 7960 | make_number (position.endRange + 1)), | ||
| 7961 | drag_and_drop_file_list); | ||
| 7962 | |||
| 7944 | /* Check to see that we got all of the required parameters from the | 7963 | /* Check to see that we got all of the required parameters from the |
| 7945 | event descriptor. For an 'odoc' event this should just be the | 7964 | event descriptor. For an 'odoc' event this should just be the |
| 7946 | file list. */ | 7965 | file list. */ |