emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Ista Zahn <istazahn@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Super indent when editing R blocks and using a # comment
Date: Thu, 28 Jan 2016 16:52:31 -0600	[thread overview]
Message-ID: <CA+M2ft_EzVRx0DwsLGzxTwUBaH9cVm4uFLVMe4VJFtQXbYGgzA@mail.gmail.com> (raw)
In-Reply-To: <CA+vqiLH_7GkY-Ba43OnytR7HPt-ZF5L_aw9iiEtY1tgjFigHaA@mail.gmail.com>

On Thu, Jan 28, 2016 at 4:21 PM, Ista Zahn <istazahn@gmail.com> 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" <jw.hendy@gmail.com> 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	other threads:[~2016-01-28 22:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 21:58 Super indent when editing R blocks and using a # comment John Hendy
2016-01-28 22:21 ` Ista Zahn
2016-01-28 22:52   ` John Hendy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+M2ft_EzVRx0DwsLGzxTwUBaH9cVm4uFLVMe4VJFtQXbYGgzA@mail.gmail.com \
    --to=jw.hendy@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=istazahn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).