!rUhEinythPhVTdddsb:matrix.org

org-mode

860 Members
org-mode: digital and analog122 Servers

Load older messages


SenderMessageTime
10 Mar 2025
@karthink:matrix.orgkarthink

Thanks Ihor. This library looks pretty involved so I don't think I want to reproduce a worse version of it in my code. I'll just stick to org-element-parse-buffer for now.

On a related note, what is the difference between a greater block and a lesser block according to the Org syntax spec? They seem identical in form and function to me.

03:08:16
@yantar92:matrix.orgyantar92 (Org maintainer)
In reply to @karthink:matrix.org

Thanks Ihor. This library looks pretty involved so I don't think I want to reproduce a worse version of it in my code. I'll just stick to org-element-parse-buffer for now.

On a related note, what is the difference between a greater block and a lesser block according to the Org syntax spec? They seem identical in form and function to me.

The library does more than you need. All you need is the linked function - it combined regexp search with parser
09:26:19
@yantar92:matrix.orgyantar92 (Org maintainer)Lesser blocks cannot contain elements09:26:34
@maka_77x:matrix.orgmaka_77x joined the room.11:28:03
@ricboero:matrix.orgRiccardo joined the room.15:14:57
@xaltsc:matrix.orgxaltsc joined the room.17:22:03
@xaltsc:matrix.orgxaltsc Hey, I'm trying to install karthink and Timothy 's org-mode via nix. Some org functions seem to produce nil (notably, org-babel-src-block-info when I call org-babel-tangle, but not when I call the former via M-:). Do I have a mixed install ? Ive had this issue in the past, but, as far as I can tell, here, builtin org is shadowed by the fork. 17:37:59
11 Mar 2025
@karthink:matrix.orgkarthinkYes but that function seems to require some machinery provided by the rest of the feature, involving hash tables of regexps. At a glance it looks like I'll have to end up replicating a big chunk of it.03:15:01
@yantar92:matrix.orgyantar92 (Org maintainer)
In reply to @karthink:matrix.org
Yes but that function seems to require some machinery provided by the rest of the feature, involving hash tables of regexps. At a glance it looks like I'll have to end up replicating a big chunk of it.
It uses a bunch of simplified regexps to search (approximately) for syntax nodes. They are optional though
05:15:13
@karthink:matrix.orgkarthinkI see05:31:32
@karthink:matrix.orgkarthinkI'll take a closer look at it then05:31:37
@z:freelanguagetools.orgzanyone knows of a good way to not show certain tags in exports? I don't mean to skip the items when exporting, but to just literally not show the tag itself, for things like :attach:15:28:29
@cyborg:tchncs.de@cyborg:tchncs.de removed their display name cyborg.17:23:08
@cyborg:tchncs.de@cyborg:tchncs.de left the room.17:23:21
12 Mar 2025
@trevdev:matrix.orgtrevdev joined the room.05:40:14
@trevdev:matrix.orgtrevdev
In reply to @yantar92:matrix.org
I can see `round` in there. Immidiately suspicious

Hello from the future. Not only have I figured this silly problem out, but it's nearly packaged for anyone else.

This is regarding a clock table and adding up "billable" hours for an invoice. I did indeed have rounding errors, and eliminated them by restructuring the org tables and entries and doing the division/multiplication once per row and summing up the table total with those values. I only end up rounding once.

You probably don't remember this but it's finally an itch I've scratched.

05:47:43
@anonumois:matrix.org@anonumois:matrix.org removed their display name anonumois.15:10:42
@anonumois:matrix.org@anonumois:matrix.org 15:13:01
@zororg:matrix.orgzororgnobody reminded about today's org meetup?17:06:33
@zororg:matrix.orgzororgok... this explains it. https://list.orgmode.org/87ecz3a3he.fsf@localhost/T/#mce9c8dc2bc68401aaab5b3bb476ab44b2906bdee17:08:34
@dadinn:matrix.orgdadinn

I've encountered the following warning/error:

Warning (org-element): org-element--cache: Org parser error in 20250312.org::416663. Resetting.
 The error was: (wrong-type-argument integer-or-marker-p nil)
 Backtrace:
nil
 Please report this to Org mode mailing list (M-x org-submit-bug-report).
22:35:28
@dadinn:matrix.orgdadinnRedacted or Malformed Event22:40:53
@dadinn:matrix.orgdadinnRedacted or Malformed Event22:45:27
@dadinn:matrix.orgdadinnRedacted or Malformed Event22:48:56
@dadinn:matrix.orgdadinnRedacted or Malformed Event22:50:01
@dadinn:matrix.orgdadinn

The code I ran which caused it was this:

  (defun sort-by-timestamp (&optional arg)
    (interactive "P")
    (mark-whole-buffer)
    (org-sort-entries
     nil (if arg ?F ?f)
     (lambda (&optional pos)
       (org-time-string-to-time
        (org-entry-get pos "TIMESTAMP")))
     (function time-less-p))
    ;; Remove extra newlines added between headlines
    (goto-char (point-min))
    (while (re-search-forward "\n\\{2,\\}\\*" nil t)
      (replace-match "\n\n*")))
22:51:33
13 Mar 2025
@dadinn:matrix.orgdadinn

What I ended up doing was to wrap the sort call in a let block, and bound org-element-use-cache to nil.

Seems to have worked.

04:00:56
@dadinn:matrix.orgdadinn Got the clue from here: https://unix.stackexchange.com/questions/250134/pkgproblemresolverresolve-generated-breaks04:00:59
@dadinn:matrix.orgdadinn

How does the element cache work, and what are its main benefits?

I mean in general, I assume that when calling org-sort-entries or org-map-entries to do some heavy lifting then it makes sense to disable it? Or did I overlook something?

04:04:18
@yantar92:matrix.orgyantar92 (Org maintainer)
In reply to @dadinn:matrix.org
The code I ran which caused it was this: ``` (defun sort-by-timestamp (&optional arg) (interactive "P") (mark-whole-buffer) (org-sort-entries nil (if arg ?F ?f) (lambda (&optional pos) (org-time-string-to-time (org-entry-get pos "TIMESTAMP"))) (function time-less-p)) ;; Remove extra newlines added between headlines (goto-char (point-min)) (while (re-search-forward "\n\\{2,\\}\\*" nil t) (replace-match "\n\n*"))) ```
If you can share a reproducer, please report this as a bug
04:44:46

Show newer messages


Back to Room ListRoom Version: 1