org-mode support?
Hi
thx for this cool package!
Was wondering if you would consider support for smart commenting in org-mode code blocks (comment all block, comment line etc(?
thx again!
Z
Hello.
You're very welcome :smile: I am not sure if I completely understand. smart-comment should support org-mode. It will insert # as a comment character which is what org-mode uses.
If you want the correct commenting for code in a code block I think you will have to use C-c ' (org-edit-special). This will edit the code block in the correct major mode.
If there is a better way let me know!
Thx for the quick reply :)
sorry for not explaining correctly. im more interested in commenting inside org-mode code blocks. it does work perfectly in the normal org buffer. for example if i create a orgmode lisp code block like this
#+BEGIN_SRC emacs-lisp :results none
bind ("M-;" . smart-comment)
(add-to-list 'load-path "~/emacs.d")
(require 'smart-comment)
(global-set-key (kbd "M-;") 'smart-comment)
#+END_SRC
and i stand on the first line (bind) and issue smart comment it dosent comment the line but adds the comment at the end of the line for some reason (bug?).
also would be great to add an option with a modifier to comment whole block (is that possible?)
finally not related to org, would be cool to add an option to duplicate line and comment above line
thx so much again for this very nifty tool :)
best
Z
@zeltak If you don't already have it, you might find expand-region handy. I have it bound to M-2, so it's right above M-w, which is handy for copying. Also I can put the cursor on the begin_src line, hit M-2 a couple of times, then M-; to comment the block.
thx alphapapa
yeah i have been using it but thats a good tip, and generally your packages kick ass ;-)
best
Z
@alphapapa I agree. expand-region has er/mark-org-code-block. I think using that is best.
@paldepind I didn't realize it had that function. Always something new to learn about Emacs stuff. :)