all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Super indent when editing R blocks and using a # comment
@ 2016-01-28 21:58 John Hendy
  2016-01-28 22:21 ` Ista Zahn
  0 siblings, 1 reply; 3+ messages in thread
From: John Hendy @ 2016-01-28 21:58 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

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

[-- Attachment #2: 2016-01-28_155416.png --]
[-- Type: image/png, Size: 70019 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Super indent when editing R blocks and using a # comment
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Ista Zahn @ 2016-01-28 22:21 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

I'm pretty sure that's standard ess indentation. I don't think it has
anything to do with org mode.

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
>

[-- Attachment #2: Type: text/html, Size: 1737 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Super indent when editing R blocks and using a # comment
  2016-01-28 22:21 ` Ista Zahn
@ 2016-01-28 22:52   ` John Hendy
  0 siblings, 0 replies; 3+ messages in thread
From: John Hendy @ 2016-01-28 22:52 UTC (permalink / raw)
  To: Ista Zahn; +Cc: emacs-orgmode Mailinglist

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-28 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.