reddit / emacs
note-taking without org roam.
a_wylited · 2022-09-17 06:13
So I currently want to take notes with org-mode. However I have tried zettlekatsen types before like roam and I didn't like how I took notes.
I was wondering if there was a way I can setup emacs (specfically i use doom emacs) to work like a notebook and I can change between different notebooks.
Previous notebook-modes I have looked at have not been updated in a fair while or are still a WIP.
LordOfSwines · 2022-09-17 06:37
Can’t you just create a single node per notebook with org-roam? That’s what I do, I have one node per course as well as smaller nodes for other things.
[deleted] · 2022-09-17 06:45
[removed]
MerlinsGreatBeard · 2022-09-17 07:29
How about using projectile? You could use a folder containing a .project file as the home for each notebook.
KeikenHate · 2022-09-17 10:41
Try [denote](https://github.com/protesilaos/denote).
I use it a lot, Im happy with it.
a_wylited · 2022-09-17 11:00
thanks I'll check this out
attento_redaz · 2022-09-17 12:14
I'm probably missing the point but what about just using Org files as notebooks without any zettelkasten-like organization? One of the main target use-cases of vanilla Org is note-taking.
totherme · 2022-09-17 12:15
At it's simplest, you can just open a file per notebook, and type into it.
If you want to capture notes while doing other things, and you know in advance which notebook files you want to be able to capture notes into, you can use [org capture](https://orgmode.org/manual/Capture.html).
You can even capture notes from outside emacs using org capture and [org protocol](https://orgmode.org/manual/Protocols.html).
These are all included with base emacs, and I think ought to work fine with doom. No additional packages needed.
stochastic_forests · 2022-09-17 12:23
I’ve been using org-roam for note-taking over a couple years now, both for my job (research scientist) and self-study (online courses, etc). I’ve found a couple patterns that work well with the system and may fit what you’re looking for:
1. For a course, I’ll generally start with a single main node for the course, allowing easy lookup later. Then each lecture or chapter would have its own headline/node. I also usuall give chapter exercises their own nodes, linked to from The chapter nodes. As new core concepts of interest are introduced, I try to make links to those. This allows me to come back later and take more time to organize my knowledge. Those new concept nodes are also then available to link to other topics later on, helping to further structure knowledge.
2. I make pretty extensive use of org-dailies. I use them most often for random meetings at work, where I can then link the meeting node to project nodes or nodes I have corresponding to people at the meetings. I can then use the backlinks feature to quickly find information on meetings I’ve had around a project or with a specific person.
3. Tags are another way to help organize your notes into categories for quick searching, although I find them generally more useful for broader categories (e.g. math, compsci) than for specific courses
rswgnu · 2022-09-17 14:05
With the Hyperbole package, you can create a directory of Koutlines with each note within a Koutline autonumbered and with a hidden permanent hyperlink. No formatting necessary and trees of notes can be moved just like in Org mode with meta arrow keys. You can then export such files with a single command to html and display them in your browser where the trees are expandable and collapsible.
In the current git tip pre-release of Hyperbole there is a command that does full-text search over your Koutlines and displays matching notes which are also expandable and collapsible. It also works with Org files. No backend, non-lisp database required. Unlike denote, we focus on multiple notes per file/topic, so choose whichever technique you prefer.
Further, we are presently working on additions for note taking and handling to speed things even further.
telenieko · 2022-09-17 14:31
Denote will let you use different directories as completely independent notebooks if you wish.
https://protesilaos.com/emacs/denote#h:15719799-a5ff-4e9a-9f10-4ca03ef8f6c5
bravosierrasierra · 2022-09-17 20:24
plain org files (work.org.gpg, personal.org.gpg, notes.org.gpg) + imenu + hydra org-quick-goto is pretty good solution for 7 years of happiness with notes
search in current file headers: bss/imenu
search in all org file headers: (counsel-org-goto-all)
quick goto to frequent locations: hydra-org-goto/body
```
(setq
org-imenu-depth 5
imenu-auto-rescan t)
;; search in current file headers
(defun bss/imenu ()
(interactive)
(if (eq major-mode 'org-mode)
(counsel-org-goto)
;; (helm-org-in-buffer-headings)
(counsel-imenu)
;; (helm-imenu)
))
;; search in all org file headers
(counsel-org-goto-all)
(with-eval-after-load "hydra"
(defhydra hydra-org-goto (:columns 4 :color red :exit t)
"
Hydras: [_W_/_1_/_<tab>_] Работа [_P_/_2_] Личное [_L_/_3_] Toggle hydra [_N_] Notes hydra
Directories: [_h_] Home [_t_] Te_m_p [_l_] Downloads [_g_] Git [_G_] Git Magnit [_o_] OneDrive [_y_] YandexDisk
Key files: [_e_] emacs.org [_E_] emacs private config [_i_] sn_i_ppets directory [_b_] ~/.bash_profile
"
("a" (switch-to-first-matching-buffer "*Org Agenda") "Org Agenda buffer")
("b" (find-file (expand-file-name "~/.bash_profile")) "~/.bash_profile")
("d" (switch-to-buffer "diary.org.gpg") "diary.org.gpg")
("D" hydra-org-goto-diary/body "Diary hydra")
("e" (find-file (expand-file-name "~/.emacs.d/emacs.org")) "emacs.org")
("E" (org-id-goto "6403c53e-5dc1-4905-93b4-9715be4ec961") "Emacs tasks")
("f" (switch-to-buffer "finances.org.gpg") "finances.org.gpg")
("F" (switch-to-buffer "farm.org.gpg") "farm.org.gpg")
("g" (dired "~/git") "~/git")
("h" (dired "~/") "~/")
("l" (dired "~/downloads") "~/downloads")
("m" (dired "~/temp") "~/temp")
("y" (org-id-goto "B66F0DCE-29C5-4761-952E-6A719113F50F") "Yandex Cloud")
("n" (find-file (expand-file-name "~/notes/org-mode/notes.org")) "notes.org")
("N" hydra-org-goto-notes/body "Notes hydra")
("L" hydra-toggle/body "Toggle hydra")
("<tab>" hydra-org-goto-work/body "Work hydra")
("z" (org-id-goto "d93beec4-7472-4274-870f-c85eb36dcee0") "Personal -> Здоровье")
;; ... <cut>
)
(global-set-key (kbd "s-q") 'hydra-org-goto/body)
)
```
artyhedgehog · 2022-09-18 05:53
Side question: can you direct me to some good guides on how I can turn my .org notes into .org.gpg? What setup do I need? I'm on doom emacs, so there is a chance it's already there, but I would like to make sure - and to get a bit familiar with the concept.
bravosierrasierra · 2022-09-18 14:48
1. i use this manual for create gpg keys and install gpg-agent: https://www.masteringemacs.org/article/keeping-secrets-in-emacs-gnupg-auth-sources
2. Then i use in config: (require 'epa-file) (epa-file-enable)
3. add to all my org.gpg files at top: ;; -\*- epa-file-encrypt-to: ("myemail-from-keyfile@gmail.com") -\*-
and thats all: emacs and org mode works with gpg encryption transparently: autodecrypt/autoencrypt all my .gpg files
deltille · 2022-09-18 15:35
This is partially redundant with other approaches mentioned in the thread (bravosierrasierra's approach looks like it merges both my ideas and adds some hydras on top for good measure), but it's a relatively light, extensible approach so it might suit or at least provide soil for your or someone else's needs. Caveat: I don't use doom emacs, so this might need to be adapted for it, most likely in the keybinds area (which are just suggestions anyway).
If I'm understanding your use of 'notebook' correctly I have a similar workflow to you and made some helper code for this. Dump a few relevant .org files in "~/notes" (or change `d/org-file-root` to where you prefer to keep them) and try something like this:
(setq d/org-file-root "~/notes")
;; you can add an arbitrary number of sources here
;; collectors should return a list of lists like ((name1 target1) (name2 target2) ... )
;; openers should expect lists like the (name1 target1) part
;; order is relevant, higher in list should appear first in suggestions
(setq d/jump/jump-sources
'((buffer d/jump/open/buffer d/jump/collect/buffer)
(org d/jump/open/path d/jump/collect/org)))
(defun d/jump/open/path (x)
(find-file (cadr x)))
(defun d/jump/open/buffer (x)
(switch-to-buffer (cadr x)))
(defun d/jump/collect/buffer ()
(mapcar (lambda (x) (list (buffer-name x) 'buffer x)) (buffer-list)))
(defun d/jump/collect/org ()
(mapcar (lambda (x) (list x 'org (concat "~/notes/" x)))
(directory-files "~/notes" nil ".*.org$")))
(defun d/jump/jump ()
(interactive)
(let* ((targets (mapcan (lambda (x) (funcall (nth 2 x))) d/jump/jump-sources))
(choice (completing-read "Jump: " targets)))
(let ((chosen (alist-get choice targets nil nil #'equal)))
(d/jump/open chosen))))
(global-set-key (kbd "C-'") 'd/jump/jump)
Then hit `C-'` (that's apostrophe, left of enter on US keyboards). Preferably with something like [ivy](https://github.com/abo-abo/swiper) set up so you can see what it's trying to autocomplete for you- it should be suggesting all of your org 'notebooks' in the targeted folder, as well as any buffers you have open.
You might also get use out of this function/choice to bind `C-"` for jumping around inside a given org 'notebook:
(defun d/org/jump ()
(interactive)
(let ((current-prefix-arg '(4))
(org-refile-targets '((nil :maxlevel . 9))))
(call-interactively 'org-refile)))
(global-set-key (kbd "C-\"") 'd/org/jump)
Or you might find the `imenu` approach more agreeable.
deltille · 2022-09-18 15:39
Code block formatting on reddit is four spaces at beginning of each code line, not ```. (It just got me too, had to do a few edits.)
I've never seen an approach to encryption like this, very handy.
ovopax · 2022-09-20 17:54
You could try denote as some others suggest.
I found this, which takes inspiration from zettelkasten like roam but uses plain text and no database, https://github.com/localauthor/zk