Created
July 4, 2014 03:23
-
-
Save redraiment/afcde2fec8ce63697075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun current-sentence () | |
(interactive) | |
(replace-regexp-in-string "\n" ";" | |
(substring-no-properties | |
(or (sentence-at-point) | |
(save-excursion | |
(backward-sentence) | |
(sentence-at-point)))))) | |
(defun commit-last-js () | |
(interactive) | |
(let ((sentence (current-sentence))) | |
(with-current-buffer "*shell*" | |
(insert sentence) | |
(comint-send-input)))) | |
(defun eval-last-js () | |
(local-set-key (kbd "C-x C-e") #'commit-last-js)) | |
(add-hook 'js-mode-hook #'eval-last-js) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment