Преглед изворни кода

Handle comments in source blocks with `comment-line'

* lisp/org.el (org-comment-or-uncomment-region): Caller is not
  necessarily `comment-dwim'.  Also handle `comment-line'.

Reported-by: Xebar Saram <zeltakc@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109809>
Nicolas Goaziou пре 8 година
родитељ
комит
21c6148bbe
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      lisp/org.el

+ 7 - 1
lisp/org.el

@@ -23526,7 +23526,13 @@ strictly within a source block, use appropriate comment syntax."
 		   (skip-chars-backward " \r\t\n")
 		   (line-beginning-position))
 		 end)))
-      (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
+      ;; Translate region boundaries for the Org buffer to the source
+      ;; buffer.
+      (let ((offset (- end beg)))
+	(save-excursion
+	  (goto-char beg)
+	  (org-babel-do-in-edit-buffer
+	   (comment-or-uncomment-region (point) (+ offset (point))))))
     (save-restriction
       ;; Restrict region
       (narrow-to-region (save-excursion (goto-char beg)