summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Manheimer <ken.manheimer@gmail.com>2020-07-21 10:57:29 -0400
committerKen Manheimer <ken.manheimer@gmail.com>2020-07-21 10:57:29 -0400
commit8bc8565721739510b3286838f1534f29b8869fc4 (patch)
tree122748ecb1c5399d8f54bc586283938bc09588dc
parentdb479d635411e352529cb9378f0455b2abb2637f (diff)
downloademacs-8bc8565721739510b3286838f1534f29b8869fc4.tar.gz
Revert "Rectify allout-widgets region undecoration so item at start is not missed."
This reverts commit 33d85cb768b40794bffcd9ab22fbdec1211a74e5. Backporting it to emacs-27 was not appropriate.
-rw-r--r--lisp/allout-widgets.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index bdfcaa2e55d..fbdddca7d76 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -2050,22 +2050,19 @@ Optional FORCE means force reassignment of the region property."
;;;_ > 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."
- (let (done next widget
- (end (or end (point-max))))
+ (let ((next start)
+ widget)
(save-excursion
(goto-char start)
- (while (not done)
- (when (and (allout-on-current-heading-p)
- (setq widget (allout-get-item-widget)))
- (if widget
- (allout-widgets-undecorate-item widget t)))
- (goto-char (setq next
- (next-single-char-property-change (point)
- 'display
- (current-buffer)
- end)))
- (if (>= next end)
- (setq done t))))))
+ (while (< (setq next (next-single-char-property-change next
+ 'display
+ (current-buffer)
+ end))
+ end)
+ (goto-char next)
+ (when (setq widget (allout-get-item-widget))
+ ;; if the next-property/overly progression got us to a widget:
+ (allout-widgets-undecorate-item widget t))))))
;;;_ > allout-widgets-undecorate-text (text)
(defun allout-widgets-undecorate-text (text)
"Eliminate widgets and decorations for all items in TEXT."