New answers tagged


Use find-directory-in-project-by-selected from I also wrote a prototype in pure Lisp. It does not use any third party command line program or package, (require 'find-lisp) (require 'dired) (require 'ido) (defun my-open-dir-in-project () "Open directory in project." (interactive) (let* ((root (...


You could use M-x compile with an appropriate compile-command value. e.g. as a file-local variable: # -*- compile-command: "python"; -*- Emacs will prompt you to save (or not) the file before running the command.


Use M-! (M-x shell-command) if you want to run a shell command, e.g. python and print the output in a new buffer (*Shell Command Output*). That does not open a shell in a new buffer. Use M-x shell to run a shell in a new buffer as pointed by @NickD.


A simple example: (defun hello-world () "Insert \"Hello World!\"." (interactive) (insert "Hello World!\n"))


You need to distinguish between a common function and an interactive command. The latter is also a function, but with the addition of (interactive) to its body. You can run the latter, but not the former, by binding commands to keys or calling them by name via M-x. See the elisp manual links above more more details.

Top 50 recent answers are included