Function: org-comment-dwim

org-comment-dwim is an interactive and byte-compiled function defined in org.el.gz.

Signature

(org-comment-dwim ARG)

Documentation

Call the comment command you mean.

Call org-toggle-comment if on a heading, otherwise call comment-dwim, within a source edit buffer if needed.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-comment-dwim (_arg)
  "Call the comment command you mean.
Call `org-toggle-comment' if on a heading, otherwise call
`comment-dwim', within a source edit buffer if needed."
  (interactive "*P")
  (cond ((org-at-heading-p)
	 (call-interactively #'org-toggle-comment))
	((org-in-src-block-p)
	 (org-babel-do-in-edit-buffer (call-interactively #'comment-dwim)))
	(t (call-interactively #'comment-dwim))))