diff options
| author | Stephen Berman | 2017-08-11 11:28:57 +0200 |
|---|---|---|
| committer | Stephen Berman | 2017-08-11 11:28:57 +0200 |
| commit | e3ed43f4ac667d39fffcc48cfbe97b074f9aa5c7 (patch) | |
| tree | 762ade1b3bf98f140ba75bd116013a8404b28d84 /lisp | |
| parent | a56e6e79613779895975b1762c311bf8fe46f551 (diff) | |
| download | emacs-e3ed43f4ac667d39fffcc48cfbe97b074f9aa5c7.tar.gz emacs-e3ed43f4ac667d39fffcc48cfbe97b074f9aa5c7.zip | |
Fix a minor todo-mode regression
* lisp/calendar/todo-mode.el (todo-get-overlay): Wrap in
save-excursion. This fixes a regression introduced by the fix
for bug#27609, whereby trying to raise the priority of the
first item or lower the priority of the last item, which
should be noops, moves point to the item's start. Clarify
comment.
* test/lisp/calendar/todo-mode-tests.el
(todo-test-raise-lower-priority): Add test cases for trying to
raise first item and lower last item.
(with-todo-test): Clear abbreviated-home-dir, since we change HOME.
(todo-test-toggle-item-header02): Remove ":expected-result
:failed" and tests of point after todo-next-item, since the
effect when using Todo mode is not reproducible in the test
environment. Add commentary about this.
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'. |