emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] uncommnet-region behavior in org-src blocks


From: Ken Mankoff
Subject: Re: [O] uncommnet-region behavior in org-src blocks
Date: Sat, 19 Mar 2016 14:07:23 -0400
User-agent: mu4e 0.9.17; emacs 24.5.1

On 2016-03-19 at 13:20, Eric S Fraga <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]