1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Rectify allout-widgets region undecoration so item at start is not missed.

* lisp/allout-widgets.el (allout-widgets-undecorate-region):
Reorganize the loop so an item at the start is not skipped.
This commit is contained in:
Ken Manheimer 2020-07-05 16:38:13 -04:00
parent dd7c191291
commit 33d85cb768

View file

@ -2060,19 +2060,22 @@ Optional FORCE means force reassignment of the region property."
;;;_ > allout-widgets-undecorate-region (start end) ;;;_ > allout-widgets-undecorate-region (start end)
(defun allout-widgets-undecorate-region (start end) (defun allout-widgets-undecorate-region (start end)
"Eliminate widgets and decorations for all items in region from START to END." "Eliminate widgets and decorations for all items in region from START to END."
(let ((next start) (let (done next widget
widget) (end (or end (point-max))))
(save-excursion (save-excursion
(goto-char start) (goto-char start)
(while (< (setq next (next-single-char-property-change next (while (not done)
'display (when (and (allout-on-current-heading-p)
(current-buffer) (setq widget (allout-get-item-widget)))
end)) (if widget
end) (allout-widgets-undecorate-item widget t)))
(goto-char next) (goto-char (setq next
(when (setq widget (allout-get-item-widget)) (next-single-char-property-change (point)
;; if the next-property/overly progression got us to a widget: 'display
(allout-widgets-undecorate-item widget t)))))) (current-buffer)
end)))
(if (>= next end)
(setq done t))))))
;;;_ > allout-widgets-undecorate-text (text) ;;;_ > allout-widgets-undecorate-text (text)
(defun allout-widgets-undecorate-text (text) (defun allout-widgets-undecorate-text (text)
"Eliminate widgets and decorations for all items in TEXT." "Eliminate widgets and decorations for all items in TEXT."