I want to trigger running makefile from inside emacs. I followed this link and added to
(defun set-exec-path-from-shell-PATH () (let ((path-from-shell (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))) (setenv "PATH" path-from-shell) (setq eshell-path-env path-from-shell) ; for eshell users (setq exec-path (split-string path-from-shell path-separator)))) (when window-system (set-exec-path-from-shell-PATH))
to init.el to make emacs see my .bashrc settings. When I invoke shell-command by pressing M-! and type:
I run makefile with success. But I want to run the same command by keyboard shortcut so I added:
(defun make-sth-in-shell () (interactive) (shell-command ("make something")) ; ) (add-hook 'some-hook (lambda () (local-set-key (kbd "\C-c\C-p") 'make-sth-in-shell)) )
and now, when pressing C-c C-p I get
Invalid function: "make something"
What am I doing wrong?