From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Changes 2009-07-15/16 in branch? Date: Sat, 01 Aug 2009 15:28:19 +0900 Message-ID: <87r5vwcakc.fsf@uwakimon.sk.tsukuba.ac.jp> References: <4A692E0A.9060108@gnu.org> <633A5994-67EB-4A21-AD99-3359CB5D6D65@Princeton.EDU> <656C A4DB-A331-4A84-A997-A3F744E65801@digg.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249107651 30352 80.91.229.12 (1 Aug 2009 06:20:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Aug 2009 06:20:51 +0000 (UTC) Cc: ams@gnu.org, emacs-devel@gnu.org, rms@gnu.org, cwulfman@Princeton.EDU To: Ian Eure Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 01 08:20:43 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MX7xT-0002Sh-AB for ged-emacs-devel@m.gmane.org; Sat, 01 Aug 2009 08:20:43 +0200 Original-Received: from localhost ([127.0.0.1]:51218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MX7xS-0001uW-IT for ged-emacs-devel@m.gmane.org; Sat, 01 Aug 2009 02:20:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MX7vZ-0001Eb-UG for emacs-devel@gnu.org; Sat, 01 Aug 2009 02:18:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MX7vU-0001Ci-El for emacs-devel@gnu.org; Sat, 01 Aug 2009 02:18:45 -0400 Original-Received: from [199.232.76.173] (port=60015 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MX7vU-0001Cc-7V for emacs-devel@gnu.org; Sat, 01 Aug 2009 02:18:40 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:57924) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MX7vP-0004Gv-Bt; Sat, 01 Aug 2009 02:18:35 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 71D651537C0; Sat, 1 Aug 2009 15:18:31 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 8D8FD1A27C1; Sat, 1 Aug 2009 15:28:19 +0900 (JST) In-Reply-To: X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" 5bbff3553494+ XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113501 Archived-At: Ian Eure writes: > I think it would be unfortunate if it were removed. As Emacs can be > used to develop AppleScript (or other OSA supported languages) this > feature would be needed to run them from within Emacs to test the > code. Without it, you must rely on other tools outside of Emacs for > this functionality. Yeah, but as Harald pointed out, you only have to go as far as osascript (part of Mac OS, or maybe Xcode) and .emacs: ;; Copyright 2009 Stephen J. Turnbull ;; this code and inlined documentation is licensed to you under the ;; GNU GPL, v2 or later at your option ;; tested in XEmacs 21.5.29, YMMV (see the NO WARRANTY clause of the license) (defun osascript (script &rest args) "Run string SCRIPT as an OSA script \(eg, Applescript), with arguments ARGS. Each element of the list ARGS is added to the invocation of osascript(1) formatted with \" %s\". BUG: in interactive use, ARGS must be provided as a Lisp list." ;; A custom read-list could be provided to allow the following style ;; of interface. Example script from osascript(1). ;; Prompts abbreviated, user input only: ;; M-x osascript RET ;; SCRIPT: on run argv C-q C-j ;; return "hello, " & item 1 of argv & "." C-q C-j ;; end run C-q C-j RET ;; ARG: world RET ;; ARG: moon RET ;; ARG: RET ;; and the empty arg terminates the list and runs the command. (interactive "sEnter the text of the script (use C-q C-j for newlines): xScript arguments (as a Lisp list): ") ;; kludge to deal with `interactive's lack of awareness of &rest (when (interactive-p) (setq args (car args))) (shell-command (concat (format "osascript -e '%s'" script) (mapconcat (lambda (x) (format " %s" x)) args ""))))