From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: how to run javascript in emacs? Date: Fri, 11 Jul 2008 14:33:38 +1000 Organization: Rapt Technologies Message-ID: <87ej61rqe5.fsf@lion.rapttech.com.au> References: <7f65b477-3b87-43bf-aff6-66d195a33b9f@b1g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1215751263 32544 80.91.229.12 (11 Jul 2008 04:41:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jul 2008 04:41:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 11 06:41:48 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KHAS3-0003VX-QK for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jul 2008 06:41:48 +0200 Original-Received: from localhost ([127.0.0.1]:35091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KHARC-0003B4-8g for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jul 2008 00:40:54 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.posted.internode!news.posted.internode.POSTED!not-for-mail Original-NNTP-Posting-Date: Thu, 10 Jul 2008 23:33:39 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:k6zNnVtqetCSEszm8xtCD58mliM= Original-Lines: 44 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 121.44.27.9 Original-X-Trace: sv3-uOaSDVk9DawImoLsEf8E/qIQD/QI5tqYp/yW+5ePP9oQ8ertGFIDdQh69hdw6+hvqHvbu+barEuJlKx!GjJAcj5WraYHmT1NqwxVKEOVgJia+LkyK8brvlyWzUvgW7wgo/w8qpxPE529rReMFLdOuxE= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:160069 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55415 Archived-At: Xah writes: > I want to run Javascript in a console with emacs. Does anyone have > suggestions on what's the solution? > > Here's some detail... In perl/python/php, i can just write the code in > a buffer/file and run it with M-!. I would like to have something > similar for javascript. Basically, with the end result that i just > type in a buffer, save, press some button or command in emacs, and see > results. How can i do this? > > I haven't much experience in coding javascript other than coding > simple sample scripts, and today i just downloaded Firebug in Firefox > 3 but i don't want to have to switch to the browser. > > The context is learning and experimenting with the language. I don't > need the DOM attached. Just need to for example write fibonacci or > prime generator and or other pure string manipulation functions with > js. > > Since FF has a js engine... is there a way to call the js interpreter > with operating system's command line? If so, that'd solve my problem. > (am not familiar with FF dev) > > Thanks. > > Xah > ∑ http://xahlee.org/ > > ☄ Have a look at mozlab. It provides a REPL into firfox where you can inspect the current document and execute javascript. There is an elisp interface which will allow you to run the repl within emacs. There is also a javascript mode, but I don't know how good it is or what capabilities it has, but I suspect you could have a buffer running javascript and define keys that will send the contents to the firefox repl. Tim -- tcross (at) rapttech dot com dot au