emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* convert a simple list of lines each to a orgmode header
@ 2015-09-28 16:52 Xebar Saram
  2015-09-29  3:30 ` Nick Dokos
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Xebar Saram @ 2015-09-28 16:52 UTC (permalink / raw)
  To: org mode

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

Hi all

im looking for a simple way to convert a simple list of lines (i can mark
it first if needed) each to a orgmode header
anyone has such a way?

best

Z

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

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-28 16:52 convert a simple list of lines each to a orgmode header Xebar Saram
@ 2015-09-29  3:30 ` Nick Dokos
  2015-09-29  5:28   ` Xebar Saram
                     ` (2 more replies)
  2015-09-29  7:44 ` Eric S Fraga
  2015-09-29  8:00 ` Michael Strey
  2 siblings, 3 replies; 13+ messages in thread
From: Nick Dokos @ 2015-09-29  3:30 UTC (permalink / raw)
  To: emacs-orgmode

Xebar Saram <zeltakc@gmail.com> writes:

> Hi all
>
> im looking for a simple way to convert a simple list of lines (i can
> mark it first if needed) each to a orgmode header anyone has such a
> way?
>

Maybe I'm missing something, but can't you just add asterisks in front
of each line? Maybe with a keyboard macro? Or even a sed script?

There's a reason that org files are plain text.

Nick

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29  3:30 ` Nick Dokos
@ 2015-09-29  5:28   ` Xebar Saram
  2015-09-29 10:46     ` Kaushal Modi
  2015-09-29  6:46   ` Christian Moe
  2015-09-29  7:17   ` Manuel Koell
  2 siblings, 1 reply; 13+ messages in thread
From: Xebar Saram @ 2015-09-29  5:28 UTC (permalink / raw)
  To: Nick Dokos; +Cc: org mode

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

Hi Nick

well yes i guess :) . but would be cool if this small function was org
aware and thus the asteriks (org header) level would be auto set to the
current sub level.

thx

z

On Tue, Sep 29, 2015 at 6:30 AM, Nick Dokos <ndokos@gmail.com> wrote:

> Xebar Saram <zeltakc@gmail.com> writes:
>
> > Hi all
> >
> > im looking for a simple way to convert a simple list of lines (i can
> > mark it first if needed) each to a orgmode header anyone has such a
> > way?
> >
>
> Maybe I'm missing something, but can't you just add asterisks in front
> of each line? Maybe with a keyboard macro? Or even a sed script?
>
> There's a reason that org files are plain text.
>
> Nick
>
>
>

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

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29  3:30 ` Nick Dokos
  2015-09-29  5:28   ` Xebar Saram
@ 2015-09-29  6:46   ` Christian Moe
  2015-09-29  7:17   ` Manuel Koell
  2 siblings, 0 replies; 13+ messages in thread
From: Christian Moe @ 2015-09-29  6:46 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode


> Xebar Saram <zeltakc@gmail.com> writes:
>
>> Hi all
>>
>> im looking for a simple way toconvert a simple list of lines (i can
>> mark it first if needed) each to a orgmode header anyone has such a
>> way?
>>
>
> Maybe I'm missing something, but can't you just add asterisks in front
> of each line? Maybe with a keyboard macro? Or even a sed script?
>
> There's a reason that org files are plain text.
>
> Nick

Mark the region and do `C-c *'?

Yours,
Christian

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29  3:30 ` Nick Dokos
  2015-09-29  5:28   ` Xebar Saram
  2015-09-29  6:46   ` Christian Moe
@ 2015-09-29  7:17   ` Manuel Koell
  2015-09-29 13:13     ` Kaushal Modi
  2 siblings, 1 reply; 13+ messages in thread
From: Manuel Koell @ 2015-09-29  7:17 UTC (permalink / raw)
  To: Nick Dokos; +Cc: org-mode mailing list

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

I know how to do in vim. Select all text and hit I (uppercase i), then
start type.
There is also a way in emacs, but I never tried before:

https://www.gnu.org/software/emacs/manual/html%5Fnode/emacs/Rectangles.html

2015-09-29 5:30 GMT+02:00 Nick Dokos <ndokos@gmail.com>:

> Xebar Saram <zeltakc@gmail.com> writes:
>
> > Hi all
> >
> > im looking for a simple way to convert a simple list of lines (i can
> > mark it first if needed) each to a orgmode header anyone has such a
> > way?
> >
>
> Maybe I'm missing something, but can't you just add asterisks in front
> of each line? Maybe with a keyboard macro? Or even a sed script?
>
> There's a reason that org files are plain text.
>
> Nick
>
>
>

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

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-28 16:52 convert a simple list of lines each to a orgmode header Xebar Saram
  2015-09-29  3:30 ` Nick Dokos
