+2012-11-26 Stephen Berman <stephen.berman@gmx.net>
+
+ * calendar/todos.el (todos-make-categories-list)
+ (todos-convert-legacy-files, todos-jump-to-item)
+ (todos-move-category, todos-merge-category)
+ (todos-archive-done-item, todos-unarchive-items): Include end of
+ line in regex searches for beginning of category, in order not to
+ get a category whose name contains the searched for category name.
+
2012-11-15 Stephen Berman <stephen.berman@gmx.net>
* calendar/todos.el (todos-forward-category): Fix typo.
2012-10-08 Stephen Berman <Stephen.Berman@rub.de>
* calendar/todos.el (todos-move-item): If user quits before
- completing movement, restore display of initial category; If item
+ completing movement, restore display of initial category; if item
is moved to end of target category, make sure the items above it
are displayed in the window.
(widen)
(goto-char (point-min))
(when (re-search-forward
- (concat (regexp-quote todos-category-beg) cat)
+ (concat "^" (regexp-quote todos-category-beg)
+ cat "$")
(point-max) t)
(forward-line)
(while (not (or (looking-at
(delete-region beg (1+ end))
(set-marker beg (point))
(re-search-backward
- (concat "^" (regexp-quote (concat todos-category-beg cat)))
+ (concat "^" (regexp-quote (concat todos-category-beg cat))
+ "$")
nil t)
(forward-line)
(if (re-search-forward
(widen)
(goto-char (point-min))
(re-search-forward
- (concat "^" (regexp-quote (concat todos-category-beg cat))) nil t)
+ (concat "^" (regexp-quote (concat todos-category-beg cat)) "$") nil t)
(search-forward str)
(setq beg (match-beginning 0)))
(kill-buffer buf)
(widen)
(goto-char (point-max))
(let* ((beg (re-search-backward
- (concat "^"
- (regexp-quote (concat todos-category-beg cat)))
+ (concat "^" (regexp-quote (concat todos-category-beg cat))
+ "$")
nil t))
(end (if (re-search-forward
(concat "^" (regexp-quote todos-category-beg))
(goto-char (point-max))
(re-search-backward
(concat "^" (regexp-quote todos-category-beg)
- "\\(" (regexp-quote cat) "\\)") nil t)
+ "\\(" (regexp-quote cat) "\\)$") nil t)
(replace-match new nil nil nil 1)))
(setq todos-categories
(append todos-categories (list (cons new counts))))
;; Merge any todo items.
(unless (zerop (length todo))
(re-search-forward
- (concat "^" (regexp-quote (concat todos-category-beg goal))) nil t)
+ (concat "^" (regexp-quote (concat todos-category-beg goal)) "$")
+ nil t)
(re-search-forward
(concat "^" (regexp-quote todos-category-done)) nil t)
(forward-line -1)
(cbeg (save-excursion
(when (re-search-forward
(concat "^" (regexp-quote
- (concat todos-category-beg cat)))
+ (concat todos-category-beg cat)) "$")
nil t)
(goto-char (match-beginning 0))
(point-marker))))
(gbeg (save-excursion
(when (re-search-forward
(concat "^" (regexp-quote
- (concat todos-category-beg goal)))
+ (concat todos-category-beg goal)) "$")
nil t)
(goto-char (match-beginning 0))
(point-marker))))
(let (buffer-read-only)
(widen)
(goto-char (point-min))
- (if (and (re-search-forward (concat "^"
- (regexp-quote
- (concat todos-category-beg
- cat)))
- nil t)
+ (if (and (re-search-forward
+ (concat "^" (regexp-quote
+ (concat todos-category-beg cat)) "$")
+ nil t)
(re-search-forward (regexp-quote todos-category-done)
nil t))
;; Start of done items section in existing category.
(widen)
(goto-char (point-min))
(re-search-forward (concat "^" (regexp-quote
- (concat todos-category-beg cat)))
+ (concat todos-category-beg cat)) "$")
nil t)
;; Go to end of category's done section.
(if (re-search-forward (concat "^" (regexp-quote todos-category-beg))
(when (eq (point-min) (point-max))
(widen)
(let ((beg (re-search-backward
- (concat "^" (regexp-quote todos-category-beg) cat)
+ (concat "^" (regexp-quote todos-category-beg) cat "$")
nil t))
(end (if (re-search-forward
(concat "^" (regexp-quote todos-category-beg))