Code Monkey home page Code Monkey logo

org-roam-utilities's Introduction

org-roam-utilities

Some utilities to use alongside org-roam

org-roam-utilities's People

Contributors

akashpal-21 avatar

Stargazers

AM avatar

Watchers

 avatar

Forkers

dmgerman

org-roam-utilities's Issues

org-roam-directory-name

the value of this binding is the basename of org-roam (e.g. "roam")

the format +org-roam-node-display-template would fail is the that name exists in a previous directory:

assume the org-roam dir is "/Users/dmg/roam/org/roam/"

(if (string-match
     (format "/%s/\\([^/]+\\)/" "roam")
     "/Users/dmg/roam/org/roam/refs/faq_git.org")
    (match-string 1 "/Users/dmg/roam/org/roam/refs/faq_git.org"))

would return org instead of refs

use the full path instead.

cl-loop vs mapcar

cl-loop is a macro, and I suspect that it uses more memory than mapcar. See the following code:

#+begin_src emacs-lisp   :exports both
(cl-loop for row in (list (list 1 2) (list 2 3))
         collect (apply '+ row))
#+end_src

#+RESULTS:
| 3 | 5 |

#+begin_src emacs-lisp   :exports both
(mapcar (lambda (row)
          (apply '+ row)) (list (list 1 2) (list 2 3)))
#+end_src

#+RESULTS:
| 3 | 5 |

I would also avoid append when possible. mutation in general is bad :) and append (in theory) is less efficient than car.

+org-roam-node-list

don't silently remove slots without a mapping

in "cl-remove-if 'null".

raise an error instead. If a column does not exist, it is most likely an error.

join

YOu can write this query:

 "select %s
		  from nodes_view inner join files on nodes_view.file = files.file
		   %s
		   %s;"
		 column-names

as

 "select %s
		  from nodes_view join files using (file)
		   %s
		   %s;"
		 column-names

I find this much more readable. but it is your choice.

don't hard code faces

(propertize (org-roam-node-title node) 'face 'bold))))

would it no better to define a face for this purpose instead of hardcoding it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.