Commit Graph

25124 Commits

Author SHA1 Message Date
Ihor Radchenko 3da1b2d240
org-fold-core: Fix fontification inside folded regions
* lisp/org-fold-core.el (org-fold-core-initialize): Declare
`org-fold-core-fontified' text property for font-lock.
(org-fold-core--force-fontification): New variable controlling forced
fontification inside folded regions.
(org-fold-core-fontify-region): Fix cases when BEG is inside folded
region.  Respect `org-fold-core--force-fontification'.
* lisp/org-macs.el (org-with-forced-fontification): New macro.
(org-buffer-substring-fontified):
(org-looking-at-fontified): Do not rely on jit-lock.  Use
`org-fold-core-fontified' text property to determine whether text is
already fontified.
2022-04-25 19:40:09 +08:00
Ihor Radchenko 0bca8bc418
org-fold-show-set-visibility: Fix edge case when folded region is at BOB 2022-04-25 19:40:09 +08:00
Ihor Radchenko 0daa209a74
org-string-width: Work around `window-pixel-width' bug in old Emacs 2022-04-25 19:40:08 +08:00
Ihor Radchenko 2e3566e1e9
org-string-width: Handle undefined behaviour in older Emacs
* lisp/org-macs.el (org-string-width): Force older Emacs treating
invisible text with ellipsis as zero-width.  Newer Emacs versions do
exactly this.
2022-04-25 19:40:07 +08:00
Ihor Radchenko 3fba34900e
Fix org-fold--hide-drawers--overlays 2022-04-25 19:40:06 +08:00
Anders Johansson f813f10818
Rename remaining org-force-cycle-archived → org-cycle-force-archived 2022-04-25 19:40:06 +08:00
Anders Johansson baffebbc33
Fix bug in org-get-heading
Fixes #26, where fontification could make the matching and extraction of heading
components fail.
2022-04-25 19:40:05 +08:00
Anders Johansson 240a14988f
Fix typo: delete-duplicates → delete-dups 2022-04-25 19:40:04 +08:00
Ihor Radchenko 52a0ef94c9
Backport contributed commits 2022-04-25 19:40:03 +08:00
Ihor Radchenko 8f6ce702bd
ORG-NEWS: Add list of changes 2022-04-25 19:40:03 +08:00
Ihor Radchenko a8f4270ac1
org-manual: Update to new org-fold function names 2022-04-25 19:40:02 +08:00
Ihor Radchenko 6d4e65a124
Add org-fold-related tests 2022-04-25 19:40:01 +08:00
Ihor Radchenko e8d8db63a0
Restore old visibility behaviour of org-refile 2022-04-25 19:40:00 +08:00
Ihor Radchenko 17e762426d
Move `org-buffer-list' to org-macs.el 2022-04-25 19:40:00 +08:00
Ihor Radchenko d4f65e74a2
org-compat: Work around some third-party packages using outline-* functions 2022-04-25 19:39:59 +08:00
Ihor Radchenko a6eab82fd6
Obsolete old function names that are now in org-fold 2022-04-25 19:39:58 +08:00
Ihor Radchenko 4fbd8bfae0
Alias new org-fold functions to their old shorter names 2022-04-25 19:39:57 +08:00
Ihor Radchenko bf6bd6d21d
Support extra org-fold optimisations for huge buffers 2022-04-25 19:39:57 +08:00
Ihor Radchenko f63ff07441
Fix subtle differences between overlays and invisible text properties
* lisp/org-clock.el (org-clock-in):
(org-clock-find-position):
(org-clock-out):
* lisp/org.el (org-add-planning-info):
(org-scan-tags):
(org-global-tags-completion-table):
(org-make-tags-matcher):
(org-tags-expand):
(org--property-local-values):
(org-read-date-analyze):
(org-revert-all-org-buffers):
(org-beginning-of-line): Make sure that we inherit invisible state
when inserting text.
(org-sort-entries): Preserve invisible state after replace-match.

(org-log-beginning): Do not try to move by visible lines.

* lisp/org-macs.el (org-preserve-local-variables): Do not try to
preserve overlays.
* lisp/ox.el (org-export--generate-copy-script): Preserve folding
properties in export buffer.
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation): Fix
test failure.
* testing/lisp/test-org.el (test-org/meta-return):
(test-org/custom-properties): Use new folding.
2022-04-25 19:39:56 +08:00
Ihor Radchenko cd83606cfd
org-fold: Handle indirect buffer visibility 2022-04-25 19:39:55 +08:00
Ihor Radchenko 77aa9be5ac
Implement overlay- and text-property-based versions of some functions 2022-04-25 19:39:54 +08:00
Ihor Radchenko 67275f4664
Implement link folding
* lisp/ol.el (org-link--link-folding-spec):
(org-link--description-folding-spec): New variables controlling link
folding settings.
(org-link--reveal-maybe): Handle revealing folded links.
(org-link-descriptive-ensure): Implement `org-link-descriptive'
support with org-fold.
(org-toggle-link-display--overlays):
(org-toggle-link-display--text-properties):
(org-toggle-link-display): Provide text-properties and overlays
versions.
* lisp/org-agenda.el (org-agenda-mode): Use org-fold to fold links in
agenda.
* lisp/org.el (org-do-emphasis-faces): Use org-fold.
2022-04-25 19:39:54 +08:00
Ihor Radchenko fa7530c7b4
Rename old function call to use org-fold 2022-04-25 19:39:53 +08:00
Ihor Radchenko d048c153dd
org-string-width: Reimplement to work with new folding
* lisp/org-macs.el (org--string-from-props): Removed since it is no
longer needed.
(org-string-width): Updated to use `window-text-pixel-size'.
2022-04-25 19:39:52 +08:00
Ihor Radchenko bc0caec6eb
org-at-heading-p: Accept optional argument
* lisp/org.el (org-at-heading-p): Use second argument to allow
checking for visible headings.  Note that by default, unlike
`outline-on-heading-p', `org-at-heading-p' returns non-nil for
invisible headings. Passing second argument is just like
`(outline-on-heading-p)'.
(org-indent-line):
* lisp/org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org-colview.el (org-columns--call):
(org-columns-store-format): Update arguments in `org-at-heading-p'
calls.
2022-04-25 19:39:51 +08:00
Ihor Radchenko b7dae51dbb
org-macs: New function org-find-text-property-region 2022-04-25 19:39:51 +08:00
Ihor Radchenko b415111aff
Disable native-comp in agenda
It caused cryptic bugs in the past.
2022-04-25 19:39:50 +08:00
Ihor Radchenko d72ac89c7c
Remove functions from org.el that are now moved elsewhere 2022-04-25 19:39:49 +08:00
Ihor Radchenko ffdc508429
Separate cycling functions from org.el into new library: org-cycle 2022-04-25 19:39:48 +08:00
Ihor Radchenko 91b4c6e6ea
Separate folding functions from org.el into new library: org-fold 2022-04-25 19:39:48 +08:00
Ihor Radchenko 88f86237c5
Add org-fold-core: new folding engine 2022-04-25 19:39:35 +08:00
Kyle Meyer c5395767af Merge branch 'bugfix' 2022-04-24 21:05:03 -04:00
Kyle Meyer d5410433e9 ORG-NEWS: Drop spurious headings added by recent commit
8aff82568 (Revert "org-faces.el: Use fixed-pitch", 2022-04-19) broke
the "New options" section for 9.5 by inserting two headings, both
already covered by 9.5 entries, between the heading and body for the
new org-babel-plantuml-svg-text-to-path option.
2022-04-24 21:03:48 -04:00
Bastien 58eb3e7894 Merge branch 'bugfix' 2022-04-24 11:30:27 +02:00
Bastien 7142392646 etc/ORG-NEWS: Remove outdated entry
This entry is not relevant since commit 8aff82568.
2022-04-24 11:29:53 +02:00
Bastien 1a103afa5e Merge branch 'bugfix' 2022-04-24 11:24:43 +02:00
Bastien 79959c4ee4 etc/ORG-NEWS: Update reference to a mail 2022-04-24 11:23:57 +02:00
Ihor Radchenko 81a2fe4f0b
org-agenda: Use `window-max-chars-per-line' to calculate max text width
* lisp/org-agenda.el (org-agenda-prepare):
(org-todo-list):
(org-agenda-align-tags):
(org-agenda-show-new-time): Calculate the maximum number of chars
fitting into window via `window-max-chars-per-line' instead of
`window-with' or `window-text-with'.  The latter functions can return
larger number when fringes are disabled [1].

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19395

