Org-roam: Modularize org-roam features

Created on 26 Mar 2020  路  5Comments  路  Source: org-roam/org-roam

org-roam has a lot of potential for growth. It would make sense to break some functionality out into its own feature/file. For example, the org-roam-graph functionality seems like a good starting point. It is pretty well contained and could be made more consistent/generic so that its possible to support graphing software other than Graphviz in the future. Users who do not need the graphing functionality could skip the load time for that feature as well. Org does something similar with `org-modules'.

enhancement

Most helpful comment

Looking over the source I feel like the database, graphing, completion and capture logic could all be made into their own features.

All 5 comments

Looking over the source I feel like the database, graphing, completion and capture logic could all be made into their own features.

I realize this is a very large commit, but the first step is getting each feature into its own file and normalizing the function/variable names:

https://github.com/progfolio/org-roam/commit/5bbcf5e0326ec7eabab676416731ccc3ea737cdd

Still a work in progress and I don't think everything is in its place yet, but this will make it easier to hack on individual aspects of org-roam without always touching its "core".
Happy to work on this more if you think it's a viable direction.

Most of the features that can be moved into their own files are already separated by in sections using ;;;.

I think moving things into their own files is good for maintainability. But I'd like a defalias to the original function names, at least for the interactives, so people's keybindings don't break.

Most of the features that can be moved into their own files are already separated by in sections using ;;;.

I followed roughly that pattern.

I think moving things into their own files is good for maintainability. But I'd like a defalias to the original function names, at least for the interactives, so people's keybindings don't break.

I've added the command aliases and rebased on top of https://github.com/jethrokuan/org-roam/commit/df29da1b6db56d44f0f1232815612e8084dc177d

Here: https://github.com/progfolio/org-roam/tree/refactor-modularize-features

I'm running makem.sh locally and I've addressed all relevant errors:

Starting new Ispell process /usr/bin/aspell with default dictionary... \ 
Starting new Ispell process /usr/bin/aspell with default dictionary...done
company-org-roam.el:60: Error checking word UNIX using aspell with default dictionary
...other unrecognized words omitted
org-roam.el:740: Error checking word BACKLINKS using aspell with default dictionary
ERROR (2020-03-27 16:49:10): Linting checkdoc failed.
org-roam-completion.el:96: Indentation mismatch
org-roam-completion.el:97: Indentation mismatch
org-roam-completion.el:98: Indentation mismatch
org-roam-completion.el:99: Indentation mismatch
org-roam-completion.el:100: Indentation mismatch
ERROR (2020-03-27 16:49:12): Linting indentation failed.
Entering directory '/home/n/.emacs.d/straight/repos/org-roam/'
org-roam-db.el:73:0: error: Aliases should start with the package's prefix "org-roam-db".
org-roam-db.el:191:0: error: Aliases should start with the package's prefix "org-roam-db".
org-roam-db.el:353:0: error: Aliases should start with the package's prefix "org-roam-db".
org-roam-graph.el:173:0: error: Aliases should start with the package's prefix "org-roam-graph".
org-roam-macs.el:36:0: error: "org-roam--with-temp-buffer" doesn't start with package's prefix "org-roam-macs".
ERROR (2020-03-27 16:49:13): Linting package failed.
LOG (2020-03-27 16:49:17): Finished with 3 errors.

The complaint about the macro not starting with the org-roam-macs prefix is not something I'd worry about. Org-mode has a similar convention of using an org-macs.el file for macros which does not follow the prefix convention either.

The alias prefix complaints will exist until support is dropped for the original command aliases. The new commands start with each feature's proper prefix.

The only thing I did not address is the documentation/CHANGELOG.

This should be closed with #363

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nmartin84 picture nmartin84  路  3Comments

fkgruber picture fkgruber  路  4Comments

telotortium picture telotortium  路  3Comments

Trevoke picture Trevoke  路  6Comments

oatmealm picture oatmealm  路  4Comments