[O] org-capture: how to unindent %i?

2018-07-11 Thread Shuguang Sun
Hi,


I'm using the org-caputre with a org-capture-templates which I want to use 
capture a region. "%i" will apply the indent. Is there a %-escapes which will 
not indent the content but just make a proper level header?



(add-to-list 'org-capture-templates
 '("R" "check indent" entry
   (file+headline "~/.emacs.d/.notes/.notes.org" "Notes")
  "* %?\n%i\n\n%l\n%:type %:url\n%F\nAdded: %U" :empty-lines-before 1 
:empty-lines-after 1))



1. "Notes" is the level 1 header, and captured content will become level 2 
header under it, which means a "*" will be added at the begining, like "** 
[cursor]"

2. %i is the indedted initial content. If I capture a marked region, e.g., "a 
marked region" in a buffer, it will be caputred as initial content, and it 
becomes:
** [cursor]
[space]a marked region


A space is added automatically as indentation because a "*" added to the 
header. What I need is just to make a level 2 header, but not add a space to 
the content, e.g.:
** [cursor]a marked region



Best Regards,
Shuguang

[O] How to use org src functions in other major mode (markdow)?

2013-12-30 Thread Shuguang Sun
Dear all,

Is it possible to use org src functions in other major mode, e.g.,
markddown-mode?

In some extend markdown, source code can be put in to block, for example,
r-mode for R script

```r
x <- 1:10
```

Is it possible to highlight the block as org-block "#begion_src R"? How to
run org-edit-src-code on such markdown blocks?

Best Regards,
Shuguang Sun