From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hoe-Phuan Ng Newsgroups: gmane.emacs.help Subject: Title: Unable to create key binding. Date: Sun, 6 Jul 2014 08:23:16 -0600 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1404669351 32518 80.91.229.3 (6 Jul 2014 17:55:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jul 2014 17:55:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 06 19:55:45 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X3qfB-00056q-Kx for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Jul 2014 19:55:45 +0200 Original-Received: from localhost ([::1]:46758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3qfB-0003Ey-6v for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Jul 2014 13:55:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3nLb-0006du-Kd for help-gnu-emacs@gnu.org; Sun, 06 Jul 2014 10:23:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3nLa-0003PM-9x for help-gnu-emacs@gnu.org; Sun, 06 Jul 2014 10:23:19 -0400 Original-Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:33370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3nLZ-0003PA-U0 for help-gnu-emacs@gnu.org; Sun, 06 Jul 2014 10:23:18 -0400 Original-Received: by mail-wi0-f180.google.com with SMTP id hi2so5526785wib.13 for ; Sun, 06 Jul 2014 07:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gIRLhWrGZ0glD1/YyoaxERJQ2aVVYCHje84+zeKPf1s=; b=oHtbOU62/x7TBm7wNA7Jfn/9fmleyGDOLxssHqQCbMlmOnd9iUfjdFs997u2LYcBx4 5Wq3U18MM5zWi6eke3I4dc2E8nY7/wQw1frqkpYdaFK3fhoDUL64JFc/F57w+MpoFFt4 FOqj20E/V2xinFQl/lj4Ao1edRrFnr4gDdfyhC5MNIvxucTcnnB1kpklLrn+/A7rPux3 xf9xJ5XssIY3d8hPQkBZxTT0h+xikD8JK6etmyHOqZmmZr47TYoM3USJb7kuZvF6W3Yd Dlt7TWeUn2Wy//g1nKebrhGHEIpoB1gNtr7ck27FoSyfbivLvAkd8sQC6zmV+fgqMZIh WZDg== X-Received: by 10.194.192.201 with SMTP id hi9mr25954759wjc.28.1404656596328; Sun, 06 Jul 2014 07:23:16 -0700 (PDT) Original-Received: by 10.216.72.201 with HTTP; Sun, 6 Jul 2014 07:23:16 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 X-Mailman-Approved-At: Sun, 06 Jul 2014 13:55:31 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98552 Archived-At: *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 =E2=80=9CUndefined =E2=80=A6 =E2=80=9C 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? ;;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Node.js REPL =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ; 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" ">" output) (replace-regexp-in-string ">" "> " 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))) ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D end of Node.js REPL setup= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Thank you & Cheers, HoePhuan