$ show emacsorphanage/quickrun
quickrun.el is an Emacs Lisp package that provides a quick and convenient way to execute the current buffer's content using the appropriate interpreter or compiler. It automatically detects the programming language based on file extension or major mode, then runs the corresponding command (e.g., python, gcc, node) with the buffer content as input. The package supports a wide range of languages, including compiled languages (C, C++, Java, Go), scripting languages (Python, Ruby, Perl), and markup languages (Markdown, HAML). It offers multiple execution modes: standard run, compile-only, shell (for interactive programs), region execution, and argument passing. Output can be directed to a dedicated *quickrun* buffer with ANSI color support, or to files, variables, browsers, or multiple destinations via a pluggable outputter system. The architecture is monolithic, with all functionality contained in a single Emacs Lisp file, but it provides a clean extension API via `quickrun-add-command` and `quickrun-set-default` for adding custom language support. The package is well-maintained, with active development and CI testing across multiple Emacs versions and platforms.
The LLM identified 2 files worth highlighting for reuse:
The outputter system defines a set of functions (`quickrun--default-outputter`, `quickrun--outputter-file`, `quickrun--outputter-buffer`, `quickrun--outputter-variable`, `quickrun--outputter-browser`, `quickrun--outputter-message`, `quickrun--outputter-null`, `quickrun--outputter-replace-region`, `quickrun--outputter-eval-print`) that process command output. These are independent, self-contained functions that can be extracted and reused in any Emacs package needing to handle subprocess output with flexible routing (to buffer, file, variable, browser, etc.). The pattern demonstrates clean separation of concerns and is easily extensible.
The template placeholder expansion functions (`quickrun--fill-template`, `quickrun--place-holder-info`) implement a generic string substitution system using placeholders like `%c`, `%s`, `%o`, `%a`, etc. This is a reusable utility for any Emacs Lisp code that needs to construct command strings from templates with dynamic values. The implementation is clean, uses a hash table for efficient lookup, and supports case-sensitive matching.