emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Super indent when editing R blocks and using a # comment


From: John Hendy
Subject: Re: [O] Super indent when editing R blocks and using a # comment
Date: Thu, 28 Jan 2016 16:52:31 -0600

On Thu, Jan 28, 2016 at 4:21 PM, Ista Zahn <address@hidden> wrote:
> I'm pretty sure that's standard ess indentation. I don't think it has
> anything to do with org mode.

Yikes. Hadn't occurred to me to just check ess directly, and I
completely assumed this was org related. Thanks for the reply, as a
google revealed this gem:
- 
http://stackoverflow.com/questions/780796/emacs-ess-mode-tabbing-for-comment-region

Short summary:
- # indents to the 40th character
- ## indents to the current indent level
- ### leaves the comment where it is

Sorry for the noise and thanks for pointing me in the right direction!


John

>
> Best,
> Ista
>
> On Jan 28, 2016 4:59 PM, "John Hendy" <address@hidden> wrote:
>>
>> Find attached a screenshot of the behavior I'm experiencing with this
>> minimal config and =emacs -Q=.
>>
>> #+begin_src min-config
>>
>> ;; set load paths
>> ;; set load dirs and global config options
>> (add-to-list 'load-path "~/.elisp/org.git/lisp/")
>> (add-to-list 'load-path "~/.elisp/org.git/contrib/lisp")
>> (add-to-list 'load-path "~/.elisp/ess/lisp/")
>>
>> (require 'ess-site)
>>
>> ;; setup babel languages
>> (org-babel-do-load-languages
>>  'org-babel-load-languages
>>  '((R . t)))
>>
>> #+end_src
>>
>> As shown in the shot:
>> - create a .org file, insert a #+begin/end_src R block
>> - edit with =C-c '=
>> - start a line with a comment char (#)
>> - press RET
>> - it gets indented halfway across the page
>>
>> Inside a function, it seems to use a default of four spaces (the
>> position of =return(i^2)=), so I'm not sure why a comment triggers
>> such a massive indent. I end up having to delete the preceding spaces
>> or be super careful about having a newline already inserted so that I
>> can arrow down instead of pressing RET at the end of a comment line.
>>
>>
>> Thanks for any insights!
>> John



reply via email to

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