diff options
| author | Stephen Berman | 2018-08-14 21:39:24 +0200 |
|---|---|---|
| committer | Stephen Berman | 2018-08-14 21:39:24 +0200 |
| commit | a2ec595e5d7cf95715312a9cd0a6f4ef0f6e370f (patch) | |
| tree | 75f7d6ebf424945177cc972b3b15f3bf86d822b2 /test | |
| parent | 11c7c2f758f8f07e7b917fbc93267cee236a80e5 (diff) | |
| download | emacs-a2ec595e5d7cf95715312a9cd0a6f4ef0f6e370f.tar.gz emacs-a2ec595e5d7cf95715312a9cd0a6f4ef0f6e370f.zip | |
Fix exiting from editing todo archive file (bug#32437)
* lisp/calendar/todo-mode.el (todo-edit-file): Make the warning
also suitable for Todo Archive mode, and add more space to it.
(todo-edit-quit): On quitting editing an archive file, return to
the Todo Archive mode buffer editing was invoked in.
(todo-check-format): Display a warning instead of a message when
the categories sexp isn't as expected.
(todo-mode-external-set): Remove.
(todo-edit-mode): Set buffer local values of
todo-current-todo-file and todo-categories from the todo or
archive file being edited.
(todo-categories-mode): Set buffer local values of
todo-current-todo-file and todo-categories as before but directly
instead of using superfluous todo-mode-external-set function.
* test/lisp/calendar/todo-mode-tests.el (todo-test-edit-quit): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/calendar/todo-mode-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el index 325faeff514..90282045062 100644 --- a/test/lisp/calendar/todo-mode-tests.el +++ b/test/lisp/calendar/todo-mode-tests.el | |||
| @@ -763,6 +763,24 @@ The highlighting should remain enabled." | |||
| 763 | (ert-simulate-command '(forward-line)) ; Now on first done item. | 763 | (ert-simulate-command '(forward-line)) ; Now on first done item. |
| 764 | (should (eq 'hl-line (get-char-property (point) 'face))))) | 764 | (should (eq 'hl-line (get-char-property (point) 'face))))) |
| 765 | 765 | ||
| 766 | (ert-deftest todo-test-edit-quit () | ||
| 767 | "Test result of exiting todo-edit-mode on a whole file. | ||
| 768 | Exiting should return to the same todo-mode or todo-archive-mode | ||
| 769 | buffer from which the editing command was invoked." | ||
| 770 | (with-todo-test | ||
| 771 | (todo-test--show 1) | ||
| 772 | (let ((buf (current-buffer))) | ||
| 773 | (todo-edit-file) | ||
| 774 | (todo-edit-quit) | ||
| 775 | (should (eq (current-buffer) buf)) | ||
| 776 | (should (eq major-mode 'todo-mode)) | ||
| 777 | (todo-find-archive) | ||
| 778 | (let ((buf (current-buffer))) | ||
| 779 | (todo-edit-file) | ||
| 780 | (todo-edit-quit) | ||
| 781 | (should (eq (current-buffer) buf)) | ||
| 782 | (should (eq major-mode 'todo-archive-mode)))))) | ||
| 783 | |||
| 766 | 784 | ||
| 767 | (provide 'todo-mode-tests) | 785 | (provide 'todo-mode-tests) |
| 768 | ;;; todo-mode-tests.el ends here | 786 | ;;; todo-mode-tests.el ends here |