Any other emacs/org-mode nerds here?

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:

  1. 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
  2. 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
  3. 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?

3 Likes

M-x say-hello,

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.

Welcome to the community!

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

  1. 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.

  2. 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.

  3. I use ~/jdfs to hold all JD IDed directories and corresponding files

  4. 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.

2 Likes

Would you mind sharing your elisp function? I’d love to use this.

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.

1 Like

Thank you so much!

Oooh, interesting, thanks! I am starting to collect my own bits and pieces here: jezcope/org-jd: Integration of Johnny.Decimal standard folder layout with org & org-roam - Codeberg.org

1 Like