Function: todo-go-to-source-item

todo-go-to-source-item is an interactive and byte-compiled function defined in todo-mode.el.gz.

Signature

(todo-go-to-source-item)

Documentation

Display the file and category of the filtered item at point.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/todo-mode.el.gz
(defun todo-go-to-source-item ()
  "Display the file and category of the filtered item at point."
  (interactive)
  (unless (looking-at "^$")             ; Empty line at EOB.
    (let* ((str (todo-item-string))
           (buf (current-buffer))
           (res (todo-find-item str))
           (found (nth 0 res))
           (file (nth 1 res))
           (cat (nth 2 res)))
      (if (not found)
          (message "Category %s does not contain this item." cat)
        (kill-buffer buf)
        (set-window-buffer (selected-window)
                           (set-buffer (find-buffer-visiting file)))
        (setq todo-current-todo-file file)
        (setq todo-category-number (todo-category-number cat))
        (let ((todo-show-with-done (if (or todo-filter-done-items
                                            (eq (cdr found) 'done))
                                        t
                                      todo-show-with-done)))
          (todo-category-select))
        (if transient-mark-mode (deactivate-mark))
        (goto-char (car found))))))