aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Berman2009-07-04 00:07:26 +0100
committerStephen Berman2009-07-04 00:07:26 +0100
commit98c97dee7675f6028a82340e9c495c8759cd6b8e (patch)
treea0fb23e58a0ddc663369586c57f5ff409be12084
parent1f678911da23b7f0e497bbb4441c3b4c4359b010 (diff)
downloademacs-98c97dee7675f6028a82340e9c495c8759cd6b8e.tar.gz
emacs-98c97dee7675f6028a82340e9c495c8759cd6b8e.zip
* calendar/todos.el (todos-window-configuration): Comment out.
(todos-display-categories): Comment out use of todos-window-configuration; use switch-to-buffer instead of pop-to-buffer. (todos-jump-to-category-noninteractively): Comment out use of todos-window-configuration. (todos-edit-item): Don't allow editing of date/time item header. (todos-insert-item, todos-insert-item-here): Insert date/time header in front of new item string. (todos-mode): Tweak wrap-prefix.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/calendar/todos.el43
2 files changed, 36 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5c81102cb83..21821505339 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,18 @@
12012-09-12 Stephen Berman <stephen.berman@gmx.net> 12012-09-12 Stephen Berman <stephen.berman@gmx.net>
2 2
3 * calendar/todos.el (todos-window-configuration): Comment out.
4 (todos-display-categories): Comment out use of
5 todos-window-configuration; use switch-to-buffer instead of
6 pop-to-buffer.
7 (todos-jump-to-category-noninteractively): Comment out use of
8 todos-window-configuration.
9 (todos-edit-item): Don't allow editing of date/time item header.
10 (todos-insert-item, todos-insert-item-here): Insert date/time
11 header in front of new item string.
12 (todos-mode): Tweak wrap-prefix.
13
142012-09-12 Stephen Berman <stephen.berman@gmx.net>
15
3 * calendar/todos.el (todos-file-do, todos-file-done): 16 * calendar/todos.el (todos-file-do, todos-file-done):
4 Change default location to directory "~/.emacs.d/". 17 Change default location to directory "~/.emacs.d/".
5 (todos-completion-ignore-case, todos-categories-buffer): 18 (todos-completion-ignore-case, todos-categories-buffer):
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el
index 591cf690758..eaf4b92f5c8 100644
--- a/lisp/calendar/todos.el
+++ b/lisp/calendar/todos.el
@@ -455,12 +455,12 @@ For details see the variable `time-stamp-format'."
455(defvar todos-category-end "--- End" 455(defvar todos-category-end "--- End"
456 "Separator after a category.") 456 "Separator after a category.")
457 457
458(defvar todos-window-configuration nil 458;; (defvar todos-window-configuration nil
459 "Variable for storing current window configuration in Todos mode. 459;; "Variable for storing current window configuration in Todos mode.
460 460
461Set before leaving Todos mode buffer by todos-display-categories. 461;; Set before leaving Todos mode buffer by todos-display-categories.
462Restored before re-entering Todo mode buffer by todo-kill-buffer 462;; Restored before re-entering Todo mode buffer by todo-kill-buffer
463and todo-jump-to-category-noninteractively.") 463;; and todo-jump-to-category-noninteractively.")
464 464
465;; --------------------------------------------------------------------------- 465;; ---------------------------------------------------------------------------
466 466
@@ -530,10 +530,15 @@ and todo-jump-to-category-noninteractively.")
530(defun todos-edit-item () 530(defun todos-edit-item ()
531 "Edit current TODO list entry." 531 "Edit current TODO list entry."
532 (interactive) 532 (interactive)
533 (let ((item (todos-item-string))) 533 (let* ((prefix (concat todos-prefix " " (todos-entry-timestamp-initials)))
534 ;; don't allow editing of Todos prefix string
535 ;; FIXME: or should this be automatically updated upon editing?
536 (item (substring (todos-item-string) (length prefix))))
537 ;; FIXME: disable minibuffer-history ??
538 ;; (minibuffer-history))
534 (if (todos-string-multiline-p item) 539 (if (todos-string-multiline-p item)
535 (todos-edit-multiline) 540 (todos-edit-multiline)
536 (let ((new (read-from-minibuffer "Edit: " item))) 541 (let ((new (concat prefix (read-from-minibuffer "Edit: " item))))
537 (todos-remove-item) 542 (todos-remove-item)
538 (insert new "\n") 543 (insert new "\n")
539 (todos-backward-item) 544 (todos-backward-item)
@@ -679,7 +684,7 @@ and todo-jump-to-category-noninteractively.")
679 "Display an alphabetical list of clickable Todos category names. 684 "Display an alphabetical list of clickable Todos category names.
680Click or type RET on a category name to go to it." 685Click or type RET on a category name to go to it."
681 (interactive) 686 (interactive)
682 (setq todos-window-configuration (current-window-configuration)) 687 ;; (setq todos-window-configuration (current-window-configuration))
683 (let ((categories (copy-sequence todos-categories)) 688 (let ((categories (copy-sequence todos-categories))
684 beg) 689 beg)
685 ;; alphabetize the list case insensitively 690 ;; alphabetize the list case insensitively
@@ -690,7 +695,7 @@ Click or type RET on a category name to go to it."
690 (eval-when-compile 695 (eval-when-compile
691 (require 'wid-edit)) 696 (require 'wid-edit))
692 (with-current-buffer (get-buffer-create todos-categories-buffer) 697 (with-current-buffer (get-buffer-create todos-categories-buffer)
693 (pop-to-buffer (current-buffer)) 698 (switch-to-buffer (current-buffer))
694 (erase-buffer) 699 (erase-buffer)
695 (kill-all-local-variables) 700 (kill-all-local-variables)
696 (widget-insert "Press a button to display the corresponding category.\n\n") 701 (widget-insert "Press a button to display the corresponding category.\n\n")
@@ -711,7 +716,7 @@ Click or type RET on a category name to go to it."
711 (let ((name todos-categories-buffer)) 716 (let ((name todos-categories-buffer))
712 (if (string= (buffer-name) name) 717 (if (string= (buffer-name) name)
713 (kill-buffer name))) 718 (kill-buffer name)))
714 (set-window-configuration todos-window-configuration) 719 ;; (set-window-configuration todos-window-configuration)
715 (switch-to-buffer (file-name-nondirectory todos-file-do)) 720 (switch-to-buffer (file-name-nondirectory todos-file-do))
716 (widen) 721 (widen)
717 (goto-char (point-min)) 722 (goto-char (point-min))
@@ -728,10 +733,9 @@ category."
728 (save-excursion 733 (save-excursion
729 (if (not (derived-mode-p 'todos-mode)) (todos-show)) 734 (if (not (derived-mode-p 'todos-mode)) (todos-show))
730 (let* ((new-item (concat todos-prefix " " 735 (let* ((new-item (concat todos-prefix " "
731 (read-from-minibuffer 736 (if todos-entry-prefix-function
732 "New TODO entry: " 737 (funcall todos-entry-prefix-function))
733 (if todos-entry-prefix-function 738 (read-from-minibuffer "New TODO entry: ")))
734 (funcall todos-entry-prefix-function)))))
735 (current-category (nth todos-category-number todos-categories)) 739 (current-category (nth todos-category-number todos-categories))
736 (category (if arg (todos-completing-read) current-category))) 740 (category (if arg (todos-completing-read) current-category)))
737 (todos-add-item-non-interactively new-item category)))) 741 (todos-add-item-non-interactively new-item category))))
@@ -742,10 +746,9 @@ If point is on an empty line, insert the entry there."
742 (interactive) 746 (interactive)
743 (if (not (derived-mode-p 'todos-mode)) (todos-show)) 747 (if (not (derived-mode-p 'todos-mode)) (todos-show))
744 (let ((new-item (concat todos-prefix " " 748 (let ((new-item (concat todos-prefix " "
745 (read-from-minibuffer 749 (if todos-entry-prefix-function
746 "New TODO entry: " 750 (funcall todos-entry-prefix-function))
747 (if todos-entry-prefix-function 751 (read-from-minibuffer "New TODO entry: "))))
748 (funcall todos-entry-prefix-function))))))
749 (unless (and (bolp) (eolp)) (goto-char (todos-item-start))) 752 (unless (and (bolp) (eolp)) (goto-char (todos-item-start)))
750 (insert (concat new-item "\n")) 753 (insert (concat new-item "\n"))
751 (backward-char) 754 (backward-char)
@@ -1076,8 +1079,8 @@ Number of entries for each category is given by `todos-print-priorities'."
1076 (setq word-wrap t) 1079 (setq word-wrap t)
1077 (make-local-variable 'wrap-prefix) 1080 (make-local-variable 'wrap-prefix)
1078 (setq wrap-prefix 1081 (setq wrap-prefix
1079 (make-string (1+ (length (concat todos-prefix 1082 (make-string (length (concat todos-prefix " "
1080 (todos-entry-timestamp-initials)))) 32)) 1083 (todos-entry-timestamp-initials))) 32))
1081 (unless (member '(continuation) fringe-indicator-alist) 1084 (unless (member '(continuation) fringe-indicator-alist)
1082 (push '(continuation) fringe-indicator-alist)) 1085 (push '(continuation) fringe-indicator-alist))
1083 (run-mode-hooks 'todos-mode-hook)) 1086 (run-mode-hooks 'todos-mode-hook))