@ 2015-09-29  7:44 ` Eric S Fraga
  2015-09-29  8:00 ` Michael Strey
  2 siblings, 0 replies; 13+ messages in thread
From: Eric S Fraga @ 2015-09-29  7:44 UTC (permalink / raw)
  To: Xebar Saram; +Cc: org mode

On Monday, 28 Sep 2015 at 19:52, Xebar Saram wrote:
> Hi all
>
> im looking for a simple way to convert a simple list of lines (i can mark
> it first if needed) each to a orgmode header
> anyone has such a way?

Mark the region and then: M-% ^ <return> * SPC <return> 

The power of org: it's all text (tm)!
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.1-203-g4ca3d3

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-28 16:52 convert a simple list of lines each to a orgmode header Xebar Saram
  2015-09-29  3:30 ` Nick Dokos
  2015-09-29  7:44 ` Eric S Fraga
@ 2015-09-29  8:00 ` Michael Strey
  2015-09-29 16:43   ` Xebar Saram
  2 siblings, 1 reply; 13+ messages in thread
From: Michael Strey @ 2015-09-29  8:00 UTC (permalink / raw)
  To: emacs-orgmode

On Mo, 2015-09-28 at 18:52, Xebar Saram wrote:

> im looking for a simple way to convert a simple list of lines (i can
> mark it first if needed) each to a orgmode header
> anyone has such a way?

Mark the region and press C-c *.

-- 
Michael Strey
http://www.strey.biz * https://twitter.com/michaelstrey

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29  5:28   ` Xebar Saram
@ 2015-09-29 10:46     ` Kaushal Modi
  2015-09-30  1:27       ` Nick Dokos
  0 siblings, 1 reply; 13+ messages in thread
From: Kaushal Modi @ 2015-09-29 10:46 UTC (permalink / raw)
  To: Xebar Saram; +Cc: Nick Dokos, emacs-org list

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

I realized that the default binding `C-c *` works only on the current line,
not the whole selection (and the same applies to the opposite `C-c -`).

It would be great to have those commands work over a region too.

But in the meanwhile, you can do either of the below:

- Simply select the region and use `query-replace-regexp`.
- Use a combination of keyboard macros and `C-c *`.
- Use `multiple-cursors`.
- Any other multiple editing method you might prefer.

--
Kaushal Modi
On Sep 29, 2015 6:06 AM, "Xebar Saram" <zeltakc@gmail.com> wrote:

> Hi Nick
>
> well yes i guess :) . but would be cool if this small function was org
> aware and thus the asteriks (org header) level would be auto set to the
> current sub level.
>
> thx
>
> z
>
> On Tue, Sep 29, 2015 at 6:30 AM, Nick Dokos <ndokos@gmail.com> wrote:
>
>> Xebar Saram <zeltakc@gmail.com> writes:
>>
>> > Hi all
>> >
>> > im looking for a simple way to convert a simple list of lines (i can
>> > mark it first if needed) each to a orgmode header anyone has such a
>> > way?
>> >
>>
>> Maybe I'm missing something, but can't you just add asterisks in front
>> of each line? Maybe with a keyboard macro? Or even a sed script?
>>
>> There's a reason that org files are plain text.
>>
>> Nick
>>
>>
>>
>

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

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29  7:17   ` Manuel Koell
@ 2015-09-29 13:13     ` Kaushal Modi
  2015-09-30 17:30       ` Thierry Banel
  0 siblings, 1 reply; 13+ messages in thread
From: Kaushal Modi @ 2015-09-29 13:13 UTC (permalink / raw)
  To: Manuel Koell; +Cc: Nick Dokos, org-mode mailing list

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

Christian is correct.

Selecting a region and doing `C-c *` *does* work. Please ignore my earlier
email. I mixed up some command in org that did not work over region with
`C-c *` :)



--
Kaushal Modi

On Tue, Sep 29, 2015 at 3:17 AM, Manuel Koell <man.koell@gmail.com> wrote:

> I know how to do in vim. Select all text and hit I (uppercase i), then
> start type.
> There is also a way in emacs, but I never tried before:
>
> https://www.gnu.org/software/emacs/manual/html%5Fnode/emacs/Rectangles.html
>
> 2015-09-29 5:30 GMT+02:00 Nick Dokos <ndokos@gmail.com>:
>
>> Xebar Saram <zeltakc@gmail.com> writes:
>>
>> > Hi all
>> >
>> > im looking for a simple way to convert a simple list of lines (i can
>> > mark it first if needed) each to a orgmode header anyone has such a
>> > way?
>> >
>>
>> Maybe I'm missing something, but can't you just add asterisks in front
>> of each line? Maybe with a keyboard macro? Or even a sed script?
>>
>> There's a reason that org files are plain text.
>>
>> Nick
>>
>>
>>
>

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

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29  8:00 ` Michael Strey
@ 2015-09-29 16:43   ` Xebar Saram
  0 siblings, 0 replies; 13+ messages in thread
