Function: org-agenda-forward-block

org-agenda-forward-block is an interactive and byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-forward-block &optional BACKWARD)

Documentation

Move forward by one agenda block.

When optional argument BACKWARD is set, go backward.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-forward-block (&optional backward)
  "Move forward by one agenda block.
When optional argument BACKWARD is set, go backward."
  (interactive)
  (cond ((not (derived-mode-p 'org-agenda-mode))
	 (user-error
	  "Cannot execute this command outside of org-agenda-mode buffers"))
	((looking-at (if backward "\\`" "\\'"))
	 (message "Already at the %s block" (if backward "first" "last")))
	(t (let ((_pos (prog1 (point)
			 (ignore-errors (if backward (backward-char 1)
					  (move-end-of-line 1)))))
		 (f (if backward
			#'previous-single-property-change
		      #'next-single-property-change))
		 moved dest)
	     (while (and (setq dest (funcall
				     f (point) 'org-agenda-structural-header))
			 (not (get-text-property
			       (point) 'org-agenda-structural-header)))
	       (setq moved t)
	       (goto-char dest))
	     (if moved (move-beginning-of-line 1)
	       (goto-char (if backward (point-min) (point-max)))
	       (move-beginning-of-line 1)
	       (message "No %s block" (if backward "previous" "further")))))))