icsorg icon indicating copy to clipboard operation
icsorg copied to clipboard

Allow any tag?

Open rickswe opened this issue 2 years ago • 3 comments

Hello, thanks for this wonderful package.

Have you considered allowing anything instead of being limited to a few tags? I need to add the property tag.

FILETAGS=EVENT
PAST=30
FUTURE=365

PROPERTY="agenda-group something"

Then I would have:

#+PROPERTY: agenda-group something

rickswe avatar Mar 30 '23 02:03 rickswe

No I hadn't considered it, but not against the idea.

Right now, due to issues outside my control, I cannot implement these changes. However, as soon as I can, I will put something together an let you know so you can see if it addresses your use case.

theophilusx avatar Apr 03 '23 21:04 theophilusx

I think it's just a matter of looping everything in the config. For now I did this.

--- bk-index.js	2023-04-02 22:42:30.022364216 -0500
+++ index.js	2023-04-02 22:47:55.918359677 -0500
@@ -187,6 +187,7 @@
 function dumpEvent(e, rs) {
   rs.push(`* ${e.summary}\n`);
   rs.push(":PROPERTIES:\n");
+  rs.push(":PLACEHOLDER:    ph\n");
   rs.push(":ICAL_EVENT:    t\n");
   rs.push(`:ID:            ${e.uid}\n`);
   e.organizer
@@ -311,6 +312,7 @@
     `#+CATEGORY:    ${config.CATEGORY}\n`,
     `#+STARTUP:     ${config.STARTUP}\n`,
     `#+FILETAGS:    ${config.FILETAGS}\n`,
+    `#+PROPERTY:    ${config.PROPERTY}\n`,
     "\n",
   ];
 
@@ -378,6 +380,7 @@
       CATEGORY: process.env.CATEGORY,
       STARTUP: process.env.STARTUP,
       FILETAGS: process.env.FILETAGS,
+      PROPERTY: process.env.PROPERTY,
       PAST: 7,
       FUTURE: 365,
     };

Thanks

rickswe avatar Apr 08 '23 23:04 rickswe

Just revisiting th8is now and I don't think your solution is quite correct. If you want to allow for arbitrary additonal properties, we need a way to put those properties into the config file such that you have a property name and a property value i.e.

:NAME: val

is ok but

#+PRO0PRTY: NAME val

is not as this is how file wide/buffer properties are specified and what we want here is really drawer/event properties.

The real problem here is that the config file, which is really just a key=val env file, isn't sophisticated enough to handle your simple need. We cannot just doe PROP=val because not all the lines in the file are properties. We could perhaps do something like

PROP:NAME=val

which would end up being

:NAME: val

in teh property draw of each event, but that does add additonal complexity/code to be maintained and to be honest, I'm not sure there is the demand to justify it. At this stage, I'm reluctant to add this additional functionality unless there are others who require it.

theophilusx avatar Sep 18 '25 00:09 theophilusx