From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: uncommnet-region behavior in org-src blocks Date: Sat, 19 Mar 2016 14:07:23 -0400 Message-ID: References: <87k2ky8jwd.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahLHb-0002yV-Sj for emacs-orgmode@gnu.org; Sat, 19 Mar 2016 14:07:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahLHa-0001IY-Sy for emacs-orgmode@gnu.org; Sat, 19 Mar 2016 14:07:27 -0400 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]:34942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahLHa-0001IR-Oh for emacs-orgmode@gnu.org; Sat, 19 Mar 2016 14:07:26 -0400 Received: by mail-qg0-x230.google.com with SMTP id y89so126714142qge.2 for ; Sat, 19 Mar 2016 11:07:26 -0700 (PDT) In-reply-to: <87k2ky8jwd.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric S Fraga Cc: Org-Mode mailing list , John Kitchin On 2016-03-19 at 13:20, Eric S Fraga wrote: > On Saturday, 19 Mar 2016 at 12:44, John Kitchin wrote: >> I noticed that you try to uncomment a region in a src block a # gets >> inserted! >> >> #+BEGIN_SRC emacs-lisp >> ; test >> #+END_SRC >> >> >> If you select ; test and run uncomment-region you get this: >> >> #+BEGIN_SRC emacs-lisp >> # ; test >> #+END_SRC >> >> It also does that in Python. Any ideas why? > > Because you're in org mode, not emacs-lisp or python? If you want to > comment/uncomment codes within a src block, my guess is you would need > to open up the blocks (C-c ') and then comment/uncomment... https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00318.html #+BEGIN_SRC emacs-lisp :results none ;; allow comment region in the code edit buffer (according to language) (defun my-org-comment-dwim (&optional arg) (interactive "P") (or (org-babel-do-key-sequence-in-edit-buffer (kbd "M-;")) (comment-dwim arg))) ;; make `C-c C-v C-x M-;' more convenient (define-key org-mode-map (kbd "M-;") 'my-org-comment-dwim) #+END_SRC -k.