* 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:
parent
089fda1219
commit
1014296344
|
@ -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))))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue