unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Apple event handling (Carbon port)
@ 2006-01-02 13:02 David Reitter
  2006-01-05  8:23 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 2+ messages in thread
From: David Reitter @ 2006-01-02 13:02 UTC (permalink / raw)


Emacs should understand the "open document" Apple event, as far as  
the code goes.
However, this little AppleScript

tell application "Emacs"
	activate
	open (file "Lucy:private:tmp:hello.txt")	
end tell

just leads to the following error:

--Lisp error: (error "Parameter for \"----\" is not a list")
   signal(error ("Parameter for \"----\" is not a list"))
   error("Parameter for \"%s\" is not a list" "----")
   mac-ae-list(("aevt" ("----" "obj " . "dle2\0\0\0\0obj \0\0\0 
Z\0\0\0\x04\0\0\0\0formenum\0\0\0\x04namewanttype\0\0\0\x04fileseldTEXT\0\0\0\x1aLucy:private:tmp:he 
llo.txtfromnull\0\0\0\0")) nil undecoded-file-name)
   mac-ae-open-documents((mac-apple-event [core-event open-documents]  
("aevt" ("----" "obj " . "dle2\0\0\0\0obj \0\0\0 
Z\0\0\0\x04\0\0\0\0formenum\0\0\0\x04namewanttype\0\0\0\x04fileseldTEXT\0\0\0\x1aLucy:private:tmp:he 
llo.txtfromnull\0\0\0\0"))))
   call-interactively(mac-ae-open-documents)
   mac-dispatch-apple-event((mac-apple-event [core-event open- 
documents] ("aevt" ("----" "obj " . "dle2\0\0\0\0obj \0\0\0 
Z\0\0\0\x04\0\0\0\0formenum\0\0\0\x04namewanttype\0\0\0\x04fileseldTEXT\0\0\0\x1aLucy:private:tmp:he 
llo.txtfromnull\0\0\0\0"))))
   call-interactively(mac-dispatch-apple-event)

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

* Re: Apple event handling (Carbon port)
  2006-01-02 13:02 Apple event handling (Carbon port) David Reitter
@ 2006-01-05  8:23 ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 2+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-01-05  8:23 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Mon, 2 Jan 2006 13:02:25 +0000, David Reitter <david.reitter@gmail.com> said:

> Emacs should understand the "open document" Apple event, as far as  
> the code goes.
> However, this little AppleScript

> tell application "Emacs"
> 	activate
> 	open (file "Lucy:private:tmp:hello.txt")	
> end tell

> just leads to the following error:

Coercion to AEList seems to be needed in this case.  I installed the
following change:

Index: lisp/term/mac-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v
retrieving revision 1.60
diff -c -r1.60 mac-win.el
*** lisp/term/mac-win.el	19 Dec 2005 08:29:06 -0000	1.60
--- lisp/term/mac-win.el	5 Jan 2006 05:07:53 -0000
***************
*** 1409,1422 ****
        (error "Not an Apple event: %S" ae)
      (let ((type-data (cdr (assoc keyword (cdr ae))))
  	  data)
!       (when (and type type-data)
  	(setq data (mac-coerce-ae-data (car type-data) (cdr type-data) type))
  	(setq type-data (if data (cons type data) nil)))
        type-data)))
  
  (defun mac-ae-list (ae &optional keyword type)
    (or keyword (setq keyword "----")) ;; Direct object.
!   (let ((desc (mac-ae-parameter ae keyword)))
      (cond ((null desc)
  	   nil)
  	  ((not (equal (car desc) "list"))
--- 1409,1422 ----
        (error "Not an Apple event: %S" ae)
      (let ((type-data (cdr (assoc keyword (cdr ae))))
  	  data)
!       (when (and type type-data (not (equal type (car type-data))))
  	(setq data (mac-coerce-ae-data (car type-data) (cdr type-data) type))
  	(setq type-data (if data (cons type data) nil)))
        type-data)))
  
  (defun mac-ae-list (ae &optional keyword type)
    (or keyword (setq keyword "----")) ;; Direct object.
!   (let ((desc (mac-ae-parameter ae keyword "list")))
      (cond ((null desc)
  	   nil)
  	  ((not (equal (car desc) "list"))

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

end of thread, other threads:[~2006-01-05  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-02 13:02 Apple event handling (Carbon port) David Reitter
2006-01-05  8:23 ` YAMAMOTO Mitsuharu

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).