[patch] Fix modeline of some documents

23 views
Skip to first unread message

h_east

unread,
Oct 5, 2018, 12:58:15 AM10/5/18
to vim_dev
Hi Bram and list,

The following documents sets 'formatoptions' in modeline.

runtime/doc/help.txt
runtime/doc/os_390.txt
runtime/doc/os_win32.txt

"fo=tcq2:"

Even if write "set fo+=mM" in my .vimrc, it will be overwritten with this modeline.
When I apply this modeline to a doc/*.txt translated file (e.g. *.jax), It will not work well for editing.
So I currently applied the exclude "fo=tcq2:" from modeline.
If possible, I want to prevent the difference of modeline between .txt and .jax.

Could you change "fo=tcq2:" to "fo+=2:" ?
Please include an attached patch.

--
Best regards,
Hirohito Higashi (h_east)

fix_doc_modeline.patch

Tony Mechelynck

unread,
Oct 5, 2018, 12:52:53 PM10/5/18
to vim_dev
Options set by modeline are always set as if by :setlocal, and since
'formatoptions' is a buffer-local option, it will not override
whatever you set for other files. (Modelines, or the :setlocal
command, will only override your global options if they mention a
global-only option.)

Now none of the mentioned helpfiles is in CJK hanzi/kanji/hanja - kana
- hangeul so ":selocal fo+=mM" is, for them, not necessary and even
IMHO possibly harmful. OTOH for translations of the same helpfiles it
is IMHO the translator's business to adapt the modelines as needed by
the target language and writing system, and for instance to add mM to
the formatoptions in the modelines of CJK translated helpfiles. There
is absolutely no requirement that the modelines for Japanese, Korean,
Chinese-Simplified or Chinese-Traditional helpfiles be exactly
identical to those for the English-US ones; and in particular if
Russian or Hebrew translators reasoned the way you do, they would want
to set fo-=mM on _their_ translated helpfiles to make sure that
separate words are kept separate when anyone edits their Russian or
Hebrew text even if they do it in UTF-8 (where Russian and Hebrew use
multibyte characters above U+00FF) rather than some 8-bit 'encoding'
targeting their specific language. ;-)

BTW, Esperanto uses Latin script, but with the letters Ĉĉ Ĝĝ Ĥĥ Ĵĵ Ŝŝ
Ŭŭ which are above U+00FF, and even though those same letters also
exist in ISO-8859-3, AFAIK most Esperantists prefer "universal"
Unicode, which can also encode their native language whatever it might
be, over that "Turkish - Maltese - Esperanto" 8-bit charset, which
possibly cannot. (Proportionately more Russians might still prefer
8-bit charsets cp866, KOI8-R or ISO/IEC 8859-5, and similarly mutatis
mutandis for Hebrew; but Unicode's "market share" is rising together
with the globalization of EDP.)

Best regards,
Tony.

Bram Moolenaar

unread,
Oct 5, 2018, 1:58:02 PM10/5/18
to vim...@googlegroups.com, h_east
I think we can leave out setting 'fo' completely. It's already set from
the help ftplugin (which you can overrule) and the "2" isn't really
needed for these files. It's only needed for a paragraph style where
the second line has a different indent from the first line, which I
don't see in these files.


--
hundred-and-one symptoms of being an internet addict:
152. You find yourself falling for someone you've never seen or hardly
know, but, boy can he/she TYPE!!!!!!

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

h_east

unread,
Oct 6, 2018, 3:06:31 AM10/6/18
to vim_dev
Hi Tony,

2018-10-6(Sat) 1:52:53 UTC+9 Tony Mechelynck:
Your point is slightly out of alignment.
Perhaps it was hard to understand the sentences I wrote.
My main point is below.

> > If possible, I want to prevent the difference of modeline between .txt and .jax.

I am mentioning that Japanese translators will edit *.jax.
Reply all
Reply to author
Forward
0 new messages