help-nano
[Top][All Lists]
Advanced

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

Re: Match <div and </div>


From: Benno Schulenberg
Subject: Re: Match <div and </div>
Date: Wed, 25 Jan 2023 12:53:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2


Op 25-01-2023 om 07:38 schreef Seb:
This code didn't work for me, [...]

Ah, yes.  I forgot that the control codes need to be "escaped": they
need to be entered verbatim at the prompt.  But for some reason the
{verbatim} function does not work.  :/

What does work is a literal M-V (^[v, where ^[ is a literal escape).
So this works (tested):

  bind M-B "{replace}<div{enter}^[v^Q{enter}A
            {replace}</div{enter}^[v^R{enter}A
            {replace}<form{enter}^[v^S{enter}A
            {replace}</form{enter}^[v^T{enter}A
            {findbracket}
            {replace}^[v^T{enter}</form{enter}A
            {replace}^[v^S{enter}<form{enter}A
            {replace}^[v^R{enter}</div{enter}A
            {replace}^[v^Q{enter}<div{enter}A
            {left}{right}" main

(When using 'set matchbrackets "(<[{«^Q^S)>]}»^R^T"', of course.)

Of course, the above is majorly ugly -- it's better to use some
normal, printable characters that you don't use in the documents.


The failure of {verbatim} has been reported here:
  https://savannah.gnu.org/bugs/?63702

Benno

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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