Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread André Pönitz
On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
 André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:
 
 | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
  From: Lars Gullik Bjønnes lar...@gullik.org
  
  Use a local typedef pairstring, string P to avoid having to repeat
  that multiple times.
  ---
   src/lyxfind.cpp | 72
  -
   1 file changed, 40 insertions(+), 32 deletions(-)
  
  diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
  index a19724b..33dbd8a 100644
  --- a/src/lyxfind.cpp
  +++ b/src/lyxfind.cpp
  @@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
   /// @note Beware of order
   Escapes const  get_regexp_escapes()
   {
  +  typedef std::pairstd::string, std::string P;
  +
 
 | Conveniently adding a std:: or three, so next time the discussion
 | comes up we can reasonably claim that it is used inconsistently
 | and the 'using' on top could go...
 
 What is your agenda really?

Preventing attempts to turn the LyX code base into a guinea pig for
programming experiments again. Especially the kind of experiment that
add a burden for others.

Andre'


Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread Lars Gullik Bjønnes
André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:

| On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
 André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:
 
 | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
  From: Lars Gullik Bjønnes lar...@gullik.org
  
  Use a local typedef pairstring, string P to avoid having to repeat
  that multiple times.
  ---
   src/lyxfind.cpp | 72
  -
   1 file changed, 40 insertions(+), 32 deletions(-)
  
  diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
  index a19724b..33dbd8a 100644
  --- a/src/lyxfind.cpp
  +++ b/src/lyxfind.cpp
  @@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
   /// @note Beware of order
   Escapes const  get_regexp_escapes()
   {
  + typedef std::pairstd::string, std::string P;
  +
 
 | Conveniently adding a std:: or three, so next time the discussion
 | comes up we can reasonably claim that it is used inconsistently
 | and the 'using' on top could go...
 
 What is your agenda really?

| Preventing attempts to turn the LyX code base into a guinea pig for
| programming experiments again. Especially the kind of experiment that
| add a burden for others.

Since you are not doing any, perhaps you should let those that do
decide? I am not going to push anything without a +1 anyway.

-- 
   Lgb



Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread André Pönitz
On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
> André Pönitz  writes:
> 
> | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
> >> From: Lars Gullik Bjønnes 
> >> 
> >> Use a local typedef pair P to avoid having to repeat
> >> that multiple times.
> >> ---
> >>  src/lyxfind.cpp | 72
> >> -
> >>  1 file changed, 40 insertions(+), 32 deletions(-)
> >> 
> >> diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
> >> index a19724b..33dbd8a 100644
> >> --- a/src/lyxfind.cpp
> >> +++ b/src/lyxfind.cpp
> >> @@ -495,54 +495,62 @@ typedef vector > Escapes;
> >>  /// @note Beware of order
> >>  Escapes const & get_regexp_escapes()
> >>  {
> >> +  typedef std::pair P;
> >> +
> >
> | Conveniently adding a std:: or three, so next time the discussion
> | comes up we can reasonably claim that it is used "inconsistently"
> | and the 'using' on top could go...
> 
> What is your agenda really?

Preventing attempts to turn the LyX code base into a guinea pig for
programming experiments again. Especially the kind of experiment that
add a burden for others.

Andre'


Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread Lars Gullik Bjønnes
André Pönitz  writes:

| On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
>> André Pönitz  writes:
>> 
>> | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
>> >> From: Lars Gullik Bjønnes 
>> >> 
>> >> Use a local typedef pair P to avoid having to repeat
>> >> that multiple times.
>> >> ---
>> >>  src/lyxfind.cpp | 72
>> >> -
>> >>  1 file changed, 40 insertions(+), 32 deletions(-)
>> >> 
>> >> diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
>> >> index a19724b..33dbd8a 100644
>> >> --- a/src/lyxfind.cpp
>> >> +++ b/src/lyxfind.cpp
>> >> @@ -495,54 +495,62 @@ typedef vector > Escapes;
>> >>  /// @note Beware of order
>> >>  Escapes const & get_regexp_escapes()
>> >>  {
>> >> + typedef std::pair P;
>> >> +
>> >
>> | Conveniently adding a std:: or three, so next time the discussion
>> | comes up we can reasonably claim that it is used "inconsistently"
>> | and the 'using' on top could go...
>> 
>> What is your agenda really?
>
| Preventing attempts to turn the LyX code base into a guinea pig for
| programming experiments again. Especially the kind of experiment that
| add a burden for others.

Since you are not doing any, perhaps you should let those that do
decide? I am not going to push anything without a +1 anyway.

-- 
   Lgb



[PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes lar...@gullik.org

Use a local typedef pairstring, string P to avoid having to repeat
that multiple times.
---
 src/lyxfind.cpp | 72 -
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index a19724b..33dbd8a 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
 /// @note Beware of order
 Escapes const  get_regexp_escapes()
 {
+   typedef std::pairstd::string, std::string P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pairstring, string($, _x_$));
-   escape_map.push_back(pairstring, string({, _x_{));
-   escape_map.push_back(pairstring, string(}, _x_}));
-   escape_map.push_back(pairstring, string([, _x_[));
-   escape_map.push_back(pairstring, string(], _x_]));
-   escape_map.push_back(pairstring, string((, _x_());
-   escape_map.push_back(pairstring, string(), _x_)));
-   escape_map.push_back(pairstring, string(+, _x_+));
-   escape_map.push_back(pairstring, string(*, _x_*));
-   escape_map.push_back(pairstring, string(., _x_.));
-   escape_map.push_back(pairstring, string(\\, 
(?:|backslash)));
-   escape_map.push_back(pairstring, string(~, 
(?:textasciitilde|sim)));
-   escape_map.push_back(pairstring, string(^, 
(?:\\^|textasciicircum\\{\\}|mathcircumflex)));
-   escape_map.push_back(pairstring, string(_x_, \\));
+   escape_map.push_back(P($, _x_$));
+   escape_map.push_back(P({, _x_{));
+   escape_map.push_back(P(}, _x_}));
+   escape_map.push_back(P([, _x_[));
+   escape_map.push_back(P(], _x_]));
+   escape_map.push_back(P((, _x_());
+   escape_map.push_back(P(), _x_)));
+   escape_map.push_back(P(+, _x_+));
+   escape_map.push_back(P(*, _x_*));
+   escape_map.push_back(P(., _x_.));
+   escape_map.push_back(P(\\, (?:|backslash)));
+   escape_map.push_back(P(~, (?:textasciitilde|sim)));
+   escape_map.push_back(P(^, 
(?:\\^|textasciicircum\\{\\}|mathcircumflex)));
+   escape_map.push_back(P(_x_, \\));
}
return escape_map;
 }
 
 /// A map of lyx escaped strings and their unescaped equivalent.
-Escapes const  get_lyx_unescapes() {
+Escapes const  get_lyx_unescapes()
+{
+   typedef std::pairstd::string, std::string P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pairstring, string(\\%, %));
-   escape_map.push_back(pairstring, string(\\mathcircumflex , 
^));
-   escape_map.push_back(pairstring, string(\\mathcircumflex, 
^));
-   escape_map.push_back(pairstring, string(\\backslash , 
\\));
-   escape_map.push_back(pairstring, string(\\backslash, \\));
-   escape_map.push_back(pairstring, string({, _x_));
-   escape_map.push_back(pairstring, string(}, _x_));
-   escape_map.push_back(pairstring, string(\\sim , ~));
-   escape_map.push_back(pairstring, string(\\sim, ~));
+   escape_map.push_back(P(\\%, %));
+   escape_map.push_back(P(\\mathcircumflex , ^));
+   escape_map.push_back(P(\\mathcircumflex, ^));
+   escape_map.push_back(P(\\backslash , \\));
+   escape_map.push_back(P(\\backslash, \\));
+   escape_map.push_back(P({, _x_));
+   escape_map.push_back(P(}, _x_));
+   escape_map.push_back(P(\\sim , ~));
+   escape_map.push_back(P(\\sim, ~));
}
return escape_map;
 }
 
 /// A map of escapes turning a regexp matching text to one matching latex.
-Escapes const  get_regexp_latex_escapes() {
+Escapes const  get_regexp_latex_escapes()
+{
+   typedef std::pairstd::string, std::string P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pairstring, string(, 
(?:|backslash|textbackslash\\{\\})));
-   escape_map.push_back(pairstring, 
string((?!textbackslash)\\{, \\{));
-   escape_map.push_back(pairstring, 
string((?!textbackslash\\{)\\}, \\}));
-   escape_map.push_back(pairstring, string(\\[, \\{\\[\\}));
-   escape_map.push_back(pairstring, string(\\], \\{\\]\\}));
-   escape_map.push_back(pairstring, string(\\^, 
(?:\\^|textasciicircum\\{\\}|mathcircumflex)));
-   escape_map.push_back(pairstring, string(%, \\%));
+   escape_map.push_back(P(, 

Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread André Pönitz
On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
 From: Lars Gullik Bjønnes lar...@gullik.org
 
 Use a local typedef pairstring, string P to avoid having to repeat
 that multiple times.
 ---
  src/lyxfind.cpp | 72 
 -
  1 file changed, 40 insertions(+), 32 deletions(-)
 
 diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
 index a19724b..33dbd8a 100644
 --- a/src/lyxfind.cpp
 +++ b/src/lyxfind.cpp
 @@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
  /// @note Beware of order
  Escapes const  get_regexp_escapes()
  {
 + typedef std::pairstd::string, std::string P;
 +

Conveniently adding a std:: or three, so next time the discussion
comes up we can reasonably claim that it is used inconsistently
and the 'using' on top could go...

Andre'


Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread Lars Gullik Bjønnes
André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:

| On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
 From: Lars Gullik Bjønnes lar...@gullik.org
 
 Use a local typedef pairstring, string P to avoid having to repeat
 that multiple times.
 ---
  src/lyxfind.cpp | 72
 -
  1 file changed, 40 insertions(+), 32 deletions(-)
 
 diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
 index a19724b..33dbd8a 100644
 --- a/src/lyxfind.cpp
 +++ b/src/lyxfind.cpp
 @@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
  /// @note Beware of order
  Escapes const  get_regexp_escapes()
  {
 +typedef std::pairstd::string, std::string P;
 +

| Conveniently adding a std:: or three, so next time the discussion
| comes up we can reasonably claim that it is used inconsistently
| and the 'using' on top could go...

What is your agenda really?



[PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes 

Use a local typedef pair P to avoid having to repeat
that multiple times.
---
 src/lyxfind.cpp | 72 -
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index a19724b..33dbd8a 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -495,54 +495,62 @@ typedef vector > Escapes;
 /// @note Beware of order
 Escapes const & get_regexp_escapes()
 {
+   typedef std::pair P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pair("$", "_x_$"));
-   escape_map.push_back(pair("{", "_x_{"));
-   escape_map.push_back(pair("}", "_x_}"));
-   escape_map.push_back(pair("[", "_x_["));
-   escape_map.push_back(pair("]", "_x_]"));
-   escape_map.push_back(pair("(", "_x_("));
-   escape_map.push_back(pair(")", "_x_)"));
-   escape_map.push_back(pair("+", "_x_+"));
-   escape_map.push_back(pair("*", "_x_*"));
-   escape_map.push_back(pair(".", "_x_."));
-   escape_map.push_back(pair("\\", 
"(?:|backslash)"));
-   escape_map.push_back(pair("~", 
"(?:textasciitilde|sim)"));
-   escape_map.push_back(pair("^", 
"(?:\\^|textasciicircum\\{\\}|mathcircumflex)"));
-   escape_map.push_back(pair("_x_", "\\"));
+   escape_map.push_back(P("$", "_x_$"));
+   escape_map.push_back(P("{", "_x_{"));
+   escape_map.push_back(P("}", "_x_}"));
+   escape_map.push_back(P("[", "_x_["));
+   escape_map.push_back(P("]", "_x_]"));
+   escape_map.push_back(P("(", "_x_("));
+   escape_map.push_back(P(")", "_x_)"));
+   escape_map.push_back(P("+", "_x_+"));
+   escape_map.push_back(P("*", "_x_*"));
+   escape_map.push_back(P(".", "_x_."));
+   escape_map.push_back(P("\\", "(?:|backslash)"));
+   escape_map.push_back(P("~", "(?:textasciitilde|sim)"));
+   escape_map.push_back(P("^", 
"(?:\\^|textasciicircum\\{\\}|mathcircumflex)"));
+   escape_map.push_back(P("_x_", "\\"));
}
return escape_map;
 }
 
 /// A map of lyx escaped strings and their unescaped equivalent.
-Escapes const & get_lyx_unescapes() {
+Escapes const & get_lyx_unescapes()
+{
+   typedef std::pair P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pair("\\%", "%"));
-   escape_map.push_back(pair("\\mathcircumflex ", 
"^"));
-   escape_map.push_back(pair("\\mathcircumflex", 
"^"));
-   escape_map.push_back(pair("\\backslash ", 
"\\"));
-   escape_map.push_back(pair("\\backslash", "\\"));
-   escape_map.push_back(pair("{", "_x_<"));
-   escape_map.push_back(pair("}", "_x_>"));
-   escape_map.push_back(pair("\\sim ", "~"));
-   escape_map.push_back(pair("\\sim", "~"));
+   escape_map.push_back(P("\\%", "%"));
+   escape_map.push_back(P("\\mathcircumflex ", "^"));
+   escape_map.push_back(P("\\mathcircumflex", "^"));
+   escape_map.push_back(P("\\backslash ", "\\"));
+   escape_map.push_back(P("\\backslash", "\\"));
+   escape_map.push_back(P("{", "_x_<"));
+   escape_map.push_back(P("}", "_x_>"));
+   escape_map.push_back(P("\\sim ", "~"));
+   escape_map.push_back(P("\\sim", "~"));
}
return escape_map;
 }
 
 /// A map of escapes turning a regexp matching text to one matching latex.
-Escapes const & get_regexp_latex_escapes() {
+Escapes const & get_regexp_latex_escapes()
+{
+   typedef std::pair P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pair("", 
"(?:|backslash|textbackslash\\{\\})"));
-   escape_map.push_back(pair("(("(("\\[", "\\{\\[\\}"));
-   escape_map.push_back(pair("\\]", "\\{\\]\\}"));
-   escape_map.push_back(pair("\\^", 
"(?:\\^|textasciicircum\\{\\}|mathcircumflex)"));
-   escape_map.push_back(pair

Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread André Pönitz
On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
> From: Lars Gullik Bjønnes 
> 
> Use a local typedef pair P to avoid having to repeat
> that multiple times.
> ---
>  src/lyxfind.cpp | 72 
> -
>  1 file changed, 40 insertions(+), 32 deletions(-)
> 
> diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
> index a19724b..33dbd8a 100644
> --- a/src/lyxfind.cpp
> +++ b/src/lyxfind.cpp
> @@ -495,54 +495,62 @@ typedef vector > Escapes;
>  /// @note Beware of order
>  Escapes const & get_regexp_escapes()
>  {
> + typedef std::pair P;
> +

Conveniently adding a std:: or three, so next time the discussion
comes up we can reasonably claim that it is used "inconsistently"
and the 'using' on top could go...

Andre'


Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread Lars Gullik Bjønnes
André Pönitz  writes:

| On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
>> From: Lars Gullik Bjønnes 
>> 
>> Use a local typedef pair P to avoid having to repeat
>> that multiple times.
>> ---
>>  src/lyxfind.cpp | 72
>> -
>>  1 file changed, 40 insertions(+), 32 deletions(-)
>> 
>> diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
>> index a19724b..33dbd8a 100644
>> --- a/src/lyxfind.cpp
>> +++ b/src/lyxfind.cpp
>> @@ -495,54 +495,62 @@ typedef vector > Escapes;
>>  /// @note Beware of order
>>  Escapes const & get_regexp_escapes()
>>  {
>> +typedef std::pair P;
>> +
>
| Conveniently adding a std:: or three, so next time the discussion
| comes up we can reasonably claim that it is used "inconsistently"
| and the 'using' on top could go...

What is your agenda really?