lab file has been added

This commit is contained in:
Sameer Rahmani 2019-03-11 16:33:28 +00:00
parent b49a32b73c
commit 77429f150f
1 changed files with 17 additions and 0 deletions

17
lib/lab.el Normal file
View File

@ -0,0 +1,17 @@
(defun add-debug-js ()
(interactive)
(insert (concat "console.log('" (which-function) ": ', );"))
(goto-char (- (point) 2)))
(defun add-debug-py ()
(interactive)
(insert (concat "print('" (which-function) ": ', )"))
(goto-char (- (point) 1)))
(defun insert-printer ()
(interactive)
(cond
((member (buffer-mode (current-buffer)) '(rjsx-mode js2-mode)) (add-debug-js))
((member (buffer-mode (current-buffer)) '(python-mode)) (add-debug-py))))
(global-set-key (kbd "M-2") 'insert-printer)