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.

2 Likes

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

2 Likes

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 appreciate the consideration, thank you. Perhaps @TheMadCodger would share their email address in a DM and you could send it to them directly?

May I have a copy as well? I’m building the new site now and will make sure it can generate these files. hello@johnnydecimal.com

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.

Gimme a couple of weeks and hopefully I’ll have a fully featured generator up. We’re pretty close.

1 Like

I have emailed the org file template to Johnny on 25th ish @johnnydecimal pls let me know if you haven’t received it.

1 Like

For completeness: I converted the standard markdown files to org-mode using the wonderful pandoc.

1 Like

Before I recreate the wheel, what did that look like for you? I just downloaded the Official :trade_mark: Johnny Decimal org file which is one large tree from 00­–15, whereas in Obsidian, there’s one markdown file per number. Converting from md to org is simple enough with pandoc, but any suggestions on encorporating that into the org tree?

If people want to give me samples of other org layouts I’ll be happy to build them into the downloader. Not being a user myself I had a sample size of 1 and that’s what I replicated.