-
Notifications
You must be signed in to change notification settings - Fork 131
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
feat: Now cross-posting links to other page bundle subtrees works + minor performance tweaks in buffer pre processing #593
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also add a new optional arg `inherit-export-file-name`.
kaushalmodi
force-pushed
the
link-bundles
branch
from
March 17, 2022 04:13
f34b52c
to
6600b7e
Compare
This doesn't change anything with the tests. But it doesn't hurt to pass the correct value.
Note: As of today, the Org stable or bugfix version's (9.5.2) `org-element-at-point' returns the Org element at point *but* without any of the inherited properties!! So `org-element-map' is used where property inheritance needs to be tested (because that does do the prop inheritance as expected!). This issue doesn't exist in the `main' branch version of `org-element-at-point'.
kaushalmodi
force-pushed
the
link-bundles
branch
from
March 17, 2022 05:46
6600b7e
to
3299cfa
Compare
Also restore blank lines in a docstring.
kaushalmodi
force-pushed
the
link-bundles
branch
from
March 17, 2022 06:00
b94d106
to
9c43bc8
Compare
Hugo `relref` does not use the `slug` front-matter. So even if a post "abc.md" has a slug "xyz", `{{< relref "xyz" >}}` will fail. We will still need to use `{{< relref "abc" >}}`.
Ref: https://lists.gnu.org/r/emacs-orgmode/2021-12/msg00474.html "It is slightly more optimal to make your lambdas in org-element-map return nil. org-element-map allocates an extra list collecting all non-nil return values. If your lambda always returns nil, that list will not have to be created." - Ihor Radchenko
Ref: https://lists.gnu.org/r/emacs-orgmode/2021-12/msg00474.html "You call org-element-map twice making Org loop over the whole AST twice." - Ihor Radchenko
kaushalmodi
changed the title
feat: Now cross-posting links to other page bundle subtrees works
feat: Now cross-posting links to other page bundle subtrees works + minor performance tweaks in buffer pre processing
Mar 17, 2022
kaushalmodi
force-pushed
the
link-bundles
branch
from
March 17, 2022 17:54
d4f1eac
to
ef6d9ce
Compare
Earlier: - It worked i.e. searched heading strings to the correct subtree, but only if the searched-in Org buffer was already open. - It failed to work if the Org file was yet to be opened. The `(org-mode)` call in this commit sets the major mode and fixes that issue. The other variables like `org-mode-hook`, etc. are set to speed this up.
kaushalmodi
force-pushed
the
link-bundles
branch
from
March 17, 2022 18:37
ef6d9ce
to
f6b32ad
Compare
In Org 9.5 and older versions, `org-element-at-point` returns an Org element *without* the properties inherited from its parent headings e.g. EXPORT_HUGO_BUNDLE. In Org 9.6+ (main branch as of 2022-03-17), the returned element has the inherited properties. In this commit a `org-hugo--search-prop-in-parents` function is added that allows searching for the specified property in parent headings.
Also wrap the fn in org-with-wide-buffer so that the point and narrowing are preserved.
This now works!!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #389.