]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/todo-mode.el
(calendar-mode-map, calendar-mouse-3-map): Refer to
[gnu-emacs] / lisp / calendar / todo-mode.el
index 92acea3c443754d6b5013d7bc271b8448589f4bf..6f96ec1cdb224385d2b7cebabcb308516bbe6d4e 100644 (file)
@@ -1,11 +1,11 @@
-;; todo-mode.el -- Major mode for editing TODO list files
+;;; todo-mode.el --- major mode for editing TODO list files
 
-;; Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006
+;;   Free Software Foundation, Inc.
 
 ;; Author: Oliver Seidel <os10000@seidel-space.de>
 ;;   [Not clear the above works, July 2000]
 ;; Created: 2 Aug 1997
-;; Version: $Id: todo-mode.el,v 1.44 2000/11/22 22:51:33 fx Exp $
 ;; Keywords: calendar, todo
 
 ;; This file is part of GNU Emacs.
@@ -22,8 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;; ---------------------------------------------------------------------------
 
 ;;      extensions that are not explicitly listed in the above quick
 ;;      installation.
 ;;
-;;  Version
-;;
-;;      Which version of todo-mode.el does this documentation refer to?
-;;
-;;      $Id: todo-mode.el,v 1.44 2000/11/22 22:51:33 fx Exp $
-;;
 ;;  Pre-Requisites
 ;;
 ;;      This package will require the following packages to be
 
 ;;; Code:
 
+(require 'time-stamp)
+
+
 ;; User-configurable variables:
 
 (defgroup todo nil
@@ -315,7 +312,7 @@ which it will stop.  If you set the threshhold to zero, the upper and
 lower bound will coincide at the end of the loop and you will insert
 your item just before that point.  If you set the threshhold to,
 e.g. 8, it will stop as soon as the window size drops below that
-amount and will insert the item in the approximate centre of that
+amount and will insert the item in the approximate center of that
 window."
   :type 'integer
   :group 'todo)
@@ -372,8 +369,6 @@ For details see the variable `time-stamp-format'."
   :type 'string
   :group 'todo)
 
-(autoload 'time-stamp-string "time-stamp")
-
 (defun todo-entry-timestamp-initials ()
   "Prepend timestamp and your initials to the head of a TODO entry."
   (let ((time-stamp-format todo-time-string-format))
@@ -494,9 +489,10 @@ Use `todo-categories' instead.")
 (defun todo-save ()
   "Save the TODO list."
   (interactive)
-  (save-buffer)
-  (if todo-save-top-priorities-too (todo-save-top-priorities))
-  )
+  (save-excursion
+    (save-restriction
+      (save-buffer)))
+  (if todo-save-top-priorities-too (todo-save-top-priorities)))
 (defalias 'todo-cmd-save 'todo-save)
 
 (defun todo-quit ()
@@ -747,10 +743,9 @@ between each category."
         (copy-to-buffer todo-print-buffer-name (point-min) (point-max))
         (set-buffer todo-print-buffer-name)
         (goto-char (point-min))
-        (if (re-search-forward (regexp-quote todo-header) nil t)
-            (progn
-              (beginning-of-line 1)
-              (kill-line)))             ;Remove mode line
+        (when (re-search-forward (regexp-quote todo-header) nil t)
+         (beginning-of-line 1)
+         (delete-region (point) (line-end-position)))
         (while (re-search-forward       ;Find category start
                 (regexp-quote (concat todo-prefix todo-category-beg))
                 nil t)
@@ -910,11 +905,12 @@ Number of entries for each category is given by `todo-print-priorities'."
 
 \\{todo-mode-map}"
   (interactive)
+  (kill-all-local-variables)
   (setq major-mode 'todo-mode)
   (setq mode-name "TODO")
   (use-local-map todo-mode-map)
   (easy-menu-add todo-menu)
-  (run-hooks 'todo-mode-hook))
+  (run-mode-hooks 'todo-mode-hook))
 
 (eval-when-compile
   (defvar date)
@@ -960,4 +956,5 @@ Number of entries for each category is given by `todo-print-priorities'."
 
 (provide 'todo-mode)
 
+;;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497
 ;;; todo-mode.el ends here