summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKen Manheimer <ken.manheimer@gmail.com>2020-07-05 16:38:13 -0400
committerKen Manheimer <ken.manheimer@gmail.com>2020-07-20 14:07:50 -0400
commit33d85cb768b40794bffcd9ab22fbdec1211a74e5 (patch)
tree6363cd1abafe8d83d8db0285fb4f0c57286061e7 /lisp
parentdd7c191291c8eb1afeac0f1512745491c5c7a317 (diff)
downloademacs-33d85cb768b40794bffcd9ab22fbdec1211a74e5.tar.gz
emacs-33d85cb768b40794bffcd9ab22fbdec1211a74e5.tar.bz2
emacs-33d85cb768b40794bffcd9ab22fbdec1211a74e5.zip
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/allout-widgets.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 5460551106b..2a8dced5e9c 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -2060,19 +2060,22 @@ 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 ((next start)
- widget)
+ (let (done next widget
+ (end (or end (point-max))))
(save-excursion
(goto-char start)
- (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))))))
+ (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))))))
;;;_ > allout-widgets-undecorate-text (text)
(defun allout-widgets-undecorate-text (text)
"Eliminate widgets and decorations for all items in TEXT."