all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hoe-Phuan Ng <avtinc2000@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Title: Unable to create key binding.
Date: Sun, 6 Jul 2014 08:23:16 -0600	[thread overview]
Message-ID: <CADL=Rf8AuqVVC6j8XrceyiR7qCiX1mEnzWdAnt5YPWAHFeeexg@mail.gmail.com> (raw)

*Title: Unable to create key binding.*

Hello All:

Below is the code for node.js REPL ( see below ).

I was not able to use the key bindings.

I got “Undefined … “ response from emacs.


 However, I was able to run commands like this:

M-x run-js and M-x js-send-last-sexp


 When I ran command, C-h b, I see these key bindings:

C-c & C-s yas-insert-snippet


 C-c C-r comint-show-output

C-c C-s comint-write-output


 Questions:

Q1: from command, C-h b, kkey bindings list as shown above, what is the
difference between

C-c & C-s and C-c C-s ?


 Q2: Are the existing key bindings conflict with the key bindings show in
code below?


 Q3: What to do now?


 ;;================= Node.js REPL ==============

; Lifted from
http://howardabrams.com/projects/dot-files/emacs-javascript.html

;Server JS with Node.js

;Use js-comint, but hook it up with node.js:


 ; Use require instead of autoload

(require 'js-comint)

;(autoload 'js-comint "js-comint"

; "Hooking JavaScript interpreter up to the JS Files." t nil)


 (setenv "NODE_NO_READLINE" "1") ;; Turn off fancy node prompt

;; Use node as our repl

(setq inferior-js-program-command "node")


 ;According to these instructions ( iink to nodejs.org ), we set the
NODE_NO_READLINE variable.

;Need some prompt configuration for the REPL:


 (setq inferior-js-mode-hook

(lambda ()

;; We like nice colors

(ansi-color-for-comint-mode-on)

;; Deal with some prompt nonsense

(add-to-list

'comint-preoutput-filter-functions

(lambda (output)

(replace-regexp-in-string "\033\\[[0-9]+[GK]" "" output)

(replace-regexp-in-string ".*1G.*3G" "&GT;" output)

(replace-regexp-in-string "&GT;" "> " output)))))


 ;Start the JavaScript node REPL with: run-js Set up some helpful keyboard
instructions:

;; Unable to make key binding work

(add-hook 'js2-mode-hook

(lambda ()

(local-set-key (kbd "\C-c\C-c") 'js-send-buffer)

(local-set-key (kbd "\C-c\C-r") 'js-send-region)

(local-set-key (kbd "\C-c\C-s") 'js-send-last-sexp)

(local-set-key (kbd "\C-c\C-z") 'run-js)))

;================ end of Node.js REPL setup =============


Thank you & Cheers,

HoePhuan


             reply	other threads:[~2014-07-06 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-06 14:23 Hoe-Phuan Ng [this message]
     [not found] <mailman.4947.1404669331.1147.help-gnu-emacs@gnu.org>
2014-07-06 18:30 ` Title: Unable to create key binding Pascal J. Bourguignon

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

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

  git send-email \
    --in-reply-to='CADL=Rf8AuqVVC6j8XrceyiR7qCiX1mEnzWdAnt5YPWAHFeeexg@mail.gmail.com' \
    --to=avtinc2000@gmail.com \
    --cc=help-gnu-emacs@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.