Monday, June 13, 2016

Re: Spellcheck after Ellipsis again [vim bug found?]

\documentclass[12pt]{article}
\usepackage{here}
\pagestyle{empty}
\title{nothing}

\newcommand{\GPS}{{\small GPS}}
\newcommand{\NASA}{{\small NASA}}

% Textwidth and textheight specification
\newtheorem{example}{Example}[section]
\newcommand{\widepage}{
\setlength{\topmargin}{0.0in}
\setlength{\textheight}{8.75in}
\setlength{\footskip}{0.25in}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}
}
\widepage

\newfont{\smit}{cmsl10 scaled\magstephalf}
\newtheorem{alg}{Algorithm}
\def\qed{\quad \vrule height7.5pt width4.17pt depth0pt} %Thanks to Ed Perkins (\qed)

% Uncomment following line. Put the second line just after each \section, then
% equations will be numbered with section.eqn-number.
%\renewcommand{\theequation}{\thesection.\arabic{equation}}
%\setcounter{equation}{0}

\begin{document}

normal words
mispeling
... xyz
mispeling
normal words

\end{document}
% vim: syn=tex
David Woodfall wrote:
>> David Woodfall wrote:
>>> syn sync fromstart
>>> syn match Ellipsis /[.][.][.]\s\+\l.*\>/ contains=@NoSpell transparent
>>> syn match Ellipsis2 /[.][.][.]\n\s\+\l.*\>/ contains=@NoSpell
>>> transparent
>>> syn cluster Spell add=Ellipsis
>>> syn cluster Spell add=Ellipsis2
>>>
>>> syn cluster texDocGroup add=Ellipsis
>>> syn cluster texPartGroup add=Ellipsis
>>> syn cluster texChapterGroup add=Ellipsis
>>> syn cluster texSectionGroup add=Ellipsis
>>> syn cluster texSubSectionGroup add=Ellipsis
>>> syn cluster texSubSubSectionGroup add=Ellipsis
>>> syn cluster texParaGroup add=Ellipsis
>>>
>>> syn cluster texDocGroup add=Ellipsis2
>>> syn cluster texPartGroup add=Ellipsis2
>>> syn cluster texChapterGroup add=Ellipsis2
>>> syn cluster texSectionGroup add=Ellipsis2
>>> syn cluster texSubSectionGroup add=Ellipsis2
>>> syn cluster texSubSubSectionGroup add=Ellipsis2
>>> syn cluster texParaGroup add=Ellipsis2
>> Please try the attached file instead; place in your $HOME/syntax
>> directory. I tried it with the attached "junk.tex" file.
>>
>> Regards,
>> Chip Campbell
>
> Thanks. That works on .tex files but on a txt file with syn=tex in the
> modeline still messes up unless I also put ft=tex in the modeline.
>
> This is where it is falling down.
>
I haven't used the syntax option before. It sounded like a
sourcing/sequencing problem, so I ran vim -V10tmp junk.txt (after
renaming junk.tex to junk.txt and appending the % vim: syn=tex
modeline). I then used ":g/sourcing.*tex\.vim and got:

line 24: sourcing "/home/cec/.SW/VIM/vim74/runtime/syntax/tex.vim"
finished sourcing /home/cec/.SW/VIM/vim74/runtime/syntax/tex.vim
line 24: sourcing "/home/cec/.vim/after/syntax/tex/tex.vim"
finished sourcing /home/cec/.vim/after/syntax/tex/tex.vim
line 24: sourcing "/home/cec/.vim/syntax/tex.vim"
finished sourcing /home/cec/.vim/syntax/tex.vim
line 24: sourcing "/home/cec/.SW/VIM/vim74/runtime/syntax/tex.vim"
finished sourcing /home/cec/.SW/VIM/vim74/runtime/syntax/tex.vim
line 24: sourcing "/home/cec/.vim/after/syntax/tex/tex.vim"
finished sourcing /home/cec/.vim/after/syntax/tex/tex.vim

You'll see that the runtime syntax/tex.vim got sourced again, which
wiped out the effects of .vim/syntax/tex.vim . Furthermore,
.vim/syn/tex.vim was not sourced a second time, so its directives were
effectively lost.
I'm not sure if this is a vim bug or not (after/syntax/tex/tex.vim is
unrelated and something I use). I suggest moving the
$HOME/syntax/tex.vim to $HOME/after/syntax/tex/tex.vim.
I don't have time to try that out.

Regards,
Chip Campbell

P.S. I've attached junk.txt and tex.vim for any who want to try it out.
The question is: should $HOME/syntax/tex.vim be sourced when the
modeline syn=tex is used?

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: