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

Any hint to exclude a specific keyword? #250

Open
rbenit68 opened this issue Aug 8, 2024 · 4 comments
Open

Any hint to exclude a specific keyword? #250

rbenit68 opened this issue Aug 8, 2024 · 4 comments

Comments

@rbenit68
Copy link

rbenit68 commented Aug 8, 2024

The following statement

#+transclude: [[file:path/to/file.org]] :exclude-elements "keyword"

excludes all these elements:

(babel-call center-block clock comment comment-block diary-sexp drawer dynamic-block example-block export-block fixed-width footnote-definition headline horizontal-rule inlinetask item keyword latex-environment node-property paragraph plain-list planning property-drawer quote-block section special-block src-block table table-row verse-block)

I think it should be an implementation to exclude specific elements or keywords.

Thanks.

@nobiot
Copy link
Owner

nobiot commented Aug 9, 2024

Please refer to this part of the manual:

‘:exclude-elements’
This property lets you add elements to exclude per transclusion on top of the variable org-transclusion-exclude-elements defines. You cannot remove the ones defined by it; thus, it is intended that you use the customizable variable as your global default and fine-tune it by the property per transclusion.

@rbenit68
Copy link
Author

rbenit68 commented Aug 9, 2024

Thank you.

The issue is that keyword, in excluding context, means

  '("ARCHIVE:" "AUTHOR:" "BIBLIOGRAPHY:" "BIND:" "CATEGORY:" "CITE_EXPORT:"
    "COLUMNS:" "CREATOR:" "DATE:" "DESCRIPTION:" "DRAWERS:" "EMAIL:"
    "EXCLUDE_TAGS:" "FILETAGS:" "INCLUDE:" "INDEX:" "KEYWORDS:" "LANGUAGE:"
    "MACRO:" "OPTIONS:" "PROPERTY:" "PRINT_BIBLIOGRAPHY" "PRIORITIES:"
    "SELECT_TAGS:" "SEQ_TODO:" "SETUPFILE:" "STARTUP:" "TAGS:" "TITLE:" "TODO:"
    "TYP_TODO:" "SELECT_TAGS:" "EXCLUDE_TAGS:" "EXPORT_FILE_NAME:"))

everything at once.

So, the question is: how can I exclude title: but not date:, for example?.

@nobiot
Copy link
Owner

nobiot commented Aug 10, 2024

This is not implemented in Org-transclusion. I don’t have a use case for it. What is yours?

As you ask for a “hint”, you can look at lines around here. You could look to override the function org-transclusion-content-filter-org-exclude-elements with your own implementation.

If you want to specify which keyword to be excluded per transclusion, you would also need to devise a way to pass those to be excluded as a value. There is a mechanism to let you do this but I am on vacation without my computer with me. It’s a little hard to give you more specific guidance on my phone…

@rbenit68
Copy link
Author

Thank you, Nobiot

This is not implemented in Org-transclusion. I don’t have a use case for it. What is yours?

I have to share transcluded sources, and in ocassions, my collegues do not want/need too many keywords like title, date, todo, ...

I will try with org-transclusion-content-filter-org-exclude-elements as you mention.

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