Skip to content
A language flexible play button for Emacs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
project-run.el
project-run.elc
run-file.xpm
run.xpm

README.md

Project-run

A productivity extension for programmers who use Emacs.


Run Files
Running files is for executing programs that are contained in one file. It is ideal for scripts, but will compile the file if necessary. Although Project-run might find the right shell command to run your program, you still need to have the compiler or interpreter installed.

Use M-x run-file (M-x run-f for short or run-file button) to execute the file that is in the current buffer. Project run will know how to run the program based on the major mode. If the programming language isn't supported yet, then you'll be prompted to tell it how to run the program.

If the file isn't being run the way you want, then you can change it by using M-x file-config (M-x file-con) to change the way the current buffer will be evaluated. This will be remembered until you close Emacs.


Projects
Projects are for executing a group of files together. It is ideal for programs that use many files.
While projects can replace makefiles in small projects. Projects are more of improvement on top of makefiles.
Projects will be remembered by Emacs until you delete them with M-x delete-project (M-x delete-pr).
Projects are useful because you can test your program without having to think about M-x compile or M-x shell.
Lastly, changing projects will mess with your source code. You still have to make files, then add them to project, or delete the files after deleting a project; projects are just a way to associate an execution procedure with source code files and run it without thinking too much.

Projects have several parts:

  • name:
    The name of the project. Useful for referencing the project later
  • compile command:
    The shell command to compile the programs. Ideally it would be to run a make file. and should empty for purely interpreted languages
  • run command:
    The shell command to execute the program
  • path:
    The directory path where the compile and run commands should be run. It is usually the path to the makefile
  • file associations:
    Files that have been added to the project, are files where the M-x run (or run button) can be used to run the project. Removing them from the project does not delete them.

You can create a new project by using M-x create-project (M-x cr lol). It will prompt you for all the data above. The name, compile command, run command, and path can be changed later by using M-x project-config (M-x project-c).

File associations can be changed later by using M-x add-project-files (M-x add-p) or M-x remove-project-files (M-x remove-p).

After creating a project, you can run it by using M-x run.

All the M-x functions can be found in a menu-bar item called Run, and there should be two buttons on the tool-bar for run and run-file.


Installation

Download and extract project-run-master to your emacs installation path. For example:
~/.emacs.d/elpa/
And rename it from project-run-master to project-run
Then put the following somewhere in your init (~/.emacs) file:
(add-to-list 'load-path "~/.emacs.d/elpa/project-run")
(require 'project-run)

You can’t perform that action at this time.