[Top][All Lists]

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

Re: how to convert a non-org list to org headings

From: Uwe Brauer
Subject: Re: how to convert a non-org list to org headings
Date: Wed, 06 Jul 2022 21:55:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> On 2022-07-06, at 17:31, Kaushal Modi <kaushal.modi@gmail.com> wrote:

> No period after "1.1" above - makes things slightly more difficult.

Right, I repaired those manually before running queery resplace 

> This might be a bit overzealous if there are more numbers with a period
> after them.  Another way would be to add ^\(\**\) at the beginning of
> the regex (and a \1 in the replacement) and go through the file as many
> times as there are nesting levels.

Ah ok, but right now Kaushal's proposed solution is good enough for me

> You could also try Elisp as the replacement - see
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html,
> https://www.masteringemacs.org/article/evaluating-lisp-forms-regular-expressions
> and
> http://mbork.pl/2013-09-18_Selective_replacement_in_LaTeX_documents_(en) .

> You could probably use keyboard macros, too - see e.g.
> http://mbork.pl/2021-02-20_Using_keyboard_macros_to_emulate_query_replace .

I thought about this, but usually I end up faster using a function (or
query replace) there was a time a liked keyboards macros, but now I find
them a bit dangerous.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

reply via email to

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