Inhibiting numbered list recognition with auto-format

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inhibiting numbered list recognition with auto-format

martin f krafft-2
Hi folks,

I am using Vim successfully for composing format=flowed emails (for
mutt), i.e. I have formatoptions+=aw in place. I also use
$formatlistpat, and now I often get into the situation wherein an
abbreviation like "e.g." or "i.e." or whatever at the start of a
line makes Vim thinks it's a numbered list within a flowed
paragraph. Here's an example, and I'm using the '·' character to
highlight the trailing/leading spaces of the lines:

  This is an example to show how using Vim to compose a·
  format=flowed email can yield problems when abbreviations like·
  e.g. are used and end up at the start of a line, because it'll·
  ·····make Vim think that there's a numbered list starting.

I understand why this is happening, but I'd say that it shouldn't
happen in cases where the previous line ended with a trailing space,
at least not if $formatoptions includes 'w'.

Unfortunately, I cannot seem to get $formatlistpat to recognise
context across linebreaks.

The relevant configuration I'm using is:

  formatlistpat=^\v\s*(((\a|\d{,4})[]:.)}/-])+|[-\*.·→+])\s+
  formatoptions=tcqawn
  autoindent

Do you see any way to prevent the auto-indentation from happening in
the middle of format=flowed paragraphs?

Thanks,

--
@martinkrafft | <a href="https://riot.im/app/#/room/#madduck:madduck.net">https://riot.im/app/#/room/#madduck:madduck.net
 
"i dislike arguments of any kind. they are always vulgar, and often
 convincing."
                                                      -- oscar wilde
 
spamtraps: [hidden email]

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190611022336.GA7716%40fishbowl.rw.madduck.net.
For more options, visit https://groups.google.com/d/optout.

digital_signature_gpg.asc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inhibiting numbered list recognition with auto-format

Ruben Safir
On 6/10/19 10:23 PM, martin f krafft wrote:
>
>  formatlistpat=^\v\s*(((\a|\d{,4})[]:.)}/-])+|[-\*.·→+])\s+

can you expound on this?


--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/18566b6b-38cb-d591-23c0-2f14abbdf826%40my.liu.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Inhibiting numbered list recognition with auto-format

martin f krafft-2
Quoting "Ruben Safir", who wrote on 2019-06-11 at 23:30 Uhr -0400:
>>  formatlistpat=^\v\s*(((\a|\d{,4})[]:.)}/-])+|[-\*.·→+])\s+
>can you expound on this?

It's my regular expression to capture all the different ways I might use to
enumerate lists.

What do you mean by "expound"?

Using ExplainPattern?

Pattern: ^\v\s*(((\a|\d{,4})[]:.)}/-])+|[-\*.·→+])\s+
Magic Pattern: ^\s*\(\(\(\a\|\d\{,4}\)[]:.)}/-]\)\+\|[-\*.·→+]\)\s\+
  ^          (assertion) require match at start of line
  \s         whitespace character: <Space> and <Tab>
  *          (multi) zero or more of the preceding atom
  \(         start of first capturing group
  |   \(         start of second capturing group
  |   |   \(         start of third capturing group
  |   |   |   \a         alphabetic character: [A-Za-z]
  |   |   | \|         OR (separate alternatives)
  |   |   |   \d         digit: [0-9]
  |   |   |   \{,4}      (multi) N to M, greedy
  |   |   \)         end of group
  |   |   []:.)}/-]  collection
  |   \)         end of group
  |   \+         (multi) one or more of the preceding atom
  | \|         OR (separate alternatives)
  |   [-\*.·→+] collection
  \)         end of group
  \s         whitespace character: <Space> and <Tab>
  \+         (multi) one or more of the preceding atom

--
@martinkrafft | <a href="https://riot.im/app/#/room/#madduck:madduck.net">https://riot.im/app/#/room/#madduck:madduck.net
 
"the surest way to corrupt a youth is to instruct him to hold in
 higher esteem those who think alike than those who think
 differently."
                                              -- friedrich nietzsche
 
spamtraps: [hidden email]

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190612123454.GA20241%40fishbowl.rw.madduck.net.
For more options, visit https://groups.google.com/d/optout.

digital_signature_gpg.asc (1K) Download Attachment