[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Spellchecking language
From:       "Philipp A." <flying-sheep () web ! de>
Date:       2014-02-28 10:19:31
Message-ID: CAN8d9gkNCiUuQT3t9eHPUp_h+CbfSvO1eohzM8N+u2MbE6mt2g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi, does KatePart only use the configured default language ir is it smarter?

If it isn't, let's add language directives to syntax highlighting files,
modelines, and project configurations.

modelines and project conf are straight forward: just add a lang[uage] key.
modeline overrides project config.

the easiest for syntax highlighting files is just to allow a rule to catch
and assign a global language. the second level would be switches within the
document. the most powerful one would be that we extend contexts to
optionally have a language: once a context with a language gets popped, the
currently switched-to language is used. if there's no switched-to language,
we use the global one.

e.g. in a fictional TeX dialect:

\documentlanguage{en}
\begin{document}

this text is english
\language{de} % global switch

dieser text ist deutsch
\lang{fr}{ce texte est le français} %sorry, that one was google translate.

dieser text ist wieder deutsch
\end{document}

[Attachment #5 (text/html)]

<div dir="ltr"><div style class="markdown-here-wrapper" id="markdown-here-wrapper-678543"><p \
style="margin:1.2em 0px!important">Hi, does KatePart only use the configured default language ir is it \
smarter?</p> <p style="margin:1.2em 0px!important">If it isn't, let's add language directives to syntax \
highlighting files, modelines, and project configurations.</p> <p style="margin:1.2em \
0px!important">modelines and project conf are straight forward: just add a lang[uage] key. modeline \
overrides project config.</p> <p style="margin:1.2em 0px!important">the easiest for syntax highlighting \
files is just to allow a rule to catch and assign a global language. the second level would be switches \
within the document. the most powerful one would be that we extend contexts to optionally have a \
language: once a context with a language gets popped, the currently switched-to language is used. if \
there's no switched-to language, we use the global one.</p>


<p style="margin:1.2em 0px!important">e.g. in a fictional TeX dialect:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em \
0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px \
solid rgb(204,204,204);padding:0.5em \
0.7em;display:block!important;display:block;padding:0.5em;color:rgb(51,51,51);background:none repeat \
scroll 0% 0% rgb(248,248,255)" class="language-tex"><span class="command">\documentlanguage</span><span \
class="special">{</span>en<span class="special">}</span>

<span class="command">\begin</span><span class="special">{</span>document<span class="special">}</span>

this text is english

<span class="command">\language</span><span class="special">{</span>de<span class="special">}</span> \
<span style="color:rgb(153,153,136);font-style:italic" class="comment">% global switch</span>

dieser text ist deutsch

<span class="command">\lang</span><span class="special">{</span>fr<span class="special">}</span><span \
class="special">{</span>ce texte est le français<span class="special">}</span> <span \
style="color:rgb(153,153,136);font-style:italic" class="comment">%sorry, that one was google \
translate.</span>

dieser text ist wieder deutsch

<span class="command">\end</span><span class="special">{</span>document<span class="special">}</span>
</code></pre>
</div></div>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic