1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

Consistently label fold types when `org-fold-core-style' is 'overlays

* lisp/org-clock.el (org-clock-find-position):
* lisp/org-compat.el (org-flag-drawer):
* lisp/org-src.el (org-edit-src-exit):
* lisp/org.el (org-log-beginning): Do not force 'outline folds when
`org-fold-core-style' is 'overlays.  The erroneous logic dates back to
the time when all the folding was done via 'outline folds to save up
on the number of overlays in buffer.  This is not longer the case -
newer Emacs no longer struggle with number of overlays and we fall
back to using text properties in older Emacs.

Reported-by: Bruno Cardoso <cardoso.bc@gmail.com>
Link: https://orgmode.org/list/87sezzmd1m.fsf@gmail.com
This commit is contained in:
Ihor Radchenko 2024-04-06 15:21:10 +03:00
parent b45b393265
commit ea6296a4d9
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
5 changed files with 5 additions and 14 deletions

View File

@ -1691,11 +1691,7 @@ line and position cursor in that line."
;; if point was right where the clock is inserted.
(insert-before-markers-and-inherit ":" drawer ":\n:END:\n")
(org-indent-region beg (point))
(if (eq org-fold-core-style 'text-properties)
(org-fold-region
(line-end-position -1) (1- (point)) t 'drawer)
(org-fold-region
(line-end-position -1) (1- (point)) t 'outline))
(org-fold-region (line-end-position -1) (1- (point)) t 'drawer)
(forward-line -1)))))
;; When a clock drawer needs to be created because of the
;; number of clock items or simply if it is missing, collect

View File

@ -1009,7 +1009,7 @@ When optional argument ELEMENT is a parsed drawer, as returned by
When buffer positions BEG and END are provided, hide or show that
region as a drawer without further ado."
(declare (obsolete "use `org-hide-drawer-toggle' instead." "9.4"))
(if (and beg end) (org-fold-region beg end flag (if (eq org-fold-core-style 'text-properties) 'drawer 'outline))
(if (and beg end) (org-fold-region beg end flag 'drawer)
(let ((drawer
(or element
(and (save-excursion
@ -1023,7 +1023,7 @@ region as a drawer without further ado."
(save-excursion (goto-char (org-element-end drawer))
(skip-chars-backward " \t\n")
(line-end-position))
flag (if (eq org-fold-core-style 'text-properties) 'drawer 'outline))
flag 'drawer)
;; When the drawer is hidden away, make sure point lies in
;; a visible part of the buffer.
(when (invisible-p (max (1- (point)) (point-min)))

View File

@ -119,7 +119,6 @@ Version mismatch is commonly encountered in the following situations:
(defvar org-ts-regexp0)
(defvar ffap-url-regexp)
(defvar org-fold-core-style)
;;; Macros

View File

@ -1479,11 +1479,7 @@ EVENT is passed to `mouse-set-point'."
(goto-char beg)
(cond
;; Block is hidden; move at start of block.
((if (eq org-fold-core-style 'text-properties)
(org-fold-folded-p nil 'block)
(cl-some (lambda (o) (eq (overlay-get o 'invisible) 'org-hide-block))
(overlays-at (point))))
(forward-line -1))
((org-fold-folded-p nil 'block) (forward-line -1))
(write-back (org-src--goto-coordinates coordinates beg end))))
;; Clean up left-over markers and restore window configuration.
(set-marker beg nil)

View File

@ -10715,7 +10715,7 @@ narrowing."
(let ((beg (point)))
(insert-and-inherit ":" drawer ":\n:END:\n")
(org-indent-region beg (point))
(org-fold-region (line-end-position -1) (1- (point)) t (if (eq org-fold-core-style 'text-properties) 'drawer 'outline)))))
(org-fold-region (line-end-position -1) (1- (point)) t 'drawer))))
(end-of-line -1))))
(t
(org-end-of-meta-data org-log-state-notes-insert-after-drawers)