[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Executing Emacs Lisp through AppleScript on Mac OS X?

From: YAMAMOTO Mitsuharu
Subject: Re: Executing Emacs Lisp through AppleScript on Mac OS X?
Date: Sun, 18 Dec 2005 12:54:14 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sat, 17 Dec 2005 15:41:17 +0200, Presto W <address@hidden> said:

> Just wanted to know if anyone else already thought of this or even
> implemented it.

Currently, underlying Apple event support is in the early stage and
too weak to support AppleScript in general.  It can react to incoming
Apple events, but cannot return results or error messages to the
caller.  If this limitation is OK with you, the implementation would
be as follows:

<?xml version="1.0"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary title="Emacs Terminology">
        <suite name="Emacs Suite" code="EMAx">
                <command name="do Lisp" code="EMAxLisp" description="Evaluate a 
Lisp expression.">
                        <direct-parameter type="text" description="The 
expression to be evaluated."/>

(put 'emacs-suite 'mac-apple-event-class "EMAx")
(put 'do-lisp 'mac-apple-event-id "Lisp")

(defun mac-ae-do-lisp (event)
  (interactive "e")
  (eval (car (read-from-string (mac-ae-text (mac-event-ae event))))))

(define-key mac-apple-event-map [emacs-suite do-lisp] 'mac-ae-do-lisp)

                                     YAMAMOTO Mitsuharu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]