emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [patch] ox-latex.el: fix blank lines behavior in verse block


From: Ihor Radchenko
Subject: Re: [patch] ox-latex.el: fix blank lines behavior in verse block
Date: Sun, 13 Aug 2023 08:06:27 +0000

Juan Manuel Macías <maciaschain@posteo.net> writes:

>>> +               (concat "\\("
>>> +                       (regexp-quote org-latex-line-break-safe)
>>> +                       "\n\\)"
>>> +                       "\\(^[ \t]*"
>>> +                       (regexp-quote org-latex-line-break-safe)
>>> +                       "\n"
>>> +                       "\\)+")
>>> +             (concat "^[ \t]*" (regexp-quote org-latex-line-break-safe) 
>>> "$"))
>>
>> May also use rx for better readability.
>
> I remember that I tried rx a while ago and found it very useful and
> comfortable, but then I haven't done anything with it. The fact is that
> over time I have ended up getting used to suffering from the classic
> regexp and it is hard for me to get out of there :-). Of course, with rx
> it would be clearer but I would have to refresh my memory.

You can refer to [[info:elisp#Rx Constructs][elisp#Rx Constructs]]
I think your regexp in rx should look like

(rx-to-string `(seq (group ,org-latex-line-break-safe "\n")
                    (1+ (group line-start (0+ space) ,org-latex-line-break 
"\n"))))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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