#533 nc -wait does not wait when closing a file opened in a tab

release
closed-fixed
Program (402)
9
2006-11-28
2006-07-20
Anonymous
No

Hello,

nc -wait file.txt

does not wait until file.txt is closed when in nedit
window a new file is opened in a tab and this new tab
is closed.

Example:

nc -svrname xxx -wait file.txt
File -> Open... -> file2.txt
[Ctrl+W] in file2.txt tab

Discussion

<< < 1 2 (Page 2 of 2)
  • Thorsten Haude

    Thorsten Haude - 2006-11-22

    Logged In: YES
    user_id=119143
    Originator: NO

    Any news here?

     
  • Arne F�rlie

    Arne F�rlie - 2006-11-23

    Logged In: YES
    user_id=75224
    Originator: NO

    Below you will find a small patch that inserts debugging code that demonstrates the problem. Apply it to server.c (as of 23 Nov. 2006).

    Then perform the following:

    % touch file1 file2
    % nc -wait file1

    That should print something like
    Found fileClosedAtom 0x29e
    to the console.

    Then Ctrl+O and open file2
    It should open in a new tab (if it doesn't ensure that Preference "Tabbed editing->Open File in New Tab" is set, and restart the exercise)

    Then close the tab that holds file2.
    That should print something like
    Deleting fileClosedAtom 0x29e
    to the console.
    Note also that nc -wait file1 returns.

    THIS IS THE BUG, fileClosedAtom BELONGED TO file1, BUT IS DELETED WHEN file2 IS CLOSED

    Then close file1. That should also print
    Deleting fileClosedAtom 0x29e
    to the console.
    THIS WAS THE DELETE THAT WAS SUPPOSED TO TERMINATE nc -wait

    Now insert
    window->fileClosedAtom = None;
    at line 3326 of window.c and repeat the exercise.
    You will find that everything now works, confirmed by the printouts from server.c

    % nedit -V
    NEdit release of Aug 20, 2004

    Built on: Linux, 386, GNU C
    Built at: Nov 23 2006, 22:30:37
    With Motif: 2.1.31 [@(#)Motif Version 2.1.31]
    Running Motif: 2.1 [unknown]
    Server: The X.Org Foundation 70000000
    Visual: 24-bit TrueColor (ID 0x23, Default)
    Locale: en_US

    Index: source/server.c

    --- source/server.c (revision 16)
    +++ source/server.c (working copy)
    @@ -269,6 +269,7 @@
    if (window->filenameSet) {
    window->fileClosedAtom = findFileClosedProperty(window->filename,
    window->path);
    + fprintf(stderr, "Found fileClosedAtom %p\n", window->fileClosedAtom);
    }
    }

    @@ -278,6 +279,7 @@
    void DeleteFileClosedProperty(WindowInfo *window)
    {
    if (window->filenameSet) {
    + fprintf(stderr, "Deleting fileClosedAtom %p\n", window->fileClosedAtom);
    deleteProperty(&window->fileClosedAtom);
    }
    }
    @@ -286,6 +288,7 @@
    const char* pathname)
    {
    Atom atom = findFileClosedProperty(filename, pathname);
    + fprintf(stderr, "Deleting fileClosedAtom %p\n", atom);
    deleteProperty(&atom);
    }

     
  • Thorsten Haude

    Thorsten Haude - 2006-11-23

    Logged In: YES
    user_id=119143
    Originator: NO

    I hope you didn't create the demo on my account. I believe you if you say it's fixed, I just wanted to ask for an update.

     
  • Arne F�rlie

    Arne F�rlie - 2006-11-26

    Logged In: YES
    user_id=75224
    Originator: NO

    I am still curious on what you observe when running with my debugging code.

    I suggest that I commit my fix in a few days, hoping that at least one developer can confirm the bug and fix in the meantime.

     
  • Thorsten Haude

    Thorsten Haude - 2006-11-26

    Logged In: YES
    user_id=119143
    Originator: NO

    Ok, sure, sorry for the misunderstanding.

    Yes, I see what you are describing:
    yooden@eumel % nc -svrname xxx -svrcmd ~nedit/nedit.arne-wait/source/nedit -wait file1
    Found fileClosedAtom 0x459

    ...and on closing file2:
    Deleting fileClosedAtom 0x459

    ...and after closing file1 again:
    Deleting fileClosedAtom 0x459

    Line 3247 for the fix is off already, I put it somewhere in the init block in CreateDocument(). Now it works as documented and I get:
    Found fileClosedAtom 0x459

    ...after closing file2:
    Deleting fileClosedAtom (nil)

    ...after closing file1:
    Deleting fileClosedAtom 0x459

    Seems to work!

     
  • Arne F�rlie

    Arne F�rlie - 2006-11-28
    • status: open-accepted --> closed-fixed
     
  • Arne F�rlie

    Arne F�rlie - 2006-11-28

    Logged In: YES
    user_id=75224
    Originator: NO

    Checked in fix for this (a single line in window.c)

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks