<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Llm on Janusworx</title><link>https://janusworx.com/tags/llm/</link><description>Recent content in Llm on Janusworx</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>feedback@janusworx.com (Mario Jason Braganza)</managingEditor><webMaster>feedback@janusworx.com (Mario Jason Braganza)</webMaster><copyright>© 2026, Mario Jason Braganza</copyright><lastBuildDate>Sun, 26 May 2024 16:03:01 +0530</lastBuildDate><atom:link href="https://janusworx.com/tags/llm/index.xml" rel="self" type="application/rss+xml"/><item><title>Ignoring Syncthing Conflict Files in the Org Agenda Folder</title><link>https://janusworx.com/work/ignoring-syncthing-conflict-files-in-org-agenda-folder/</link><pubDate>Sun, 26 May 2024 16:03:01 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/ignoring-syncthing-conflict-files-in-org-agenda-folder/</guid><description>&lt;p&gt;Now that I have &lt;a href="https://janusworx.com/blog/org-mode-clocking-in-and-out-of-tasks-on-task-state-changes/" &gt;the power of large language models&lt;/a&gt;, in the palm of my hand …&lt;br&gt;
&lt;br&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2024/he-man-i-have-the-power.gif" alt="" /&gt;
 
 
 &lt;/figure&gt;&lt;/p&gt;
&lt;figcaption style="font-style: italic; text-align: center; font-size: 85%; color: var(--secondary)"&gt;
&lt;p&gt;You just had to be there, to really appreciate this 😂&lt;br&gt;
Image, courtesy user &lt;a href="https://makeagif.com/i/Mz4AjF" target="_blank" rel="noreferrer"&gt;straiven on makeagif&lt;/a&gt;&lt;/p&gt;
&lt;/figcaption&gt;
&lt;p&gt;&lt;hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;'/&gt;

