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

List:       lyx-devel
Subject:    Re: annoying behavior of Lyx 2.02+ -- Language toggle
From:       Ronen Abravanel <ronena () gmail ! com>
Date:       2012-04-27 15:33:46
Message-ID: CACTp8RiUenHc1jJuAxTCOSSY0RR+8TL5Vw5EchSzZ=Wt5Kv4xw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


And a patch that perform my suggestion is attachted.

Ronen Abravanel



On Fri, Apr 27, 2012 at 6:04 PM, Ronen Abravanel <ronena@gmail.com> wrote:

> It seems the change was done in order to fix:
>
> http://www.lyx.org/trac/ticket/7778
>
> possible solution which will enbale to toggle languages and keep the bug
> fixed:
>
>
> If we can disable switching into corrent language, we can use
> LFUN_COMMAND_ALTERNATIVES. Somthing like
>
> command-alternatives language hebrew; language english
>
> Which will switch the the "other" language.
>
> (if I understood correctly the manual, I assume one can check waht is the
> current language and then "if (*lang == *cur_lang)  {enable  = false;
> break;}   "  will do the work)
>
>
>
> On Fri, Apr 27, 2012 at 5:49 PM, Ronen Abravanel <ronena@gmail.com> wrote:
>
>> Good morning,
>>
>> I'm using LyX for quite a while for writing bi-lingual documents, in both
>> Hebrew and English. In order to write such documents, I define one language
>> in documents->settings, and then, created a key-binding to "language
>> hebrew" [or, "language english"], and then invoke the shortcut in order to
>> toggle between the two language.
>>
>> Since LyX 2.02, that was change: invoking "language <language-name>" dose
>> not toggle between languages, but switch into the specified language. The
>> change made the the usage of LyX for writing bi-lingual documents very
>> tiresome.
>>
>>
>> The code change is very simple:
>>
>> int
>> src/Text3.cpp, Line 1924 (SVN version)
>>         toggleAndShow(cur, this, font, false);
>>
>>
>> should be change to
>>
>>         toggleAndShow(cur, this, font, true); //true is the default
>> argument, so it can as well be left blank
>>
>>
>> The change was mad in:
>>
>> http://www.lyx.org/trac/changeset/39735/lyxsvn/lyx-devel/trunk/src/Text3.cpp
>>
>>
>>
>> But it it so simple, I can only assume that this behavior was
>> deliberated. If so, please, reconsider.
>>
>>
>> Thanks,
>> Ronen Abravanel
>>
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra">And a patch that perform my suggestion is \
attachted.<br><br>Ronen Abravanel<br><br><br><br><div class="gmail_quote">On Fri, Apr \
27, 2012 at 6:04 PM, Ronen Abravanel <span dir="ltr">&lt;<a \
href="mailto:ronena@gmail.com" target="_blank">ronena@gmail.com</a>&gt;</span> \
wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">It seems the change \
was done in order to fix:<br><br><a href="http://www.lyx.org/trac/ticket/7778" \
target="_blank">http://www.lyx.org/trac/ticket/7778</a><br>

<br>possible solution which will enbale to toggle languages and keep the bug \
fixed:<br> <br><br>If we can disable switching into corrent language, we can use \
LFUN_COMMAND_ALTERNATIVES. Somthing like<br><br>command-alternatives language hebrew; \
language english<br><br>Which will switch the the &quot;other&quot; language.<br>


<br>(if I understood correctly the manual, I assume one can check waht is 
the current language and then &quot;if (*lang == *cur_lang)   {enable   = 
false; break;}    &quot;   will do the work)<div><div class="h5"><br><br><br><div \
class="gmail_quote">On Fri, Apr 27, 2012 at 5:49 PM, Ronen Abravanel <span \
dir="ltr">&lt;<a href="mailto:ronena@gmail.com" \
target="_blank">ronena@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Good morning,<br><br>I&#39;m using LyX for \
quite a while for writing bi-lingual documents, in both Hebrew and English. In order \
to write such documents, I define one language in documents-&gt;settings, and then, \
created a key-binding to &quot;language hebrew&quot; [or, &quot;language \
english&quot;], and then invoke the shortcut in order to toggle between the two \
language.<br>



<br>Since LyX 2.02, that was change: invoking &quot;language \
&lt;language-name&gt;&quot; dose not toggle between languages, but switch into the \
specified language. The change made the the usage of LyX for writing bi-lingual \
documents very tiresome. <br>



<br><br>The code change is very simple:<br><br>int <br>src/Text3.cpp, Line 1924 (SVN \
version) <br>              toggleAndShow(cur, this, font, false);<br><br><br>should \
be change to <br><br>  toggleAndShow(cur, this, font, true); //true is the default \
argument, so it can as well be left blank<br><br><br>The change was mad in:<br><a \
href="http://www.lyx.org/trac/changeset/39735/lyxsvn/lyx-devel/trunk/src/Text3.cpp" \
target="_blank">http://www.lyx.org/trac/changeset/39735/lyxsvn/lyx-devel/trunk/src/Text3.cpp</a><br>




<br><br><br>But it it so simple, I can only assume that this behavior was \
deliberated. If so, please, reconsider.<br><br><br>Thanks,<br>Ronen \
Abravanel<br></div> </blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>

--e89a8f643910c7d6e704beaad5bf--


["language_toggle.diff" (application/octet-stream)]

Index: src/Text3.cpp
===================================================================
--- src/Text3.cpp	(revision 40920)
+++ src/Text3.cpp	(working copy)
@@ -2692,6 +2692,7 @@
 
 	case LFUN_LANGUAGE:
 		enable = !cur.paragraph().isPassThru();
+		enable &= !(to_utf8(cmd.argument()) == cur.real_current_font.language()->lang()); \
//Disable switching into active language   flag.setOnOff(to_utf8(cmd.argument()) == \
cur.real_current_font.language()->lang());  break;
 



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

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