forked from mirrors/org-mode
My personal patches-in-progress branch of Org.
See https://git.tecosaur.net/mirrors/org-mode/compare/main..tec/org-mode:dev.
fc80d052db
* lisp/org-element.el (org-element-with-disabled-cache): New macro. (org-element-greater-elements): Add new org-data element. It functions like a virtual headline containing the whole buffer. The org-data properties are like headlie properties, but according to the top-level drawer. org-data's category is the buffer's category as defined by top-level property drawer, #+CATEGORY keyworsd, and the buffer file name. (org-element--cache-element-properties, org-element-set-element): New variable containing properties to be transferred when updating changed element in cache in `org-element-set-element'. (org-element--get-node-properties): Allow parsing node propreties in top-level drawer when new optional argument is passed. Respect PROPERTY+ syntax. (org-element--get-global-node-properties): New function. It returns node properties for top-level property drawer. (org-element-org-data-parser, org-element-org-data-interpreter): Implement the new org-data element. (org-element-headline-parser, org-element-section-parser): Add new :robust-begin and :robust-end properties delimiting safe changes that do not modify headline element. (org-element--list-struct): Fix cache update when adding a headline inside list. (org-element--current-element): Implement cache support. Record parsing mode (:mode) and parsing granularity (:granularity) in the element properties. (org-element-parse-buffer, org-element--next-mode): Support new org-data element. (org-element--parse-elements): Record parsing granularity in the returned tree (org-element-use-cache): Enable cache by default. (org-element-cache-persistent): New variable controlling cache persistance across sessions. Enabled by default. (org-element--cache-self-verify, org-element--cache-self-verify-frequency, org-element--cache-diagnostics, org-element--cache-map-statistics, org-element--cache-map-statistics-threshold, org-element--cache-diagnostics-level, org-element--cache-diagnostics-ring, org-element--cache-diagnostics-ring-size): New variables controlling cache diagnostics and self-diagnostics. Greatly simplifies cache debugging. (org-element--cache, org-element--cache-sync-requests, org-element--cache-sync-timer): Make cache buffer-local by default. (org-element--headline-cache): Implement separate cache storing only headlines and inlinetasks. (org-element--cache-size, org-element--headline-cache-size): New variables containing cache sizes. This is much faster than `avl-tree-size'. (org-element--cache-sync-requests): Update docstring explaning the request list structure. (org-element--cache-sync-keys-value): New variable replacing `org-element--cache-sync-keys' hash table. The hash table was not reliable because it was using elements as keys. Upon any cached element update/shift, the keys were invalidated making cache ordering incorrect and breaking the cache badly. Now, the cache keys are stored as :org-element--cache-sync-key element property and the new variable stores marker value indicating the current sync request cycle. See `org-element--cache-key' for more details. (org-element--cache-change-tic): New variable controlling buffer modification count that is registered in cache. This variable allows catching "stealth" edits. (org-element--cache-non-modifying-commands): New variable listing commands that will not be slown down if we fill cache on the fly. (org-element--request-key, org-element--request-beg, org-element--request-end, org-element--request-offset, org-element--request-parent, org-element--request-phase): New macros. They improve code readability (especially when using nameless-mode). (org-element--format-element, org-element--cache-log-message, org-element--cache-warn): New macros implementing generic logging functionality. (org-element--cache-key): Add section and org-data element support. Change cache key storage from hash map to :org-element--cache-sync-key element property + `org-element--cache-sync-keys-value'. We use the latter to group all the cache keys during a single cache request sequence. Once sync request is fully complete, the `org-element--cache-sync-keys-value' is updated making all the old sync keys obsolete (they will still be store as element properties). (org-element--headline-cache-root): New function returning headline cache root. (org-element--cache-active-p): Prevent cache updates when `inhibit-modification-hooks' is non-nil, unless non-nil optional argument is provided. (org-element--cache-find): Share cache between indirect buffers and the base buffer. We have to do it because after-change hooks for indirect buffer are not called in the base buffer and vice versa. Add support for section and org-data elements. (org-element--cache-put): Implement new approach for cache key storage. Add diagnostics. Indicate cached elements using :cached element property. Support cache size calculation. (org-element--cache-remove): Invalidate parent contents when removing element. Support cache size calculation. Detect cache corruption due to misordered elements. (org-element--cache-shift-positions): Support :robust-begin and :robust-end element properties. (org-element--cache-sync): Add diagnostics. Add detailed comments. Prevent slowdown when large cache chunks need to be deleted forcing O(N) complexity cutoff. In phase 2, fix cases when next request contains deleted cache key. In phase 2, fix scenario when newly inserted element intersects with existing elements in cache. In phase 2, detect obsolete parents removed from cache. (org-element--open-end-p): New function checking if an element can have blank lines right after its :contents-end. (org-element--parse-to): Do not alter match data. Process complex parsing mode changes correctly. Support headlines in cache. Support org-data parsing. Add detailed comments. Add diagnostics. (org-element--cache-sensitive-re): Make list lines sensitive. (org-element--cache-change-warning): Update docstring. Now, the variable can have t, nil, and number values. Numbers are used to provide more details about changed headlines. (org-element--cache-before-change, org-element--cache-after-change): Handle headline hierarchy. Properly handle cache in indirect buffers. (org-element--cache-after-change): Update docstring clarifying the return values. Add special handling for headline and org-data elements updating them in-place instead of removing together with the whole contents when possible. Use :robust-begin/:robust-end element properties to detect robust changes. (org-element--cache-submit-request): Add detailed comments. Correctly handle cache in indirect buffers. Delegate element modifications to `org-element--cache-for-removal'. (org-element--cache-verify-element): New function for cache self-verification. (org-element--cache-persist-before-write, org-element--cache-persist-before-read, org-element--cache-persist-after-read): Implement cache persistance. (org-element-cache-reset): Correctly handle cache in indirect buffers. Support cache persistance. Support new cache size calculation and new cache key schema. (org-element-cache-map): New function analagous to `org-element-map', but much faster. The function overperforms org-ql written by Adam Porter aka alphapapa [1] and reuses some ideas from there (namely, fast element skipping via regexps). [1] https://github.com/alphapapa/org-ql/ (org-element-at-point): The returned elements are now guaranteed to have correct parents up to org-data. New optional argument CACHED-ONLY limits element search to current cache---if element is not in cache and current command is not in cache `org-element--cache-non-modifying-commands', the cache is not updated and the function returns nil. Also, support cache verification. (org-element-at-point-no-context): New function. It is analogous of older `org-element-at-point' with no guarantee that :parent properties are correct beyond direct parent heading. This function does not update cache and can be useful when cache updates should be avoided for performance reasons. * lisp/ob-core.el (org-babel-where-is-src-block-result): Support section and org-data elements in cache. * lisp/org-macro.el (org-macro-replace-all, org-macro--find-keyword-value): Support org-element-cache. * lisp/org-table.el (orgtbl-to-generic): Support org-element-cache. * lisp/org.el (org-mode): Add cache persistance. (org-up-element): Preserve old behaviour when error is returned for section and org-data element. * testing/lisp/test-org-archive.el (test-org-archive/update-status-cookie): Fix test when cache is active. * testing/lisp/test-org-colview.el (test-org-colview/columns-update): Fix test. * testing/lisp/test-org-element.el (test-org-element/extract-element): Add suport for new org-data element. * testing/lisp/test-org-element.el (test-org-element/parent-property): Fix equality check. Parents returned by cache and `org-element-map' may not be `eq' now. Just `equal'. * testing/lisp/test-org-element.el (test-org-element/context): Support section and headline parents. |
||
---|---|---|
doc | ||
etc | ||
lisp | ||
mk | ||
testing | ||
.dir-locals.el | ||
.gitignore | ||
.gitmodules | ||
CONTRIBUTE | ||
COPYING | ||
Makefile | ||
README | ||
README_ELPA | ||
request-assign-future.txt |
-*- mode: org; fill-column:70 -*- This is a distribution of Org, a plain text notes and project planning tool for Emacs. Check the [[https://orgmode.org][homepage of Org]] and the [[https://orgmode.org/org.html#Installation][installations instructions]]. * Contents of this distribution - README :: This file. - COPYING :: The GNU General Public License. - Makefile :: The makefile to compile and install Org. For installation instructions, see [[https://orgmode.org/org.html#Installation][the manual]] or [[https://orgmode.org/worg/dev/org-build-system.html][this more detailed procedure on Worg]]. - mk/ :: Files needed for building Org. - lisp/ :: Directory with all the Emacs Lisp files that make up Org. - doc/ :: The documentation files. org.texi is the source of the documentation, org.html and org.pdf are formatted versions of it. - etc/ :: Files needed for the ODT exporter. - testing/ :: Testing suite for Org. - request-assign-future.txt :: The form that contributors have to sign and get processed with the FSF before contributed changes can be integrated into the Org core. All files in this distribution have copyright assigned to the FSF. * Join the GNU Project Org is part of GNU Emacs and GNU Emacs is part of the GNU Operating System, developed by the GNU Project. If you are the author of an awesome program and want to join us in writing Free (libre) Software, please consider making it an official GNU program and become a GNU Maintainer. Instructions on how to do this are here http://www.gnu.org/help/evaluation Don't have a program to contribute? Look at all the other ways to help: https://www.gnu.org/help/help.html And to learn more about Free (libre) Software in general, please read and share this page: https://gnu.org/philosophy/free-sw.html * License Org-mode is published under [[https://www.gnu.org/licenses/gpl-3.0.html][the GNU GPLv3 license]] or any later version, the same as GNU Emacs. Org-mode is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Org mode. If not, see <https://www.gnu.org/licenses/>.