aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/ChangeLog9
-rw-r--r--lisp/calendar/todos.el19
2 files changed, 16 insertions, 12 deletions
diff --git a/lisp/calendar/ChangeLog b/lisp/calendar/ChangeLog
index 6b99c1f36dc..c6d8be377aa 100644
--- a/lisp/calendar/ChangeLog
+++ b/lisp/calendar/ChangeLog
@@ -1,5 +1,14 @@
12013-05-15 Stephen Berman <stephen.berman@gmx.net> 12013-05-15 Stephen Berman <stephen.berman@gmx.net>
2 2
3 * todos.el: Use tab instead of spaces to indent.
4 (todos-indent-to-here): Change default value.
5 (todos-modes-set-1): Make tab-width a local variable and set it to
6 todos-indent-to-here.
7 (todos-insert-item-1, todos-edit-item): Use tab not spaces to indent.
8 (todos-edit-quit): Use tab not spaces to indent and fix omission of item.
9
102013-05-15 Stephen Berman <stephen.berman@gmx.net>
11
3 * todos.el (todos-jump-to-category): Fix wrong variable left over 12 * todos.el (todos-jump-to-category): Fix wrong variable left over
4 from previous change. 13 from previous change.
5 14
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el
index 4b18e001b62..aa1e9db47a5 100644
--- a/lisp/calendar/todos.el
+++ b/lisp/calendar/todos.el
@@ -399,7 +399,7 @@ The amount of indentation is given by user option
399 (unless (member '(continuation) fringe-indicator-alist) 399 (unless (member '(continuation) fringe-indicator-alist)
400 (push '(continuation) fringe-indicator-alist))) 400 (push '(continuation) fringe-indicator-alist)))
401 401
402(defcustom todos-indent-to-here 6 402(defcustom todos-indent-to-here 3
403 "Number of spaces `todos-line-wrapping-function' indents to." 403 "Number of spaces `todos-line-wrapping-function' indents to."
404 :type '(integer :validate 404 :type '(integer :validate
405 (lambda (widget) 405 (lambda (widget)
@@ -2996,6 +2996,7 @@ which is the value of the user option
2996(defun todos-modes-set-1 () 2996(defun todos-modes-set-1 ()
2997 "" 2997 ""
2998 (set (make-local-variable 'font-lock-defaults) '(todos-font-lock-keywords t)) 2998 (set (make-local-variable 'font-lock-defaults) '(todos-font-lock-keywords t))
2999 (set (make-local-variable 'tab-width) todos-indent-to-here)
2999 (set (make-local-variable 'indent-line-function) 'todos-indent) 3000 (set (make-local-variable 'indent-line-function) 'todos-indent)
3000 (when todos-wrap-lines (funcall todos-line-wrapping-function))) 3001 (when todos-wrap-lines (funcall todos-line-wrapping-function)))
3001 3002
@@ -4759,10 +4760,8 @@ the priority is not given by HERE but by prompting."
4759 todos-nondiary-end) 4760 todos-nondiary-end)
4760 " " new-item)) 4761 " " new-item))
4761 ;; Indent newlines inserted by C-q C-j if nonspace char follows. 4762 ;; Indent newlines inserted by C-q C-j if nonspace char follows.
4762 (setq new-item (replace-regexp-in-string 4763 (setq new-item (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
4763 "\\(\n\\)[^[:blank:]]" 4764 "\n\t" new-item nil nil 1))
4764 (concat "\n" (make-string todos-indent-to-here 32))
4765 new-item nil nil 1))
4766 (unwind-protect 4765 (unwind-protect
4767 (progn 4766 (progn
4768 ;; Make sure the correct category is selected. There 4767 ;; Make sure the correct category is selected. There
@@ -4945,10 +4944,8 @@ minibuffer; otherwise, edit it in Todos Edit mode."
4945 (setq new (read-from-minibuffer 4944 (setq new (read-from-minibuffer
4946 "Item must start with a date: " new)))) 4945 "Item must start with a date: " new))))
4947 ;; Ensure lines following hard newlines are indented. 4946 ;; Ensure lines following hard newlines are indented.
4948 (setq new (replace-regexp-in-string 4947 (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]"
4949 "\\(\n\\)[^[:blank:]]" 4948 "\n\t" new nil nil 1))
4950 (concat "\n" (make-string todos-indent-to-here 32)) new
4951 nil nil 1))
4952 ;; If user moved point during editing, make sure it moves back. 4949 ;; If user moved point during editing, make sure it moves back.
4953 (goto-char opoint) 4950 (goto-char opoint)
4954 (todos-remove-item) 4951 (todos-remove-item)
@@ -4996,9 +4993,7 @@ in the number or names of categories."
4996 (regex "\\(\n\\)[^[:blank:]]")) 4993 (regex "\\(\n\\)[^[:blank:]]"))
4997 ;; Ensure lines following hard newlines are indented. 4994 ;; Ensure lines following hard newlines are indented.
4998 (when (string-match regex (buffer-string)) 4995 (when (string-match regex (buffer-string))
4999 (replace-regexp-in-string 4996 (setq item (replace-regexp-in-string regex "\n\t" item nil nil 1))
5000 regex (concat "\n" (make-string todos-indent-to-here 32))
5001 nil nil 1)
5002 (delete-region (point-min) (point-max)) 4997 (delete-region (point-min) (point-max))
5003 (insert item)) 4998 (insert item))
5004 (kill-buffer)) 4999 (kill-buffer))