* lisp/org.el (org-comment-dwim): Rely on `org-comment-or-uncomment-region'

Remove special case for src block and instead use the Org's
`org-comment-or-uncomment-region' used as `comment-region-function'.
`org-comment-or-uncomment-region' already supports commenting inside
src blocks.

Fixes https://orgmode.org/list/d8dc0cca-00d9-4349-a123-6ea6776b00cc@vodafonemail.de
This commit is contained in:
Ihor Radchenko 2023-11-06 11:14:29 +02:00
parent 089fda1219
commit 1014296344
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 3 deletions

View File

@ -20136,12 +20136,10 @@ strictly within a source block, use appropriate comment syntax."
(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."
`comment-dwim'."
(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))))