emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: emacs-orgmode@gnu.org
Subject: [BLOG] #15 [[bbb:OrgMeetup]] on Wed, Jan 8, 19:00 UTC+3
Date: Thu, 30 Jan 2025 18:16:45 +0000	[thread overview]
Message-ID: <87y0ysb20i.fsf@localhost> (raw)
In-Reply-To: <87v7v3vuu4.fsf@localhost>

Dear all,

Below are the meetup notes.

TL;DR: org-drill, debugging errors, spaced repetition, howm (alternative
to org-roam and denote), org-persist (caching library),
org-agenda-prefix-format, setting duration in Org, org-supertag,
feature/igc branch (Emacs), speeding up Org mode loading, big vs. small
Org files.


- As usual, we started from Emacs News
  https://sachachua.com/blog/2025/01/2025-01-06-emacs-news/

- artsi0m shared a problem he experiences with org-drill
  https://gitlab.com/phillord/org-drill/-/issues/55#note_2287352315
  - He is getting an error when running M-x org-drill-cram
    =funcall-interactively: Wrong type argument: symbolp, (oref session cram-mode)=
  - To find out the source of the error, it is useful to get a full backtrace
    - =M-x toggle-debug-on-error= will make Emacs generate a full
      backtrace when any error occur
    - The backtrace will contain the call chain that lead to the error
    - Inside the backtrace buffer, one can press "e" to evaluate
      arbitrary Elisp in the context where the error occurred
    - For example, e session RET will display the value of ~session~
      when the error is raised (and hopefully give some clues how
      ~session~ could have inappropriate value)

- we then moved on discussing org-drill itself and what it does
  https://gitlab.com/phillord/org-drill
  - artsi0m demoed using org-drill to memories various pieces of
    information like standard TCP/IP port names
    - but one can do _a lot more_: https://borretti.me/article/effective-spaced-repetition
  - org-drill implements spaced repetition (similar to Anki), but in Emacs
  - The "flash cards" (with questions and answers) are simply Org headings
    - This makes it trivial to create new cards to learn, in contrast
      with clunky anki electron-based UI
  - also, https://github.com/bohonghuang/org-srs/ and https://github.com/l3kn/org-fc/
  - more about using spaced repetition
    - https://www.lesswrong.com/posts/F6ZTtBXn2cFLmWPdM/seven-years-of-spaced-repetition-software-in-the-classroom-1
    - https://www.coursera.org/learn/learning-how-to-learn

- artsi0m also uses https://github.com/kaorahi/howm note manager
  - howm is a note-taking system that may work with arbitrary text
    files (including, but not limited to Org mode)
  - somewhat similar to https://github.com/protesilaos/denote (but a
    lot more mature)
  - howm has an interesting feature similar to Org's radio targets
    - certain keywords (anywhere in the text) will become links to "target"
    - unlike Org mode, howm makes it work across multiple files
      - (it would be nice to extend Org targets to work across agenda files)
    - howm also allows multiple keywords to point to the same target
      (think of tag aliases)


- dmg asked about Org caching and org-persist in particular
  - org-persist is a library for managing disk caches that Org mode uses
    1. Latex preview caches (on WIP latex preview branch) that stores
       generated images and pre-compiled latex
    2. Org parser caches (~org-element-cache-persistent~) to speed up
       parsing after opening Org files in a new Emacs session
  - In the case of Org parser, the disk cache is mainly useful
    the first time an Org file is opened in a new Emacs session
    - Later, and independently, there is runtime in-memory cache
      (~org-element-use-cache~) that is used by incremental Org parser
  - Among other things, caches speed up agenda generation, but they
    are used in all corners of Org codebase to analyze Org file syntax

