unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: emacs-devel@gnu.org
Subject: Re: Executing Emacs Lisp through AppleScript on Mac OS X?
Date: Sun, 18 Dec 2005 12:54:14 +0900	[thread overview]
Message-ID: <wlpsnvt5zt.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <93457ff00512170541h217a7d5ay3eb55bd6a3bd466d@mail.gmail.com>

>>>>> On Sat, 17 Dec 2005 15:41:17 +0200, Presto W <prestowk@gmail.com> 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."/>
		</command>
	</suite>
</dictionary>

(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
				mituharu@math.s.chiba-u.ac.jp

  reply	other threads:[~2005-12-18  3:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-17 11:11 Executing Emacs Lisp through AppleScript on Mac OS X? Presto W
2005-12-17 13:00 ` Lennart Borgman
2005-12-17 13:41   ` Presto W
2005-12-18  3:54     ` YAMAMOTO Mitsuharu [this message]
2006-01-08 19:46       ` David Reitter
2006-01-08 20:24         ` Lennart Borgman
2006-01-08 21:14           ` David Reitter
2006-01-09  2:21             ` YAMAMOTO Mitsuharu
2006-01-08 20:54         ` Michael Price
2005-12-17 13:28 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wlpsnvt5zt.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).