unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Integration with Apple Xcode
@ 2004-11-25  2:20 Sanghyuk Suh
  2004-11-25 10:02 ` Kim F. Storm
  2004-11-26 17:22 ` Richard Stallman
  0 siblings, 2 replies; 12+ messages in thread
From: Sanghyuk Suh @ 2004-11-25  2:20 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Sorry, I forgot attaching the diff

Sanghyuk Suh

[-- Attachment #2: emacs-xcode.diff --]
[-- Type: application/octet-stream, Size: 3860 bytes --]

Index: lisp/term/mac-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v
retrieving revision 1.25
diff -c -r1.25 mac-win.el
*** lisp/term/mac-win.el	2 Sep 2004 16:59:18 -0000	1.25
--- lisp/term/mac-win.el	23 Nov 2004 15:34:02 -0000
***************
*** 148,154 ****
    "Edit the files listed in the drag-n-drop event.\n\
  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>
--- 148,154 ----
    "Edit the files listed in the drag-n-drop event.\n\
  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>
***************
*** 160,173 ****
  	  (set-frame-selected-window nil window))
        (mapcar
         '(lambda (file)
! 	  (find-file
! 	   (decode-coding-string
! 	    file
! 	    (or file-name-coding-system
! 		default-file-name-coding-system))))
         (car (cdr (cdr event)))))
    (raise-frame)
!   (recenter)))
  
  (global-set-key [drag-n-drop] 'mac-drag-n-drop)
  
--- 160,182 ----
  	  (set-frame-selected-window nil window))
        (mapcar
         '(lambda (file)
! 	  (if (listp file)
! 	      (let ((line (car file))
! 		    (start (car (cdr file)))
! 		    (end (car (cdr (cdr file)))))
! 		(if (> line 0)
! 		    (goto-line line)
! 		  (if (and (> start 0) (> end 0))
! 		      (progn (set-mark start)
! 			     (goto-char end)))))
! 	    (find-file
! 	     (decode-coding-string
! 	      file
! 	      (or file-name-coding-system
! 		  default-file-name-coding-system)))))
         (car (cdr (cdr event)))))
    (raise-frame)
!   (recenter));)
  
  (global-set-key [drag-n-drop] 'mac-drag-n-drop)
  
Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.82
diff -c -r1.82 macterm.c
*** src/macterm.c	21 Nov 2004 15:49:12 -0000	1.82
--- src/macterm.c	23 Nov 2004 15:34:03 -0000
***************
*** 7760,7765 ****
--- 7760,7776 ----
  /* 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)
  {
***************
*** 7768,7778 ****
--- 7779,7797 ----
    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.  */

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread
* integration with Apple Xcode
@ 2004-11-25  2:08 Sanghyuk Suh
  0 siblings, 0 replies; 12+ messages in thread
From: Sanghyuk Suh @ 2004-11-25  2:08 UTC (permalink / raw)


Hello.
I changed src/macterm.c, lisp/term/mac-win.el to support Apple Xcode's open document event.
With this changes, automatically goto line or select range specified from Xcode after opening file.
Please review the diff, and if possible, apply this change to current cvs tree.
Sorry about my poor english.

Sanghyuk Suh

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-12-03  3:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-25  2:20 Integration with Apple Xcode Sanghyuk Suh
2004-11-25 10:02 ` Kim F. Storm
2004-11-25 13:27   ` Sanghyuk Suh
2004-11-25 17:28     ` Steven Tamm
2004-11-26  0:56       ` Sanghyuk Suh
2004-11-26 10:19         ` Kim F. Storm
2004-11-27 18:51           ` Richard Stallman
2004-11-26 21:04       ` Richard Stallman
2004-11-26 17:22 ` Richard Stallman
     [not found]   ` <3E5B2486-443E-11D9-A1B7-000393861220@sage.com>
2004-12-02  8:58     ` Sébastien Kirche
2004-12-03  3:42     ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2004-11-25  2:08 integration " Sanghyuk Suh

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).