kaorahi / howm

note-taking tool on Emacs
GNU General Public License v2.0
90 stars 6 forks source link

How I put my flashcards, newsfeed and even agenda in howm. Questions on how to improve this. #2

Closed artsi0m closed 4 months ago

artsi0m commented 1 year ago

What I did

At first: Thank you for creating this awesome package for emacs!

Link to mailing list was substituted to this GitHub issues page and so I am writing here.

That exact man who wrote Russian guide for howm also have youtube channel and made a video about putting everything into zettelkasten — https://www.youtube.com/watch?v=Bkhlehp1M6o

I have the same ideas before and here what i did:

1. At first I configured howm to use it with org mode

(use-package howm
  :init (setq howm-view-title-header "*")
  :if (string-match-p "kanamori" (system-name)))

I needed this step use with howm packages that initially was written for org, like org-drill https://orgmode.org/worg/org-contrib/org-drill.html

2. Then I wrote functions that will create list of full file names.

I did it for org-drill, elfeed and agenda. I use agenda tag, because for today org-timeblock cannot get time ranges from howm.

(defun my-elfeed-file-names-in-howm ()
  "Return list of absolute filenames of org-elfeed files in howm"
  (delete-dups
   (mapcar #'car (howm-grep "\:elfeed\:"
              (howm-files-in-directory howm-directory)))))

(defun my-org-drill-file-names-in-howm ()
  "Return list of absolute filenames of org-drill files in howm"
  (delete-dups
   (mapcar #'car (howm-grep "\:drill\:"
                (howm-files-in-directory howm-directory)))))

(defun my-org-agenda-file-names-in-howm()
  "Return list of absoulute filenames of files with :agenda: tag in howm"
  (delete-dups
   (mapcar #'car (howm-grep "\:agenda\:" (howm-files-in-directory howm-directory)))))

3. I changed init.el to point some variables to these filenames


(use-package org-drill
  :if (string-match-p "kanamori" (system-name))
  :config (setq org-drill-scope (my-org-drill-file-names-in-howm))
  :after howm)

(use-package elfeed-org
  :if (string-match-p "kanamori" (system-name))
  :ensure t
  :config
  (elfeed-org)
  (setq rmh-elfeed-org-files (my-elfeed-file-names-in-howm))
  :after howm)

(use-package org
  :if (string-match-p "kanamori" (system-name))
  :mode ("\\(\\.txt\\|\\.org\\|\\.howm\\)$" . org-mode)
  :custom
  (org-startup-folded nil)
  (org-agenda-files (my-org-agenda-file-names-in-howm))
  (org-format-latex-options
   '(:foreground default :background default :scale 1.7 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers
         ("begin" "$1" "$" "$$" "\\(" "\\[")))
  (org-todo-keywords
   '((sequence "TODO(1)" "|" "DONE(2)" "FAIL(3)" "NGMI(4)" )))
  :after howm)

End result

Now i can put my flashcards inside my howm directory. There are some benefits in putting flashcards from various sources and topics inside one giant deck: https://borretti.me/article/effective-spaced-repetition#fun

Then only disadvantage I met for today is that sometimes I need to manually update variables like org-drill-scope by evaluating region in init.el or evaluating entire buffer. So there is room for improvement and you can tell me how I can do it better.

That is. Thank you for reading this.

artsi0m commented 1 year ago

Questions

So the question that I want to ask is: What should I do to dynamically update variables like org-drill-scope ? For instance I want to create new list of files with flashcards after executing howm-menu or after finishing new note with :drill: tags in it.

Important notes

I do try to put everything that interest in howm, but I didn't try to learn every single thing in it with flascards. It is just handy to use the same place for flashcards.

Also I wanted to note that I would like to use howm method of scheduling if adding timeranges would be possible. Maybe I should try calfw and calfw-blocks

kaorahi commented 1 year ago

Do you mean something like this?

(defadvice howm-menu (around my-hook activate)
  ad-do-it
  (my-update-org-drill-scope))

(defun my-update-org-drill-scope (...)
  ...)

For time ranges, you might find some hints here (in Japanese). https://howm.osdn.jp/cgi-bin/hiki/hiki.cgi?DateFormat

artsi0m commented 1 year ago

Yes, thank you.

I thought about advices, but never used theme before, because I am an emacs lisp newbie. I will try to use them.

Thank you for sharing this page. I will try to learn something from translation of it.

sirikid commented 1 year ago

Do you mean something like this?

(defadvice howm-menu (around my-hook activate)
  ad-do-it
  (my-update-org-drill-scope))

(defun my-update-org-drill-scope (...)
  ...)

advice.el is an older obsolete API, nadvice.el should be used instead:

(define-advice howm-menu (:after (&rest _args))
  ...)

or

(advice-add 'howm-menu :after #'my-update-org-drill-scope)

(defun my-update-org-drill-scope (...)
  ...)
artsi0m commented 1 year ago

I wrote:

artsi0m commented 11 months ago

image I should note that org-drill package caused bug that hangs emacs and after recovering files I got this. I will try to do something about it, but for now in the middle of the session I will just delete howm markup from first heading.

artsi0m commented 4 months ago

I will close this issue, although I still use howm, but now I also use literate config, so my work-arounds are documented here at emacs-organizer repo. I also moved from org-drill to org-fc. Thanks for howm mode