New answers tagged

1

Use find-directory-in-project-by-selected from https://github.com/technomancy/find-file-in-project 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 (...


1

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


1

Use M-! (M-x shell-command) if you want to run a shell command, e.g. python file.py 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.


0

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


2

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