(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))