- Jake asked about my agenda view that contains the latest note before
  todo keywords:
  : Focused daily agenda
  : Friday     17 January 2025
  :              Org[H]:        [1:11/0:40]+1.0x     NEXT [#A] Weekly review
  : *  9 d. ago  OrgMeetup[T]:  [0:30]     +1.0x     [note about Jake's question] DOING [#A] Ihor Radchenko [ML:Org mode] (2024) #15 [[bbb:OrgMeetup]] on Wed, Jan 8, 19:00 UTC+3 :COMMON:@home:emacsdev::BOOKMARK:misc:email:
  - I do it simply using ~org-agenda-prefix-format~
    - The format consists of mandatory fixed width prefix + optional suffix with the note
    - the fixed prefix makes an illusion that the note is prepended to the heading text, before todo keyword
      - ... but it is instead /appended/ after the prefix
  - config: https://github.com/yantar92/emacs-config/blob/master/config.org#agenda
  - there are other components of the agenda prefix, notably repeater indicators
    - see recent blog post on how to set it up: https://whhone.com/posts/org-agenda-repeated-tasks/

- new-to-org asked about setting duration of agenda tasks
  - there are multiple notions of "duration" in Org mode in general
    and agenda in particular
  - you can use timestamp ranges for appointments
  - you can use effort estimates
  - check out dedicated section of Org mode manual:
    https://orgmode.org/manual/Dates-and-Times.html

- we then had a moment of awkward silence, and turned to Emacs News
  for inspiration
  - There is a new package https://github.com/yibie/org-supertag
  - We reached to README first, but it was a bit too high-level that time to understand
  - [2025-01-18 Sat] Now, a couple of illustrative gifs have been added to the package
    - It looks like the package is an alternative implementation of org-roam (kind of)
      - It provides a notion of "supertag" that is essentially a
        classification of headings:
	- specific "supertag" can be though of as a heading type, like a "book"
	- a "book" is defined by tag + specific set of heading
          properties (like author, title, etc)
	- org-supertag provides something similar to
          ~org-bibtex-create~ (or org-capture) to automate creating
          and populating special heading types with properties
      - it also re-implements certain features of org-edna, but
        focuses on triggers being tag change
	- it does not only provide actions that change headings, but
          also adds custom fontification of the whole heading for
          certain tags
      - it re-implements org-agenda in its own way
      - it re-implements org-ql-search in its own way

- my Emacs crashed (several times), right while screen sharing
  - that was because I am testing scratch/igc ([2025-01-19 Sun] moved
    to feature/igc a few days back) with generational garbage collector
  - https://yhetil.org/emacs-devel/?q=igc
  - https://yhetil.org/emacs-bugs/86cygle696.fsf@gnu.org/T/#t
  - https://yhetil.org/emacs-bugs/86tta5xi0q.fsf@gnu.org/T/#t
  - most likely because I enabled menu bar while screen sharing (which
    I otherwise rarely do)

- Kathink asked whether it is possible to speed up Org mode loading
  inside Org buffers that are known to be noninteractive (opened and
  closed automatically by some Elisp code)
  - we went throgh the code of org-mode major mode definition and
    found out that most of the things there are either
    1. very fast (setting variables)
    2. parser initialization (strictly necessary)
       - I am hoping to make things faster here as well, but that's
         significant (and sometimes breaking) refactoring work (in
         progress)
    3. can be suppressed by setting
       ~org-inhibit-startup-visibility-stuff~ or ~org-inhibit-startup~
       (Karthink knew these two)
    4. can be suppressed by setting ~org-agenda-file-menu-enabled~
       (relatively new setting)
       - this one addresses the problem that creating Emacs menus is
         relatively costly
       - normally, Org mode re-creates a menu entry listing all the
         opened agenda files (by looping over buffers); when _all_ the
         agenda files are opened at once, one by one, this may give a
         significant performance impact (scaling with number of
         buffers opened)
  - another common trick is doing (delay-mode-hooks ...) around the code
    opening Org buffer. Although it is generally not safe, except
    certain very specific scenarios - ~org-mode-hook~ may contain user
    customizations that can affect Org parser (e.g. setting buffer
    category)
  - the problem with disabling parts of Org mode setup (the above
    "inhibit" variables) is that they really disable things
    - as long as the org buffer in question is only used
      programmatically, it does not matter
    - but when the user switches to that org buffer, there might be
      issues
    - karthink suggested that we might somehow postpone visual setup
      only after the buffer is actually displayed
      - for example, via ~window-selection-change-functions~ or similar hooks
      - it might be doable, but I feel that there will be a lot of
        edge cases out there
	- for example, once upon a time I tried to create a somewhat
          similar optimization for initial folding after opening Org buffer:
	  instead of folding immediately, I made folding work like
          font-lock by folding on idle, incrementally
	- this was working quite well in testing, until I ran
          regression tests that revealed that somewhere deep inside
          Org codebase, an implicit assumption is made that folds are
          correctly initialized after loading Org mode. That took a
          while to figure out and that optimization never landed
          upstream, after all.

- Jake asked whether anybody tried to profile loading org-file
  - Yes, of course. And a number of bottlenecks have been addressed
    in the recent Org mode releases

- someone raised the eternal question on whether to use one big Org
  file or many small ones
  - there are pros and cons to both ways
  - at the end, it is up to each user workflow
  - common arguments are listed in a dedicated wiki page
    https://orgmode.org/worg/org-tutorials/org-lookups.html
    - (feel free to add new things to that page - it is a wiki; wee
      https://orgmode.org/worg/worg-about.html on how to contribute)

:chat:
Fellow Jitster
Fellow Jitster says:The latest Emacs News: 
https://sachachua.com/blog/2025/01/2025-01-06-emacs-news/
 
16:58
A
artsi0m
artsi0m says:
https://gitlab.com/phillord/org-drill/-/issues/55#note_2287352315
 
17:03
dmg
dmg says:I have been curious about the features that persist information of org files. I think it is org-persist and seems to be on by default. 
17:05
Fellow Jitster
Fellow Jitster says:(oref OBJ SLOT)

Retrieve the value stored in OBJ in the slot named by SLOT. 
17:11
Fellow Jitster says:so maybe somehow the session does not have a slot `cram-mode` at the time the setq is called? 
17:12
Fellow Jitster
Fellow Jitster says:1. M-x toggle-debug-on-error
2. inside backtrace buffer, you may press "e" to check environment
3. you can "e" session to see what is the value 
17:12
A
artsi0m
artsi0m says:Thanks 
17:12
Christopher Miller
Christopher Miller says:thank you all! i am not able to join for long today, but this has been great. 
17:24
Jared Jennings
Jared Jennings says:artsi0m, in ...163117.txt something tagged "flaschards" not "flashcards" - not sure if this gets in the way of something you are talking about 
17:25
K
karthink
karthink says:Ihor, I have a question for you about programmatic use of (org-mode), will ask in about fifteen minutes as I have to step away for the moment. 
17:25
A
artsi0m
artsi0m says:
https://borretti.me/article/effective-spaced-repetition
 
17:28
me says:
https://kaorahi.github.io/howm/
 
17:28
Jared Jennings
Jared Jennings says:-- that's fine. i just thought if you had some code looking for the "flashcards" tag, it might fail to find that one 
👍
17:29
A
artsi0m
artsi0m says:Thanks 
17:29
Jared Jennings
Jared Jennings says:no problem. thanks to your questions, artsi0m, i now know more than zero about flashcards in org 😄 
17:31
dmg
dmg says:does it mean that things like the agenda run faster? 
17:31
dmg says:thank you. 
17:32
Jake
Jake says:Ihor, your org agenda appears to have information appearing *before* the todo keyword in square brackets. But that doesn't look like org-agenda-prefix-format data, though. What is that? 
17:33
Jake says:Oh, the alignment seemed different than what I would have expected from the prefix. 
17:34
Matthew Page-Lieberman
Matthew Page-Lieberman says:Have to go. Will have to catch up with the previous meeting notes. Happy New Year and blessings to everyone. 
17:35
new-to-org
new-to-org says:How do we duration of agenda tasks? Those that have a definite duration 
17:36
Jake
Jake says:@new-to-org I think that'd be done with the Effort property. 
17:38
me says:
https://github.com/yantar92/emacs-config/blob/master/config.org#agenda
 
17:38
me says:agenda prefix 
17:38
me says:
https://whhone.com/posts/org-agenda-repeated-tasks/
 
17:38
me says:[[info😮rg#Effort Estimates][org#Effort Estimates]] 
17:40
me says:[[info😮rg#Timestamps][org#Timestamps]] 
17:42
new-to-org
new-to-org says:Thank you. I didn't know timestamp could show range duration. 
17:42
K
karthink
karthink says:(Sorry, I need five more minutes before I can speak) 
17:46
Jared Jennings
Jared Jennings says:i was just reading about org-supertag this morning. i have not tried it yet. sounds interesting 
17:46
me says:
https://github.com/yibie/org-supertag
 
17:49
JT
Jeff Trull
Jeff Trull says:Should I be seeing anything on the screen 😃 sorry arrived late 
17:58
Jeff Trull says:nvm I see it now 
17:58
Jared Jennings
Jared Jennings says:"IGC branch?" ... [searches the web] 
👍
18:00
Jake
Jake says:Has anyone run a profiler on loading an org-mode file? That seems like the best way to establish why it's slow for batch processing. 
18:00
Jared Jennings
Jared Jennings says:igc is [something] Garbage Collection 
18:02
Jared Jennings says:(i have only ever run the binary distributions of released versions of emacs) 
18:03
me says:org-agenda-file-menu-enabled 
18:11
Jared Jennings
Jared Jennings says:"Incremental," got it! cool 
18:12
me says:
https://yhetil.org/emacs-devel/?q=igc
 
18:14
me says:wip discussion 
18:14
Jared Jennings
Jared Jennings says:👍 
18:12
me says:
https://sachachua.com/blog/2025/01/2025-01-06-emacs-news/
 
18:14
me says:has links to igc discussions 
18:15
me says:
https://orgmode.org/worg/topics/how-many-files.html
 
18:19
Jared Jennings
Jared Jennings says:i've got to hop out of here. thanks ihor, artsi0m, karthink! i came to lurk, and i learned several things already 
18:35
K
karthink
karthink says:Addendum: I understand that using delay-mode-hooks to speed up opening Org files for (agenda) parsing is a bad idea because hooks can change the semantics of the document, such as via defining TODO keywords.

But if I wanted to advise org-agenda or org-ql to do this, and call run-mode-hooks if/when I actually switch to that buffer interactively, how could I do it?

(All of my org-mode-hooks only run non-semantic changes, like visuals and presentation changes.) 
18:44
me says:
https://orgmode.org/worg/org-tutorials/org-lookups.html
 
18:52
me says:window-selection-change-functions 
19:04
me says:buffer-list-update-hook 
👍 
:end:

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


      reply	other threads:[~2025-01-30 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-29  6:58 #15 [[bbb:OrgMeetup]] on Wed, Jan 8, 19:00 UTC+3 Ihor Radchenko
2025-01-30 18:16 ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y0ysb20i.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).