Function: org-speed-move-safe

org-speed-move-safe is an interactive and byte-compiled function defined in org-keys.el.gz.

Signature

(org-speed-move-safe CMD)

Documentation

Execute CMD, but make sure that the cursor always ends up in a headline.

If not, return to the original position and throw an error.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-keys.el.gz
(defun org-speed-move-safe (cmd)
  "Execute CMD, but make sure that the cursor always ends up in a headline.
If not, return to the original position and throw an error."
  (interactive)
  (let ((pos (point)))
    (call-interactively cmd)
    (unless (and (bolp) (org-at-heading-p))
      (goto-char pos)
      (error "Boundary reached while executing %s" cmd))))