diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/calendar/todo-mode.el | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index e39fee5bfa1..ba7389c07a2 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -5381,20 +5381,21 @@ marked) not done todo items." | |||
| 5381 | 5381 | ||
| 5382 | (defun todo-get-overlay (val) | 5382 | (defun todo-get-overlay (val) |
| 5383 | "Return the overlay at point whose `todo' property has value VAL." | 5383 | "Return the overlay at point whose `todo' property has value VAL." |
| 5384 | ;; When headers are hidden, the display engine makes item's start | 5384 | (save-excursion |
| 5385 | ;; inaccessible to commands, so go there here, if necessary, in | 5385 | ;; When headers are hidden, the display engine makes item's start |
| 5386 | ;; order to check for prefix and header overlays. | 5386 | ;; inaccessible to commands, so then we have to go there |
| 5387 | (when (memq val '(prefix header)) | 5387 | ;; non-interactively to check for prefix and header overlays. |
| 5388 | (unless (looking-at todo-item-start) (todo-item-start))) | 5388 | (when (memq val '(prefix header)) |
| 5389 | ;; Use overlays-in to find prefix overlays and check over two | 5389 | (unless (looking-at todo-item-start) (todo-item-start))) |
| 5390 | ;; positions to find done separator overlay. | 5390 | ;; Use overlays-in to find prefix overlays and check over two |
| 5391 | (let ((ovs (overlays-in (point) (1+ (point)))) | 5391 | ;; positions to find done separator overlay. |
| 5392 | ov) | 5392 | (let ((ovs (overlays-in (point) (1+ (point)))) |
| 5393 | (catch 'done | 5393 | ov) |
| 5394 | (while ovs | 5394 | (catch 'done |
| 5395 | (setq ov (pop ovs)) | 5395 | (while ovs |
| 5396 | (when (eq (overlay-get ov 'todo) val) | 5396 | (setq ov (pop ovs)) |
| 5397 | (throw 'done ov)))))) | 5397 | (when (eq (overlay-get ov 'todo) val) |
| 5398 | (throw 'done ov))))))) | ||
| 5398 | 5399 | ||
| 5399 | (defun todo-marked-item-p () | 5400 | (defun todo-marked-item-p () |
| 5400 | "Non-nil if this item begins with `todo-item-mark'. | 5401 | "Non-nil if this item begins with `todo-item-mark'. |