Fork me on GitHub

jsshell-bundle - "2012.4.7"

what is it? download jsshell-bundle

JSShell generated bundle

by Dino Chiesa <dpchiesa@hotmail.com>

http://www.emacswiki.org/emacs/JSShell

how to install

M-x package-install [RET] jsshell-bundle [RET]

about

This is a Javascript REPL shell for emacs that depends on Windows and
its Cscript.exe host.

It was philosophically inspired by Paul Huff's js-comint.el .
The code here, though, is not related. It has been partially derived
from powershell.el, which is Copyright (C) 2008-2011 Dino Chiesa

To Use:
Put jsshell-bundle.el in your load path
Add (require 'jsshell-bundle) to your .emacs
M-x jsshell


There are a few customizations you may be interested in. Probably the
most interesting and useful is the `jsshell-profile', which is a list
of JS modules to load into every JSShell that starts.  You may want
to load in json2.js for example, or moment.js or some other library
or module. These modules are not supplied as part of jsshell.el.


History:

2012.4.7  2012-April-07  Dino Chiesa
Added simple completion.



More:

-- Bundling --

This module ships in two forms, "bundled" and "unbundled."  In
"unbundled" form, this module depends on on an external file named
jsshell.js, which provides the REPL. In bundled form, that code is
embedded in the elisp module. To determine if this is a bundled
version, scan to the bottom of the module and look for the assignment
to `jsshell-js-src'.  If the assignment is there, then this is the
bundled version. Usually the bundled version is called
jsshell-bundled.el while the core version is called jsshell.el.


-- Key mappings --

Consider using these key mappnigs:

(local-set-key "\C-x\C-e" 'jsshell-send-last-sexp)
(local-set-key "\C-\M-x"  'jsshell-send-last-sexp-and-pop)
(local-set-key "\C-cb"    'jsshell-send-buffer)
(local-set-key "\C-c\C-b" 'jsshell-send-buffer-and-pop)
(local-set-key "\C-cl"    'jsshell-load-file-and-pop)
(local-set-key "\C-c\C-e" 'jsshell-send-region)




License:

This code is distributed under the New BSD License.

Copyright (c) 2008-2012, Dino Chiesa
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

Neither the name of the author or any contributors, nor the names of
any organizations they belong to, may be used to endorse or promote
products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.



Bugs:

Literal strings typed into the shell need extra escaping.  This is
particularly a problem with regex strings. Eg, a \d in a JS regex gets
transformed into just a d when run through the jsshell.  I think this
is not a problem when loading files with `jsshell-load-file'. The
problem may not be worth fixing.