Reported in https://orgmode.org/list/87czhdqi9p.fsf_-_@moondust.localdomain
2022-04-24 14:54:49 +08:00
Ihor Radchenko 96529e933b
org-element-export-snippet-parser: Fix snippets without ending @@
* lisp/org-element.el (org-element-export-snippet-parser): Do not
recognise snippets without closing @@ as empty "@@backend:" snippets.

Example:
@@html:fo aksjdaksjd ajs d

askdjas aksj daj sao@@

Reported in
https://github.com/lucasvreis/org-parser/blob/master/SPEC.org#export-snippets
2022-04-24 13:00:12 +08:00
Ihor Radchenko 67efaa739a
CONTRIBUTE: Link WORG page when explaining commit message format
* CONTRIBUTE (Main contribution rules): Link relevant WORG contribute
page section with extra conventions for our commit message guidelines.

See https://orgmode.org/list/87r16896gh.fsf@red-bean.com
2022-04-23 16:04:55 +08:00
Ihor Radchenko adccb81d54
ob-gnuplot.el: Honour `default-directory'
* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Do not force
Gnuplot working dir to be `buffer-file-name'.  Trust more configurable
`default-directory'.
2022-04-21 20:00:22 +08:00
Ihor Radchenko 6ea247d79a
org-at-timestamp-p: Fix compatibility with Emacs 26
* lisp/org.el (org-at-timestamp-p): Do not use variables in regexp rx
form.  They are not yet supported in Emacs 26.  Expand them at runtime
instead.
2022-04-21 17:34:06 +08:00
Bastien 81289bddee lisp/ox-latex.el: Add Daniel Fleischer as the maintainer 2022-04-20 08:32:46 +02:00
Bastien bee31004bc Merge branch 'bugfix' 2022-04-19 11:27:03 +02:00
Bastien 69c588947d lisp/org.el: Bump version to 9.5.3 2022-04-19 11:24:07 +02:00
Bastien 8aff825682 Revert "org-faces.el: Use fixed-pitch"
This reverts commit 667cb6f1ae.
2022-04-19 11:23:35 +02:00
Ihor Radchenko bebf0bd42d
Merge branch 'bugfix' 2022-04-18 22:58:10 +08:00
Ihor Radchenko 1f617727f1
org-at-timestamp-p: Fix invalid regexp groups for 'agenda scope
* lisp/org.el (org-at-timestamp-p): Make sure that match groups follow
the docstring in `agenda' scope.  Update docstring explaining return
values for sexp timestamps.

Reported in https://orgmode.org/list/CAKJdtO8bqdbW5N6pRFNQRATjm2daEBDCpJj0njwcd4fmhSJSKQ@mail.gmail.com
2022-04-18 22:54:28 +08:00
Kyle Meyer 0ea476ad75 Merge branch 'bugfix' 2022-04-17 15:27:33 -04:00
Kyle Meyer 682ccdfffe org.el: Silence byte-compiler under 'make single' 2022-04-17 15:22:27 -04:00