Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom preset tags not adding fields correctly #14

Open
PlasmaShift opened this issue Jan 24, 2025 · 4 comments
Open

Custom preset tags not adding fields correctly #14

PlasmaShift opened this issue Jan 24, 2025 · 4 comments

Comments

@PlasmaShift
Copy link

PlasmaShift commented Jan 24, 2025

I am trying to make a preset with code
When I run org-supertag-tag-add-tag "book" then org-supertag-tag-set-field-and-value after I get an uncostomized filed list
I see 3 possibilities
1 This is a bug
2 My code setting the variable is wrong
3 My understanding of what this does "also probably the code is wrong
I imagine when I run org-supertag-tag-set-field-and-value it should present the options from the code below
What is the difference between preset book and preset _book ?
Where is the state for this saved if any, example databases so I can test this in a blank file and state
side note any better :type for what I am using for example for rating using a number range?

(setopt org-supertag-preset-tags
	'(("book" . ((:name "reading"
    		            :type options 
    			    :options ("reading" "current" "want" "" "no")
    			    :description "Reading status")
                     (:name "status"
    			    :type options
    			    :options ("yes" "ongoing" "single" "unknown")
    			    :description "Is the books series completed")
                     (:name "books"
    			    :type number
    			    :description "Book Series Number I am on")
                     (:name "totalnumber"
    			    :type number
    			    :description "Totla books in series")
                     (:name "updated"
    			    :type date
    			    :description "Updated date")
                     (:name "rating"
    			    :type number
    			    :description "Rating")
                     (:name "author"
    			    :type string
    			    :description "Author")
                     (:name "series"
    			    :type string
    			    :description "Book Series")
    		     ))))

Image

@yibie
Copy link
Owner

yibie commented Jan 24, 2025

You can check ~/.emacs.d/org-supertag/supertag-db.el to see the data records about tags inside.

side note any better :type for what I am using for example for rating using a number range?

What specifically is being discussed here? Is it about adding data types or something else?

I want to know if this is a conflict between preset tags and directly set tags. Can you tell me what you did and then discovered the error? Because I can't figure out what your issue is.

Maybe this will help you: https://github.com/yibie/org-supertag/wiki/Advance-Usage-%E2%80%90-Custom-Preset-Tag

@yibie
Copy link
Owner

yibie commented Jan 24, 2025

Ok,I'm sure this is a bug.

@PlasmaShift
Copy link
Author

I imagine tog preset "book" fields should be pre populated based on the code above but it is not, for example I have no author field unless I create it outside of code. Then because I initially put in the wrong options and didn't know where org-supertags saved state made it left me not knowing how to get my preset tag set right. Thanks for looking at this and for the nice project 😃

@PlasmaShift PlasmaShift changed the title Cosrom preset tags not adding fields correctly Custom preset tags not adding fields correctly Jan 24, 2025
@yibie
Copy link
Owner

yibie commented Jan 25, 2025

You don't need to preset tags; you can directly use org-supertag-set-field-and-value to define the fields that the book tag needs to carry.

The misunderstanding on your part is due to my explanation of the supertag concept not being very clear yet.

You can think of supertag as a Swiss Army knife:

  • It is a template: it carries multiple predefined fields (as long as you have defined them), and automatically forms a template without the need for additional presets;
  • It is a switch: By attaching behavior to the supertag, you can perform other operations on the org-headline that has already been converted into a node (you can refer to the files org-supertag-behavior-library.el and org-supertag-custom-behavior.el for more information).
  • It is a timer: performs certain operations on the node at set cycle times or at a specific moment in the future

Currently, I am deeply using org-supertag to eliminate the complexity in interaction and conceptual cognition caused by the diversity of features.

I really hope to hear your feedback after I explain.

And setting preset tag not adding fields correctly is a bug, I will check it out later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants