ahyatt / ekg

The emacs knowledge graph, app for notes and structured data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More user options for Inline Tags

qingshuizheng opened this issue · comments

I haven't really looked into the code of inline-tags yet, some unwanted inline-tags is starting to bugging me already. They are collected quite unexpectedly (see screenshot 1) and I am expecting more to come.

There are 3 solutions I can think of:

  1. Add a user option to turn it off completely.
  2. Add a customizable predicate. For example, the user could stop inline-tags from being collected by checking if cursor is within a source block org-in-src-block-p, if t, don't collect this part.
  3. A MAGIC TAG could help. Say, tag the note with "inline-tags:no", then inline-tags won't be collected in the current note.
------
Tags: date/2024-01-22
Title: Test Note
------

#+begin_src emacs-lisp
(setq builtin-bitmaps '((question-mark [#x3c #x7e #xc3 #xc3 #x0c #x1 #x8])))
#+end_src

(setq builtin-bitmaps '((question-mark [#x2c #x6e #x12 #xd4 #x2d #y1 #ax])))

NOTE: these bitmaps are typed in here randomly. Don't use them to set your bitmaps.

image

Another issue is, if you open a trashed note with inline-tags, then close it with "C-c C-c", the note will be tagged with a mix trashed tags and non-trashed tags (see screenshot 2). This trashed note cannot be deleted by ekg-notes-trash any more, and this note will appear both in the regular notes buffer (e.g.,latest-modified-notes) and the trashed notes buffer.

-------
Tags: date/2024-01-24
Title: Test Note
-------
This note could not be completely deleted by `ekg-notes-trash`.
Here's the inline-tag #x2c

image
image

BTW, I find another brainless typo in the following line, could you hot fix it: "latest created" -> "latest captured" ?

ekg/ekg.el

Line 1607 in e139a33

(rx (or "latest modified" "latest created"))

Thanks for noting this (especially before the release). It's a serious problem. I think a variable to disable making automatic tags on save is a good thing. We can maybe also detect whether we are in an org-mode block, in which case nothing should be done. Or, perhaps we can change the way tags are written to be less common, perhaps merging with the inline command logic. I'll consider all these things and fix this.

I've added a few fixes that should resolve this (mostly). Please try it out and see how it works for you.

This works well. Will report back if there are more caveats.
Thanks for the fix!