0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:07:46 +00:00
Commit graph

22 commits

Author SHA1 Message Date
Ihor Radchenko 785f003de5
org-fold-show-entry: Do not fold drawers unless requested
* lisp/org-fold.el (org-fold-show-entry): Do not fold drawers in the
unfolded entry unless the new optional argument is non-nil.  Folding
the drawers was introduced in 1027e02569, but does not follow the
function docstring.  Moreover, folding drawers creates unexpected
behaviour in some cases.  See
https://orgmode.org/list/m2a6bl4mmr.fsf@andrew.cmu.edu

* etc/ORG-NEWS (~org-fold-show-entry~ does not fold drawers by default
anymore): Document the change.

* lisp/org-agenda.el (org-agenda-show):
(org-agenda-show-and-scroll-up):
(org-agenda-show-1):
* lisp/org-compat.el (outline-toggle-children):
* lisp/org.el (org-move-subtree-down):
(org-return): Explicitly request folding drawers inside the revealed
entry in the places where it appears to make sense.

* lisp/org-timer.el (org-timer--get-timer-title): Do not unfold entry
at all.  This is a noninteractive function.
2022-07-31 10:17:08 +08:00
Ihor Radchenko 39005dc098
org-fold: Do not fold text inserted right after outline fold
* lisp/org-fold.el (org-fold-initialize): Do not extend the fold when
text is inserted right after it.  This resembles folding overlay
behavior used in previous Org versions and in the 'overlays
`org-fold-core-style'.

Fixes https://orgmode.org/list/871quprrra.fsf@gmail.com
2022-07-19 21:15:38 +08:00
Ihor Radchenko 8e2fed82ed
org-fold: Make sure that changes do not leave partially folded headings
* lisp/org-fold-core.el (org-fold-core--fix-folded-region): Check
fragility in all the indirect buffers.
* lisp/org-fold.el (org-fold--reveal-headline-at-point): New function
revealing heading line or full heading when the heading only contains
blank lines.
(org-fold--reveal-outline-maybe): Check headline at the end of folded
region as well.  Use `org-fold-core--fix-folded-region'.
* lisp/org.el (org-insert-heading): Make sure that the newline in
front of heading is revealed.
2022-07-12 21:51:40 +08:00
Stefan Kangas 13d97ee18c
Prefer "website" to "homepage"
Emacs now advises using "website" (instead of "homepage") and
consequently to use the "URL" comment header instead of "Homepage".

* README:
* README_ELPA:
* doc/org-guide.org (Creating Footnotes):
* doc/org-manual.org (Creating Footnotes):
* etc/styles/README (URL): Prefer "website" to "homepage".

