Iβm setting up my life admin and small business systems in parallel, and since I already use emacs and org-roam for my notes it made sense to use that for a jdex too. So far I have:
Converted the markdown JDex files from the templates to org and reorganised them to have a top level #+title: and :ID: for org-roam to index
Pushed each JDex file to be 00index.org in the appropriate category folder, so I can quickly navigate to that with org-roam and then find-file will start in the category by default
Started using marginalia annotations to display system, area & category in org-roam-node-find completions buffer
What other emacs tips & tricks have you got for me?
I have been using org-mode and org-roam for a while and recently started using JD system.
I am stoked by how convenient its to have an org file that acts as an index and jump to a JD directory from there. I will share my structure a little bit later.
But there is one annyoyance that i have run into β¦ Started to use βspaceβ in the directory names since migrating to JD. When i store the directory path in an org file with full path, the letters group around β/β. For now I have worked around this by using a minor mode that visually replaces / with β > '.
This is just fresh in my memory because i worked on it yesterday. But overall feel more in control.
A favorite Emacs hack of mine is using the equivalent of cdj in Emacs. I have mapped it to C-c j d, which asks for AC.ID and opens that directory in dired mode for browsing. Super-useful for directories you visit often.
Here I am back again with more details. I will take this opportunity to capture how I have setup JD system using the Emacs org-mode.
My legacy system before JD
|------------+----------------------------------------------------------------------------------|
| ~/orgs | legacy has different org files for different aspects e.g. home.org work.org etc, |
| ~/orgsroam | legacy knowledge system |
| ~/orgzly | has orgs file which syncs with mobile |
|------------+----------------------------------------------------------------------------------|
What I did
Decided to leave my existing system as is i.e. they will be agnostic of JD system, in case I had to fallback. But JD system will be aware of my existing system if required.
Decided to go with one monolithic JDEX i.e. I took all the *.md file in the flat layout and scrunched into one big 00.00 - JDEX.org. Each directory level is a heading and sub-directories are sub-headings. Refer: One jdex file in Emacs org-mode. I placed this outside of JD file system under ~/orgzly/ so that it syncs to my mobile and is available to me on the go on my phone also.
I use ~/jdfs to hold all JD IDed directories and corresponding files
I have also moved 10.02 Life Projects and Tasks Management.org to ~/orgzly/
Legacy Orgs
I am slowly migrating my legacy ~/orgs/*.orgs to 10.02 Project and Tasks Management.org without distrubing my day to day tasks.
Orgs Roam
I considered using this for JD system with but it already has many titles which start a numbering scheme AB.CD which is unrealted to JD. So I cannot introduce AC.ID numbers here as it will clash with existing reference numbers . I will keep using the orgs roam as a separate system. Ofcourse 00.00 - JDEX.org will have references to it when required.
My current system
|------------+ββββββββββββββββββββββββββββββββββββ|
| ~/orgs | slowly migrating to JD or 10.02-Projects-and-Tasks.org under ~/orgzly |
| ~/orgsroam | continue to use this knowledge system |
| ~/orgzly | syncs to mobile, contains: 00.00-JDEX.org, 10.02-Project and Tasks.org |
| ~/jdfs | JD file system |
|------------+ββββββββββββββββββββββββββββββββββββ|
Tricks
A trick if i may call that is to define my-jdsys-open-dir elisp function which will ask for AC.ID and open the directory location in dired mode within emacs. And bind this function call to keys C-c j d. This was inspired by the cdj bash function under tools. I use this quite often.
To consider
Only thing I would do differently is not use spaces in the file and directory names. I have worked around the my annoyance as I mentioned in my previous post.
Sure, iIhave it as a local package in ~/t/my_jdsys.el
;;; my-jdsys.el --- JDFS helpers -*- lexical-binding: t; -*-
;; Simple helpers to jump around ~/jdfs/*/*/ab.cd*
;; (c) you β MIT
;;; Commentary:
;; M-x my-jdsys-open-dir β prompt for ab.cd β open matching directory.
;;; Code:
(defgroup my-jdsys nil
"JDFS helpers."
:group 'convenience)
(defcustom my-jdsys-root (expand-file-name "~/jdfs")
"Root directory for JDFS."
:type 'directory
:group 'my-jdsys)
(defcustom my-jdsys-thing-regex "[0-9]+\\.[0-9]+"
"Regex used to grab a default decimal like ab.cd at point."
:type 'regexp
:group 'my-jdsys)
(defun my-jdsys--default-decimal ()
"Return ab.cd at point if it looks like a decimal, else empty string."
(save-excursion
(when (thing-at-point-looking-at my-jdsys-thing-regex)
(match-string 0))))
;;;###autoload
(defun my-jdsys-open-dir (decimal)
"Open directory under `~/jdfs/*/*/` matching DECIMAL (e.g., ab.cd)."
(interactive
(list (read-string "Enter decimal (ab.cd): " (or (my-jdsys--default-decimal) ""))))
(let* ((pattern (expand-file-name (format "*/*/%s*" decimal) my-jdsys-root))
(matches (seq-filter #'file-directory-p (file-expand-wildcards pattern))))
(cond
((null matches)
(user-error "No directory match for %s (pattern: %s)" decimal pattern))
((= (length matches) 1)
(dired (car matches)))
(t
(dired (completing-read "Choose directory: " matches nil t))))))
(provide 'my-jdsys)
;;; my-jdsys.el ends here
From the init.el I use-package the like this:
;; Make sure the folder containing my-jdsys.el is on your load-path:
(use-package my-jdsys
:load-path "~/t/elisp/"
:ensure nil
:commands (my-jdsys-open-dir)
:init
;; Define the prefix map FIRST, so :bind :map has something to attach to.
(define-prefix-command 'my-jdsys-map)
(keymap-global-set "C-c j" 'my-jdsys-map)
:bind
(:map my-jdsys-map
("d" . my-jdsys-open-dir)))
Also you can also place the cursor on the AC.ID anywhere in the file while invoking the function and you will have that value populated as default.
Do you happen to have a template of your jdex.org file so as to not recreate the wheel? Also possibly so @johnnydecimal could add it to the auto configuration tool?
I do have it (and could easily find it because of the JD system ) β¦ however I am concerned about sharing that file in this public forum, as it might bypass the purchase requirement and affect Johnnyβs business model. @johnnydecimal any suggestions on how to securely share a single jdex file with other paid users and not affect your business ?
Iβm m fine with dmβing my email, but if @bbud shares it with you @johnnydecimal, Iβm fine waiting until youβve got the official version up in the configurator.