Function: org-agenda-bulk-mark

org-agenda-bulk-mark is an interactive and byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-bulk-mark &optional ARG)

Documentation

Mark entries for future bulk action.

When ARG is nil or one and region is not active then mark the entry at point.

When ARG is nil or one and region is active then mark the entries in the region.

When ARG is greater than one mark ARG lines.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-bulk-mark (&optional arg)
  "Mark entries for future bulk action.

When ARG is nil or one and region is not active then mark the
entry at point.

When ARG is nil or one and region is active then mark the entries
in the region.

When ARG is greater than one mark ARG lines."
  (interactive "p")
  (when (and (or (not arg) (= arg 1)) (use-region-p))
    (setq arg (count-lines (region-beginning) (region-end)))
    (goto-char (region-beginning))
    (deactivate-mark))
  (dotimes (_ (or arg 1))
    (unless (org-get-at-bol 'org-agenda-diary-link)
      (let* ((m (org-get-at-bol 'org-hd-marker))
	     ov)
	(unless (org-agenda-bulk-marked-p)
	  (unless m (user-error "Nothing to mark at point"))
	  (push m org-agenda-bulk-marked-entries)
          (setq ov (make-overlay (line-beginning-position)
                                 (+ 2 (line-beginning-position))))
          ;; Display using 'before-string to make the overlay
          ;; compatible with column view in agenda that uses an
          ;; overlay with higher priority.
          (overlay-put ov 'before-string
                       (propertize org-agenda-bulk-mark-char
                                   'face (org-get-todo-face "TODO")))
          ;; We cannot completely hide the overlay to make point
          ;; adjustment not move point out of overlay (to previous
          ;; line) when moving lines with n/p.
	  (org-overlay-display ov " " nil 'evaporate)
	  (overlay-put ov 'type 'org-marked-entry-overlay))
	(end-of-line 1)
	(or (ignore-errors
	      (goto-char (next-single-property-change (point) 'org-hd-marker)))
	    (forward-line 1))
	(while (and (get-char-property (point) 'invisible) (not (eobp)))
	  (forward-line 1)))))
  (message "%d entries marked for bulk action"
	   (length org-agenda-bulk-marked-entries)))