Function: org-remove-subtree-entries-from-agenda

org-remove-subtree-entries-from-agenda is a byte-compiled function defined in org-agenda.el.gz.

Signature

(org-remove-subtree-entries-from-agenda &optional BUF BEG END)

Documentation

Remove all lines in the agenda that correspond to a given subtree.

The subtree is the one in buffer BUF, starting at BEG and ending at END. If this information is not given, the function uses the tree at point.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-remove-subtree-entries-from-agenda (&optional buf beg end)
  "Remove all lines in the agenda that correspond to a given subtree.
The subtree is the one in buffer BUF, starting at BEG and ending at END.
If this information is not given, the function uses the tree at point."
  (let ((buf (or buf (current-buffer))) m p)
    (save-excursion
      (unless (and beg end)
	(org-back-to-heading t)
	(setq beg (point))
	(org-end-of-subtree t)
	(setq end (point)))
      (set-buffer (get-buffer org-agenda-buffer-name))
      (save-excursion
	(goto-char (point-max))
	(beginning-of-line 1)
	(while (not (bobp))
	  (when (and (setq m (org-get-at-bol 'org-marker))
		     (equal buf (marker-buffer m))
		     (setq p (marker-position m))
		     (>= p beg)
		     (< p end))
	    (let ((inhibit-read-only t))
              (delete-region (line-beginning-position)
                             (1+ (line-end-position)))))
	  (beginning-of-line 0))))))