Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Lars Gullik Bjønnes
Angus Leeming [EMAIL PROTECTED] writes:

| Lars Gullik Bjønnes wrote:

 Angus Leeming [EMAIL PROTECTED] writes:
 
 | @@ -217,8 +217,19 @@ bool setLyxPaths()
 |  bool followlink;
 |  do {
 |  // Path of binary/../share/name of binary/
 | -   searchpath += NormalizePath(AddPath(binpath, ../share/) +
 | - OnlyFilename(binname)) + ';';
 | +
 | +   string const exe_name = OnlyFilename(binname);
 | +   string const lyx_system_dir_name =
 | +#ifdef _WIN32
 | +   suffixIs(exe_name, .exe) ?
 | +   ChangeExtension(exe_name, ) :
 | +   exe_name;
 | +#else
 | +   exe_name;
 | +#endif
 
 Can we please not split statements with ifdef?

| Sure, but that is just more 'whitespace commentary'. Are you in favour of 
| the substance of the proposal or should we take this back to the drawing 
| board?

I comment what I comment. I.e. if I don't comment the general approach
I am fine with it.

-- 
Lgb



Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Jean-Marc Lasgouttes
 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus Ok, Jean-Marc. Here is a refinement of Ruurd's patch to
Angus determine the name of the LyX system directory from the name of
Angus the LyX binary. Are you happy with this or should we discuss it
Angus some more?

I am very happy with this :)

JMac


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
 Angus Ok, Jean-Marc. Here is a refinement of Ruurd's patch to
 Angus determine the name of the LyX system directory from the name of
 Angus the LyX binary. Are you happy with this or should we discuss it
 Angus some more?
 
 I am very happy with this :)
 
 JMac

Jean-Mac, aka MacJean. The Scottish JMarc.

I'll hold off on committing this until I have resolved the 'lyx -dbg init' 
problems. Sometime over the w/e.

I'll commit the name-manglng patch now.

-- 
Angus



Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Jean-Marc Lasgouttes
 Angus == Angus Leeming [EMAIL PROTECTED] writes:

 JMac

Angus Jean-Mac, aka MacJean. The Scottish JMarc.

How did you find out? After all these years, everybody knows that I am
two. 

You can see him here:
http://www-rocq.inria.fr/~lasgoutt/emile/mac-cookies/emile-falaise.jpg

Angus I'll hold off on committing this until I have resolved the 'lyx
Angus -dbg init' problems. Sometime over the w/e.

Angus I'll commit the name-manglng patch now.

Fine.

JMarc


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
 Angus Jean-Mac, aka MacJean. The Scottish JMarc.
 
 How did you find out? After all these years, everybody knows that I am
 two.
 
 You can see him here:
 http://www-rocq.inria.fr/~lasgoutt/emile/mac-cookies/emile-falaise.jpg

;-)

-- 
Angus



Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>
>> Angus Leeming <[EMAIL PROTECTED]> writes:
>> 
>> | @@ -217,8 +217,19 @@ bool setLyxPaths()
>> |  bool followlink;
>> |  do {
>> |  // Path of binary/../share/name of binary/
>> | -   searchpath += NormalizePath(AddPath(binpath, "../share/") +
>> | - OnlyFilename(binname)) + ';';
>> | +
>> | +   string const exe_name = OnlyFilename(binname);
>> | +   string const lyx_system_dir_name =
>> | +#ifdef _WIN32
>> | +   suffixIs(exe_name, ".exe") ?
>> | +   ChangeExtension(exe_name, "") :
>> | +   exe_name;
>> | +#else
>> | +   exe_name;
>> | +#endif
>> 
>> Can we please not split statements with ifdef?
>
| Sure, but that is just more 'whitespace commentary'. Are you in favour of 
| the substance of the proposal or should we take this back to the drawing 
| board?

I comment what I comment. I.e. if I don't comment the general approach
I am fine with it.

-- 
Lgb



Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Ok, Jean-Marc. Here is a refinement of Ruurd's patch to
Angus> determine the name of the LyX system directory from the name of
Angus> the LyX binary. Are you happy with this or should we discuss it
Angus> some more?

I am very happy with this :)

JMac


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
> Angus> Ok, Jean-Marc. Here is a refinement of Ruurd's patch to
> Angus> determine the name of the LyX system directory from the name of
> Angus> the LyX binary. Are you happy with this or should we discuss it
> Angus> some more?
> 
> I am very happy with this :)
> 
> JMac

