bugGNU TeXmacs - Bugs: bug #37286, command line option -S (or...


You are not allowed to post comments on this tracker with your current authentication level.

bug #37286: command line option -S (or --setup) fails on windows

Submitted by:  Philippe Joyez <pjoyez>
Submitted on:  Thu 06 Sep 2012 12:03:19 PM UTC  
Category:  Windows port Priority:  5 - Normal
Item Group:  Error Status:  Ready For Test
Privacy:  Public Assigned to:  Denis Raux <denisraux>
Originator Name:  Open/Closed:  Closed
Release:  Release:  None
Fixed Release:  None Fixed Release: 

( Jump to the original submission)

Sun 09 Nov 2014 02:22:01 PM UTC, comment #6:

The problem is not present anymore in latest svn. Closing.

Philippe Joyez <pjoyez>
Project Member
Thu 06 Feb 2014 02:48:27 PM UTC, comment #5:

The problem in this matter is the behavior of the url_complete routine which tries to complete a relative url (even with wilchards included) to absolute url. To perform that it needs a base URL ( pwd in this case ) regardless if the url to complete is already based or not.
I modified the url_complete function ( src/System/Classes/url.cpp) in this way and hope there won't be others bad effects.

Denis Raux <denisraux>
Project MemberIn charge of this item.
Thu 06 Feb 2014 10:46:26 AM UTC, comment #4:

This should be fixed in rev 8178. Tested in XP and win7.

I also fixed a separate issue in windows setup: a wrongly formatted path (c;\ instead of C:\) failed, of course. This was due to my improper use of

url ink_ext = url( get_env ("APPDATA") * "/inkscape/extensions/")

instead of either

url ink_ext = url_system( get_env ("APPDATA") * "/inkscape/extensions/")


url ink_ext = url ("$APPDATA/inkscape/extensions")

Final note maybe worth bug report : debug_boot messages are not displayed in windows console (I did compile with --enable-console) while they show in linux.

Philippe Joyez <pjoyez>
Project Member
Wed 05 Feb 2014 04:13:35 PM UTC, comment #3:

OK, I finally got some time to look at this again...

So yes, the bug is still present, and the workaround I suggested is still effective (and produces no error message in Windows AFAICT).

I investigated a little bit more what was done in TeXmacs_init_paths() that could make it work and saw the comment:

// if PWD is lacking, then the path resolution machinery may not work

And indeed PWD is not defined when if immediate_options() is executed before TeXmacs_init_paths().

The way PWD is set in TeXmacs_init_paths() is a bit complex, but I found a simple fix to the problem: in immediate options it is sufficient to define $HOME together with $TEXMACS_HOME_PATH, by inserting at line 434:

if (get_env ("HOME") == "") set_env ("HOME", get_env("USERPROFILE"));

Strangely, this seems enough to also define $PWD. At least this works on the french WinXP where I compile. I'll try to confirm on Win7 and will eventually commit that "fix".

Philippe Joyez <pjoyez>
Project Member
Sat 19 Oct 2013 02:29:24 PM UTC, comment #2:

As it is now (SVN 7517), the variable TEXMACS_HOME_PATH is set before it is used in immediate_options(), so the call to remove() ought to work. I don't see how calling TeXmacs_init_paths() would change its behaviour. (?)

Also, shifting the call to immediate_options() after TeXmacs_init_paths() causes an error message in the console "cannot resolve ?", so this probably isn't a good idea.

Is the bug still valid?

Miguel de Benito <mdbenito>
Project Member
Thu 06 Sep 2012 01:59:39 PM UTC, comment #1:

I confirm what I suspected: It works properly if immediate_options is called (a second time) after TeXmacs_init_paths (at line 466).

Would that be acceptable to simply delay the call to immediate_options or is there really an emergency to execute it so early in the program?

Otherwise I can simply create a windows specific chunk of code a bit like mac_alternate_startup.

Philippe Joyez <pjoyez>
Project Member
Thu 06 Sep 2012 12:03:19 PM UTC, original submission:

This is because in /src/scr/TeXmacs/TeXmacs/texmacs.cpp:

line 412: remove (url ("$TEXMACS_HOME_PATH/system/settings.scm"));

fails to remove that file, for some reason (It is the absence of that file that then triggers the setup process).

I have found that when executed at that location:

exists(url ("$TEXMACS_HOME_PATH/system/settings.scm"))

returns false. I have tried many variants with the url syntax, but with no luck.

I suspect it's a problem of not having yet properly initialized everything for windows because the file is indeed detected properly later on, say at line 310.

PS: I encounter this problem on an french XP system.

Philippe Joyez <pjoyez>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by denisraux (Posted a comment)
  • -email is unavailable- added by mdbenito (Updated the item)
  • -email is unavailable- added by pjoyez (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-09 pjoyez Open/ClosedOpen => Closed
    2014-02-06 pjoyez StatusNeed Info => Ready For Test
    2012-09-06 mdbenito StatusNone => Need Info
        Assigned toNone => denisraux

    Back to the top

    Powered by Savane 3.3