I decided to see, if it could help me solve one of my real pain points with Org Mode.&lt;br&gt;
I had asked for help &lt;a href="https://toots.dgplug.org/@jason/112483224007964606" target="_blank" rel="noreferrer"&gt;over on the fediverse&lt;/a&gt;, after months of trial and error, on just how to fix this.&lt;br&gt;
The issue being, I needed a way to tell my Org Agenda, to ignore files with a certain pattern.&lt;/p&gt;
&lt;p&gt;I have a folder (called &lt;code&gt;syncbox&lt;/code&gt;) full of files, that Org Mode looks at to generate the agenda for me.&lt;br&gt;
Now these files are also synced via &lt;a href="https://syncthing.net/" target="_blank" rel="noreferrer"&gt;Syncthing&lt;/a&gt; over to my phone, where another program called &lt;a href="https://www.beorgapp.com/" target="_blank" rel="noreferrer"&gt;Beorg&lt;/a&gt; looks at them too and shows them as entries in my calendar, so that I don’t miss the really important things I need to do.&lt;/p&gt;
&lt;p&gt;Functionally, all is well with this setup, except for one teensy thing.&lt;br&gt;
Every once in a while, when certain files are in use on both, my desktop and my phone, Syncthing will create conflicting copies of said files in use.&lt;br&gt;
This happens most often, with my &lt;code&gt;tasks.org&lt;/code&gt; file.&lt;br&gt;
Once it conflicts, my &lt;code&gt;syncbox&lt;/code&gt; gets full with files like,&lt;br&gt;
&lt;code&gt;tasks.sync-conflict-20240408-041556-2TQWENY.org&lt;/code&gt; and&lt;br&gt;
&lt;code&gt;tasks.sync-conflict-20240516-101335-2TQWENY.org&lt;/code&gt; and&lt;br&gt;
&lt;code&gt;tasks.sync-conflict-20240520-053451-2TQWENY.org&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;What happens &lt;em&gt;then,&lt;/em&gt; is that Org Agenda happily reads those files too, and I end up with lots of duplicated tasks.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;As usual, tackling it by writing lisp, was an idea fraught with terror for me. I tried quite a bit and failed.&lt;br&gt;
My next plan of attack was that Org Agenda had a regex&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;, that it would process. My regex is better than my lisp, but even that was to no avail.&lt;br&gt;
Emacs regex does not support lookaheads / lookbehinds and I did not want to have some complicated pattern, that even I would not recognise, a few months down the line.&lt;br&gt;
In the meanwhile, Ihor told me to stop faffing about and &lt;a href="https://emacs.ch/@yantar92/112484511603174787" target="_blank" rel="noreferrer"&gt;just write&lt;/a&gt; a function&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;So I asked Claude to go do the work for me and I ended up with …&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-emacs-lisp" data-lang="emacs-lisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;mjb/set-org-agenda-files-from-syncbox-directory&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Set &lt;/span&gt;&lt;span class="ss"&gt;`org-agenda-files&amp;#39;&lt;/span&gt;&lt;span class="s"&gt; to all Org files in the &amp;#39;syncbox&amp;#39; directory, excluding files with &amp;#39;.sync-conflict&amp;#39; in the name.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;syncbox-dir&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expand-file-name&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;syncbox&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;my-org-directory&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;when&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;file-directory-p&lt;/span&gt; &lt;span class="nv"&gt;syncbox-dir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq&lt;/span&gt; &lt;span class="nv"&gt;org-agenda-files&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;mapcar&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;expand-file-name&lt;/span&gt; &lt;span class="nv"&gt;file&lt;/span&gt; &lt;span class="nv"&gt;syncbox-dir&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;seq-filter&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;not&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;string-match-p&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\\.sync-conflict&amp;#34;&lt;/span&gt; &lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;directory-files&lt;/span&gt; &lt;span class="nv"&gt;syncbox-dir&lt;/span&gt; &lt;span class="no"&gt;t&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;\.org$&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)))))))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;mjb/set-org-agenda-files-from-syncbox-directory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which I dutifully dumped into my &lt;code&gt;init&lt;/code&gt; file.&lt;br&gt;
And that did the trick!&lt;/p&gt;
&lt;p&gt;What did strike me, is that now that I am using this approach, my chicken and egg struggle is finally at an end. I don’t have to struggle to learn lisp to hack emacs which needs me to learn lisp.&lt;br&gt;
I realise it takes only a short time of dedicated effort. But right now, it is time I don’t have, and don’t know when I’ll get.&lt;br&gt;
So the new fangled LLM AIs can help me sort my Emacs pain points and I can learn Lisp at leisure.&lt;br&gt;
And I’ll use, &lt;a href="https://framapiaf.org/@vindarel" target="_blank" rel="noreferrer"&gt;friend on the fediverse&lt;/a&gt;, Vincent Dardel’s &lt;a href="https://www.udemy.com/course/common-lisp-programming/?couponCode=NVDPRODIN35" target="_blank" rel="noreferrer"&gt;excellent course to do just that&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;'/&gt;

Feedback on this post? Mail me at &lt;a href="mailto:&amp;amp;#102;&amp;amp;%23101;&amp;amp;%23101;&amp;amp;%23100;&amp;amp;%2398;&amp;amp;%2397;&amp;amp;%2399;&amp;amp;%23107;&amp;amp;%2364;&amp;amp;%23106;&amp;amp;%2397;&amp;amp;%23110;&amp;amp;%23117;&amp;amp;%23115;&amp;amp;%23119;&amp;amp;%23111;&amp;amp;%23114;&amp;amp;%23120;&amp;amp;%2346;&amp;amp;%2399;&amp;amp;%23111;&amp;amp;%23109;" &gt;feedback at this domain&lt;/a&gt;
&lt;br&gt;

&lt;br&gt;

P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list!&lt;/a&gt;&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit.&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;It drove me nuts in the beginning, when I did not know what was happening. I was like, I /just/ finished this task. And it’s popping up again?! Is my computer haunted?&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;defined in &lt;code&gt;org-agenda-file-regexp&lt;/code&gt; with a default value of &lt;code&gt;&amp;quot;\\`[^.].*\\.org\\'&amp;quot;&lt;/code&gt;&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;He did not quite put it that way. He was much kinder, obviously :)&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item></channel></rss>