Jean-Mac, aka MacJean. The Scottish JMarc.

I'll hold off on committing this until I have resolved the 'lyx -dbg init' 
problems. Sometime over the w/e.

I'll commit the name-manglng patch now.

-- 
Angus



Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

>> JMac

Angus> Jean-Mac, aka MacJean. The Scottish JMarc.

How did you find out? After all these years, everybody knows that I am
two. 

You can see him here:
http://www-rocq.inria.fr/~lasgoutt/emile/mac-cookies/emile-falaise.jpg

Angus> I'll hold off on committing this until I have resolved the 'lyx
Angus> -dbg init' problems. Sometime over the w/e.

Angus> I'll commit the name-manglng patch now.

Fine.

JMarc


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-17 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
> Angus> Jean-Mac, aka MacJean. The Scottish JMarc.
> 
> How did you find out? After all these years, everybody knows that I am
> two.
> 
> You can see him here:
> http://www-rocq.inria.fr/~lasgoutt/emile/mac-cookies/emile-falaise.jpg

;-)

-- 
Angus



Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-16 Thread Lars Gullik Bjønnes
Angus Leeming [EMAIL PROTECTED] writes:

| @@ -217,8 +217,19 @@ bool setLyxPaths()
|   bool followlink;
|   do {
|   // Path of binary/../share/name of binary/
| - searchpath += NormalizePath(AddPath(binpath, ../share/) +
| -   OnlyFilename(binname)) + ';';
| +
| + string const exe_name = OnlyFilename(binname);
| + string const lyx_system_dir_name =
| +#ifdef _WIN32
| + suffixIs(exe_name, .exe) ?
| + ChangeExtension(exe_name, ) :
| + exe_name;
| +#else
| + exe_name;
| +#endif

Can we please not split statements with ifdef?

| +#ifdef _WIN32
| + string const lyx_system_dir_name =
| + suffixIs(exe_name, .exe) ?
| + ChangeExtension(exe_name, ) :
| + exe_name;
| +#else
| + string const lyx_system_dir_name = exe_name;
| +#endif

would be nicer.

-- 
Lgb



[PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-16 Thread Angus Leeming
Ok, Jean-Marc. Here is a refinement of Ruurd's patch to determine the name 
of the LyX system directory from the name of the LyX binary. Are you happy 
with this or should we discuss it some more?

-- 
AngusIndex: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1021.2.53
diff -u -p -r1.1021.2.53 ChangeLog
--- src/ChangeLog	15 Dec 2004 19:35:06 -	1.1021.2.53
+++ src/ChangeLog	16 Dec 2004 17:25:25 -
@@ -1,4 +1,11 @@
- 2004-12-14  Angus Leeming  [EMAIL PROTECTED]
+2004-12-16  Angus Leeming  [EMAIL PROTECTED]
+
+	* lyx_main.C (init): on a Windows build, remove the .exe
+	extension from the name of the LyX binary when trying to
+	ascertain the name of the LyX system directory.
+	(Usually, path to binary/../share/name of binary/).
+
+2004-12-14  Angus Leeming  [EMAIL PROTECTED]
  
 	* LaTeX.C: (operator()): use os::nulldev() rather than /dev/null.
 
Index: src/lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.134.2.5
diff -u -p -r1.134.2.5 lyx_main.C
--- src/lyx_main.C	15 Dec 2004 19:35:10 -	1.134.2.5
+++ src/lyx_main.C	16 Dec 2004 17:25:25 -
@@ -288,8 +288,19 @@ void LyX::init(bool gui)
 	bool followlink;
 	do {
 		// Path of binary/../share/name of binary/
-		searchpath += NormalizePath(AddPath(binpath, ../share/) +
-		  OnlyFilename(binname)) + ';';
+
+		string const exe_name = OnlyFilename(binname);
+		string const lyx_system_dir_name =
+#ifdef _WIN32
+			suffixIs(exe_name, .exe) ?
+ChangeExtension(exe_name, ) :
+exe_name;
+#else
+			exe_name;
+#endif
+		string const shared_dir_name =
+			NormalizePath(AddPath(binpath, ../share/));
+		searchpath += shared_dir_name + lyx_system_dir_name + ';';
 
 		// Follow Symlinks
 		FileInfo file(fullbinpath, true);
Index: src/support/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.287
diff -u -p -r1.287 ChangeLog
--- src/support/ChangeLog	16 Dec 2004 01:03:34 -	1.287
+++ src/support/ChangeLog	16 Dec 2004 17:25:40 -
@@ -1,5 +1,10 @@
 2004-12-16  Angus Leeming  [EMAIL PROTECTED]
 
+	* path_defines.C.in (setLyxPaths): on a Windows build, remove the
+	.exe extension from the name of the LyX binary when trying to
+	ascertain the name of the LyX system directory.
+	(Usually, path to binary/../share/name of binary/).
+
 	* mkdir.C: move the HAVE_MKDIR conditional code out of config.h
 	and into here.
 
Index: src/support/path_defines.C.in
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/path_defines.C.in,v
retrieving revision 1.14
diff -u -p -r1.14 path_defines.C.in
--- src/support/path_defines.C.in	15 Dec 2004 19:35:43 -	1.14
+++ src/support/path_defines.C.in	16 Dec 2004 17:25:40 -
@@ -217,8 +217,19 @@ bool setLyxPaths()
 	bool followlink;
 	do {
 		// Path of binary/../share/name of binary/
-		searchpath += NormalizePath(AddPath(binpath, ../share/) +
-		  OnlyFilename(binname)) + ';';
+
+		string const exe_name = OnlyFilename(binname);
+		string const lyx_system_dir_name =
+#ifdef _WIN32
+			suffixIs(exe_name, .exe) ?
+ChangeExtension(exe_name, ) :
+exe_name;
+#else
+			exe_name;
+#endif
+		string const shared_dir_name =
+			NormalizePath(AddPath(binpath, ../share/));
+		searchpath += shared_dir_name + lyx_system_dir_name + ';';
 
 		// Follow Symlinks
 		FileInfo file(fullbinpath, true);


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-16 Thread Angus Leeming
Lars Gullik Bjønnes wrote:

 Angus Leeming [EMAIL PROTECTED] writes:
 
 | @@ -217,8 +217,19 @@ bool setLyxPaths()
 |  bool followlink;
 |  do {
 |  // Path of binary/../share/name of binary/
 | -   searchpath += NormalizePath(AddPath(binpath, ../share/) +
 | - OnlyFilename(binname)) + ';';
 | +
 | +   string const exe_name = OnlyFilename(binname);
 | +   string const lyx_system_dir_name =
 | +#ifdef _WIN32
 | +   suffixIs(exe_name, .exe) ?
 | +   ChangeExtension(exe_name, ) :
 | +   exe_name;
 | +#else
 | +   exe_name;
 | +#endif
 
 Can we please not split statements with ifdef?

Sure, but that is just more 'whitespace commentary'. Are you in favour of 
the substance of the proposal or should we take this back to the drawing 
board?

-- 
Angus


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-16 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes:

| @@ -217,8 +217,19 @@ bool setLyxPaths()
|   bool followlink;
|   do {
|   // Path of binary/../share/name of binary/
| - searchpath += NormalizePath(AddPath(binpath, "../share/") +
| -   OnlyFilename(binname)) + ';';
| +
| + string const exe_name = OnlyFilename(binname);
| + string const lyx_system_dir_name =
| +#ifdef _WIN32
| + suffixIs(exe_name, ".exe") ?
| + ChangeExtension(exe_name, "") :
| + exe_name;
| +#else
| + exe_name;
| +#endif

Can we please not split statements with ifdef?

| +#ifdef _WIN32
| + string const lyx_system_dir_name =
| + suffixIs(exe_name, ".exe") ?
| + ChangeExtension(exe_name, "") :
| + exe_name;
| +#else
| + string const lyx_system_dir_name = exe_name;
| +#endif

would be nicer.

-- 
Lgb



[PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-16 Thread Angus Leeming
Ok, Jean-Marc. Here is a refinement of Ruurd's patch to determine the name 
of the LyX system directory from the name of the LyX binary. Are you happy 
with this or should we discuss it some more?

-- 
AngusIndex: src/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1021.2.53
diff -u -p -r1.1021.2.53 ChangeLog
--- src/ChangeLog	15 Dec 2004 19:35:06 -	1.1021.2.53
+++ src/ChangeLog	16 Dec 2004 17:25:25 -
@@ -1,4 +1,11 @@
- 2004-12-14  Angus Leeming  <[EMAIL PROTECTED]>
+2004-12-16  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* lyx_main.C (init): on a Windows build, remove the ".exe"
+	extension from the name of the LyX binary when trying to
+	ascertain the name of the LyX system directory.
+	(Usually, /../share//).
+
+2004-12-14  Angus Leeming  <[EMAIL PROTECTED]>
  
 	* LaTeX.C: (operator()): use os::nulldev() rather than "/dev/null".
 
Index: src/lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.134.2.5
diff -u -p -r1.134.2.5 lyx_main.C
--- src/lyx_main.C	15 Dec 2004 19:35:10 -	1.134.2.5
+++ src/lyx_main.C	16 Dec 2004 17:25:25 -
@@ -288,8 +288,19 @@ void LyX::init(bool gui)
 	bool followlink;
 	do {
 		// Path of binary/../share/name of binary/
-		searchpath += NormalizePath(AddPath(binpath, "../share/") +
-		  OnlyFilename(binname)) + ';';
+
+		string const exe_name = OnlyFilename(binname);
+		string const lyx_system_dir_name =
+#ifdef _WIN32
+			suffixIs(exe_name, ".exe") ?
+ChangeExtension(exe_name, "") :
+exe_name;
+#else
+			exe_name;
+#endif
+		string const shared_dir_name =
+			NormalizePath(AddPath(binpath, "../share/"));
+		searchpath += shared_dir_name + lyx_system_dir_name + ';';
 
 		// Follow Symlinks
 		FileInfo file(fullbinpath, true);
Index: src/support/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.287
diff -u -p -r1.287 ChangeLog
--- src/support/ChangeLog	16 Dec 2004 01:03:34 -	1.287
+++ src/support/ChangeLog	16 Dec 2004 17:25:40 -
@@ -1,5 +1,10 @@
 2004-12-16  Angus Leeming  <[EMAIL PROTECTED]>
 
+	* path_defines.C.in (setLyxPaths): on a Windows build, remove the
+	".exe" extension from the name of the LyX binary when trying to
+	ascertain the name of the LyX system directory.
+	(Usually, /../share//).
+
 	* mkdir.C: move the HAVE_MKDIR conditional code out of config.h
 	and into here.
 
Index: src/support/path_defines.C.in
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/path_defines.C.in,v
retrieving revision 1.14
diff -u -p -r1.14 path_defines.C.in
--- src/support/path_defines.C.in	15 Dec 2004 19:35:43 -	1.14
+++ src/support/path_defines.C.in	16 Dec 2004 17:25:40 -
@@ -217,8 +217,19 @@ bool setLyxPaths()
 	bool followlink;
 	do {
 		// Path of binary/../share/name of binary/
-		searchpath += NormalizePath(AddPath(binpath, "../share/") +
-		  OnlyFilename(binname)) + ';';
+
+		string const exe_name = OnlyFilename(binname);
+		string const lyx_system_dir_name =
+#ifdef _WIN32
+			suffixIs(exe_name, ".exe") ?
+ChangeExtension(exe_name, "") :
+exe_name;
+#else
+			exe_name;
+#endif
+		string const shared_dir_name =
+			NormalizePath(AddPath(binpath, "../share/"));
+		searchpath += shared_dir_name + lyx_system_dir_name + ';';
 
 		// Follow Symlinks
 		FileInfo file(fullbinpath, true);


Re: [PATCH 13x, 14x] determining the name of the LyX system dir

2004-12-16 Thread Angus Leeming
Lars Gullik Bjønnes wrote:

> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | @@ -217,8 +217,19 @@ bool setLyxPaths()
> |  bool followlink;
> |  do {
> |  // Path of binary/../share/name of binary/
> | -   searchpath += NormalizePath(AddPath(binpath, "../share/") +
> | - OnlyFilename(binname)) + ';';
> | +
> | +   string const exe_name = OnlyFilename(binname);
> | +   string const lyx_system_dir_name =
> | +#ifdef _WIN32
> | +   suffixIs(exe_name, ".exe") ?
> | +   ChangeExtension(exe_name, "") :
> | +   exe_name;
> | +#else
> | +   exe_name;
> | +#endif
> 
> Can we please not split statements with ifdef?

Sure, but that is just more 'whitespace commentary'. Are you in favour of 
the substance of the proposal or should we take this back to the drawing 
board?

-- 
Angus