mk-project.el: An Emacs project library
This is a personal fork of mk-project on which I chose to base my own experiments regarding emacs project management on.
My aim is to add optionally loadable modules to mk-project that keep its core intact and which enhance and further integrate mk-project into the packages that make up my own personal emacs ecosystem.
Transitioning from a vanilla mk-project installation to my experimental branch should be straightforward.
Current focus is on integrating mk-project with org-mode, adding convenience functionality that enables project creation on the fly, ad-hoc projects to use mk-project functions when no project is active and editing a project configuration while it is active.
New project config directives:
- friends
Lists a number of friendly files and projects.
New global config vars:
mk-global-cache-root
default:
"~/.mk-project"
Root path under which to create files that contain project metadata like open files, open friends etc. These are automatically created for a project under a directory created under this path. Makes the open-files-cache, file-list-cache, open-friends-cache directives optional.
mk-proj-before-load-hook, mk-proj-after-load-hook, mk-proj-before-unload-hook, mk-proj-after-unload-hook
Hooks that are run after/before project loading/unloading
mk-proj-buildsystems
default:
'((gnu-make ((files ("autogen.sh" "configure" "Makefile"))
(build "make $MK_BUILD_OPTS")))
(cmake ((files ("CMakeLists.txt"))
(build (lambda () (mk-proj-cmake-build)))))
(cabal ((files ("Setup.lhs"))
(build "runhaskell Setup.lhs build $MK_BUILD_OPTS")))
(python ((files ("setup.py"))
(build "python setup.py build $MK_BUILD_OPTS"))))
Used when guessing a project root or its compile-cmd.
mk-proj-incubator-paths
default:
`(,(expand-file-name "~"))
An incubator is a location where multiple projects are kept. These will be ignored when guessing a projects basedir thus giving preference to subdirectories within it.
It is not impossible for an incubator path to be guessed as project basedir though. If you'll guess while in a buffer with a file from an incubator root open, that incubator root could be guessed as basedir.
mk-proj-common-project-subdir-names
default:
'("src" "include" "demo[?s]" "example[?s]" "doc[?s]" "build" "tool[?s]" "test[?s]" "misc")
Common subdirectory names found in projects as regular expressions. These help guessing a projects basedir. Matching directory names will be ignored and their parent directory used as basedir.
mk-proj-src-pattern-table
default:
'(("h" ".*\\.c" ".*\\.cpp" ".*\\.cc")
("hpp" ".*\\.c" ".*\\.cpp" ".*\\.cc")
("hh" ".*\\.c" ".*\\.cpp" ".*\\.cc")
("c" ".*\\.h")
("cpp" ".*\\.h" ".*\\.hpp" ".*\\.hh")
("cc" ".*\\.h" ".*\\.hpp" ".*\\.hh")
("hs" ".*\\.lhs" ".*\\.cabal")
("php" ".*\\.html")
("js" ".*\\.html")
("clojure" ".*\\.clj")
("clj" ".*\\.clojure"))
Maps file suffixes to regexps used as source-patterns when guessing a project config from the currently opened file in the active buffer.
mk-proj-config-save-location
default:
nil
Where to save project configs in elisp. If this is a filename project configs will be written to that file. If it is a directory an elisp file with the projects name will be created in that directory.
mk-proj-config-save-section
default:
";; autogenerated projects"
Mk-Project saves every new project right below this line (if it can find it, if not it creates it at the end of the file).
mk-org-project-search-files
List of .org files that mk-org searches for project definitions.
mk-org-todo-keywords
Todo keywords that mk-org will recognize as tasks.
mk-org-config-save-location
Where to store project org trees. Can be either a directory name to use one org file per project stored in a single directory, can be a filename to use a single org file for all projects, for every other non-nil value a single org file is stored in the projects basedir.
mk-org-config-save-section
A headline under which to store project org trees.
New commands:
project-ack-with-friends
Same as project-ack, but also searches through friends
project-multi-occur-with-friends
Same as project-multi-occur, but also uses open friends
project-create
Create a new project from scratch
project-edit
Edit current project config
project-save
Save project config to disk
project-org-buffer
Open project org tree buffer
project-clock-in, project-clock-out
Clock in/out projects org-mode entry