* lisp/*.el:
* mk/org-fixup.el: Replace the "Homepage" header comment with "URL".
2022-06-26 10:10:48 +08:00
Ihor Radchenko 8f59e8d93f
Fix native-comp warnings
* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Resolve unused variable warning.

* lisp/ob-core.el (org-attach-dir):
* lisp/ob-latex.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading):
* lisp/org.el (org-agenda-todo-yesterday):
* lisp/ox-ascii.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading):
* lisp/ox-html.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading):
* lisp/ox-icalendar.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading):
* lisp/ox-latex.el (engrave-faces-latex-gen-preamble-line):
(engrave-faces-get-theme):
(engrave-faces-latex-output-style):
(engrave-faces-current-preset-style):
(engrave-faces-latex-mathescape):
* lisp/ox-odt.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading):
* lisp/ox-publish.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading):
* lisp/ox.el (org-at-heading-p):
(org-back-to-heading):
(org-next-visible-heading): Add declarations.
2022-06-16 13:19:10 +08:00
Ihor Radchenko 2778972509
org-fold--reveal-outline-maybe: Prevent wrong-side-of-point error
* lisp/org-fold.el (org-fold--reveal-outline-maybe): Fix scenario when
point is moved beyond REGION.
2022-05-17 13:24:21 +08:00
Ihor Radchenko d6bae908f3
Fix macro indentation and re-indent code misindented by nameless
* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
(org-fold-core-ignore-modifications):
(org-fold-core-ignore-fragility-checks):
* lisp/org-macs.el (org-element-with-disabled-cache): Fix incorrect
indentation declare statement.  Body-only macros should use (indent 0)
to avoid indenting first line differently from other body.
* lisp/org-capture.el:
* lisp/org-clock.el:
* lisp/org-fold-core.el:
* lisp/org-fold.el:
* lisp/org-id.el:
* lisp/org-list.el:
* lisp/org-macs.el:
* lisp/org.el: Reindent.

Reported in https://orgmode.org/list/CAKJdtO_Z4LBGek3SUc6-a_Z0-dDd6L26_YfMYpZTn7F92uxXJQ@mail.gmail.com
2022-05-14 16:58:35 +08:00
Ihor Radchenko 717f83bf75
org-fold--reveal-outline-maybe: Fix wrong side of point error
* lisp/org-fold.el (org-fold--reveal-outline-maybe): Widen the buffer
before testing headline validity.  Otherwise, `goto-char' may not move
where expected in narrowed buffer.
2022-05-09 20:39:57 +08:00
Ihor Radchenko 2e4ed52b19
org-fold: Revert old behaviour when handling invisible edits
* lisp/org-fold-core.el (org-fold-core-folded-p): Allow list of fold
types to be passed as argument.
* lisp/org-fold.el (org-fold-check-before-invisible-edit--overlays):
(org-fold-check-before-invisible-edit--text-properties): Make
overlay/text-property behaviour consistent.  Do not handle edits
inside folded links.  Fix inconsistencies.
* testing/lisp/test-org-fold.el:
* testing/lisp/test-org.el: Move folding-related tests to new test
file.
* testing/lisp/test-org-fold.el:
(test-org-fold/org-catch-invisible-edits): New test.

See https://orgmode.org/list/m2o809q170.fsf@gmail.com
2022-05-08 17:26:42 +08:00
Ihor Radchenko d2a459d259
org-fold-check-before-invisible-edit: Be smart about editing at border
*
lisp/org-fold.el (org-fold-check-before-invisible-edit--text-properties):
Consider `border-and-ok-direction' value when deciding whether to
throw an error and reveal the fold.  Never throw an error when editing
at border without affecting the text inside.

Fixes https://orgmode.org/list/m2ilqle995.fsf@gmail.com
2022-05-04 22:37:29 +08:00
Ihor Radchenko ebbef7b30c
org-fold-save-outline-visibility: Make it work with 'text-properties
*
lisp/org-fold.el (org-fold-save-outline-visibility--text-properties):
Do not expand list of specs on compile time.  Simplify saving and
re-applying folds.

* lisp/org-fold.el (org-fold-save-outline-visibility): Fix typo when
-> if.
2022-05-03 14:27:25 +08:00
Ihor Radchenko a3dac4d20a
fixup! org-fold-show-set-visibility: Do not reveal emphasis unless DETAIL is `local'
* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Consider nil value for REGION.
2022-04-29 10:55:42 +08:00
Ihor Radchenko 782a661921
org-fold-show-set-visibility: Do not reveal emphasis unless DETAIL is `local'
* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Prevent revealing hidden emphasis unless requested DETAIL is `local'.
* lisp/ol.el (org-next-link): Honour `org-fold-show-context-detail'.

Reported in https://orgmode.org/list/626a0713.1c69fb81.a3583.1a07SMTPIN_ADDED_BROKEN@mx.google.com
2022-04-28 14:33:43 +08:00
Ihor Radchenko a0b8adf08a
org-fold: Reveal hidden macro markers
* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Unfold hidden macro markers on invisible edit.
2022-04-28 14:02:32 +08:00
Ihor Radchenko e142bd8a9a
org-fold: Fix folding blank lines after newly inserted heading
* lisp/org-fold.el (org-fold--reveal-outline-maybe): Reveal blank
lines after newly inserted heading after a folded heading.
2022-04-27 19:28:39 +08:00
Ihor Radchenko 2d6f26c057
org-fold: Prevent folding level 1 headlines
* lisp/org-fold.el (org-fold--reveal-outline-maybe): Never keep level
1 headlines inserted inside folded region hidden.  Such headlines can
often be added to end of buffer by capture.  This change prevents such
headlines to be hidden.

Reported in https://orgmode.org/list/CABUh-74vvn7i06T3zB=38_BFfBKS9J9H8NxGp_-eecoAPgygoQ@mail.gmail.com
2022-04-27 16:45:06 +08:00
Ihor Radchenko 407104459b
org-fold: Honour `org-fold-show-context-detail' for isearch
* lisp/org-fold.el (org-fold--isearch-reveal): Call
`org-fold-show-visibility'.  The previously used
`org-fold-show-set-visibility' does not accept context as argument.

Reported in https://orgmode.org/list/8735i5gd8n.fsf@gmail.com
2022-04-25 19:40:19 +08:00
Ihor Radchenko fc6314b267
org-fold.el: Fix typo 2022-04-25 19:40:15 +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 3fba34900e
Fix org-fold--hide-drawers--overlays 2022-04-25 19:40:06 +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 91b4c6e6ea
Separate folding functions from org.el into new library: org-fold 2022-04-25 19:39:48 +08:00