From: Xebar Saram @ 2015-09-29 16:43 UTC (permalink / raw)
  To: Michael Strey; +Cc: org mode

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

C-c * is perfect!

thx so much

z

On Tue, Sep 29, 2015 at 11:00 AM, Michael Strey <mstrey@strey.biz> wrote:

> On Mo, 2015-09-28 at 18:52, Xebar Saram wrote:
>
> > im looking for a simple way to convert a simple list of lines (i can
> > mark it first if needed) each to a orgmode header
> > anyone has such a way?
>
> Mark the region and press C-c *.
>
> --
> Michael Strey
> http://www.strey.biz * https://twitter.com/michaelstrey
>
>
>

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

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29 10:46     ` Kaushal Modi
@ 2015-09-30  1:27       ` Nick Dokos
  2015-10-01  0:07         ` Kaushal Modi
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2015-09-30  1:27 UTC (permalink / raw)
  To: emacs-orgmode

Kaushal Modi <kaushal.modi@gmail.com> writes:

> I realized that the default binding `C-c *` works only on the current line, not the whole selection (and the same applies to the opposite `C-c -`).
>
> It would be great to have those commands work over a region too.
>

I don't think that's right - at least, when I tried it with a region, it
worked. I just didn't know about it (or, more likely, didn't remember it)
before Christian mentioned it.

The docstring for the function says:

,----
| org-toggle-heading is an interactive Lisp function in
| ‘../org-mode/lisp/org.el’.
| 
| (org-toggle-heading &optional NSTARS)
| 
| Convert headings to normal text, or items or text to headings.
| If there is no active region, only convert the current line.
`----

Is transient mark mode enabled? I think it's enabled by default
nowadays, but maybe you turned it off?

Nick

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-29 13:13     ` Kaushal Modi
@ 2015-09-30 17:30       ` Thierry Banel
  0 siblings, 0 replies; 13+ messages in thread
From: Thierry Banel @ 2015-09-30 17:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/html, Size: 1438 bytes --]

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

* Re: convert a simple list of lines each to a orgmode header
  2015-09-30  1:27       ` Nick Dokos
@ 2015-10-01  0:07         ` Kaushal Modi
  0 siblings, 0 replies; 13+ messages in thread
From: Kaushal Modi @ 2015-10-01  0:07 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-org list

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

Thanks Nick, I confirmed later that `C-c *` worked over region for me too.


--
Kaushal Modi

On Tue, Sep 29, 2015 at 9:27 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Kaushal Modi <kaushal.modi@gmail.com> writes:
>
> > I realized that the default binding `C-c *` works only on the current
> line, not the whole selection (and the same applies to the opposite `C-c
> -`).
> >
> > It would be great to have those commands work over a region too.
> >
>
> I don't think that's right - at least, when I tried it with a region, it
> worked. I just didn't know about it (or, more likely, didn't remember it)
> before Christian mentioned it.
>
> The docstring for the function says:
>
> ,----
> | org-toggle-heading is an interactive Lisp function in
> | ‘../org-mode/lisp/org.el’.
> |
> | (org-toggle-heading &optional NSTARS)
> |
> | Convert headings to normal text, or items or text to headings.
> | If there is no active region, only convert the current line.
> `----
>
> Is transient mark mode enabled? I think it's enabled by default
> nowadays, but maybe you turned it off?
>
> Nick
>
>
>
>
>

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

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

end of thread, other threads:[~2015-10-01  0:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 16:52 convert a simple list of lines each to a orgmode header Xebar Saram
2015-09-29  3:30 ` Nick Dokos
2015-09-29  5:28   ` Xebar Saram
2015-09-29 10:46     ` Kaushal Modi
2015-09-30  1:27       ` Nick Dokos
2015-10-01  0:07         ` Kaushal Modi
2015-09-29  6:46   ` Christian Moe
2015-09-29  7:17   ` Manuel Koell
2015-09-29 13:13     ` Kaushal Modi
2015-09-30 17:30       ` Thierry Banel
2015-09-29  7:44 ` Eric S Fraga
2015-09-29  8:00 ` Michael Strey
2015-09-29 16:43   ` Xebar Saram

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).