bugGNU TeXmacs - Bugs: bug #37678, User is not advertised that his...

 
 

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

bug #37678: User is not advertised that his document has been modified

Submitted by:  Francois Poulain <fpoulain>
Submitted on:  Tue Nov 6 15:14:49 2012  
 
Category: User InterfacePriority: 3 - Low
Item Group: WishlistStatus: Fixed
Privacy: PublicAssigned to: Miguel de Benito <mdbenito>
Originator Name: Open/Closed: Closed
Release: Release: None
Fixed Release: NoneFixed Release: 
Keywords: 

(Jump to the original submission Jump to the original submission)

Wed Jan 16 15:59:37 2013, comment #11:

With a couple slight modifications to avoid indices out of bounds, I committed the patch I posted. It's in SVN 6125. ==> closed.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon Jan 7 00:09:18 2013, comment #10:

Here is a possibility for interpose_handler(). At first glance there seem to be no extremely expensive operations made, so we might be ok with this solution. However we could look for others. For instance using delayed commands scheduled every 500ms. Or we could use the editor hooks and also add code to the archiver and everything else that may modify a buffer. But it's easy to forget some places...

void
tm_server_rep::interpose_handler () {
#ifdef QTTEXMACS
// TeXmacs/Qt handles delayed messages and socket notification
// in its own runloop
#ifndef QTPIPES
perform_select ();
#endif
process_all_pipes ();
#else
perform_select ();
exec_pending_commands ();
#endif

int i, j;
for (i=0; i<N(bufs); i++) {
tm_buffer buf= (tm_buffer) bufs[i];

string s= buf->buf->title;
bool tchange= false;

if (buf->needs_to_be_saved()) {
if (s[N(s)-1] != '*') {
buf->buf->title = s * "*";
tchange= true;
}
} else if (s[N(s)-1] == '*') {
buf->buf->title= s (0, N(s)-1);
tchange= true;
}

for (j=0; j<N(buf->vws); j++) {
tm_view vw= (tm_view) buf->vws[j];
if (vw->win != NULL) {
vw->ed->apply_changes ();
if (tchange) {
vw->win->set_window_name (buf->buf->title);
vw->win->set_window_url (buf->buf->name);
}
}
}

for (j=0; j<N(buf->vws); j++) {
tm_view vw= (tm_view) buf->vws[j];
if (vw->win != NULL) vw->ed->animate ();
}
}

windows_refresh ();
}

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon Jan 7 00:08:50 2013, comment #9:

Unbelievable. Another post gone!!

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon Jan 7 00:06:22 2013, comment #8:
Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon Jan 7 00:02:36 2013, comment #7:

Shit, I HATE this tracker. I lost my post again!!!

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Sun Jan 6 23:58:14 2013, comment #6:

About the lowest level we can get is in interpose_handler(), which may be modified as follows:

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Sun Jan 6 23:31:10 2013, comment #5:

I think the problem is rather that post_notify() is only called after an edition, so you have to modify the buffer to see the new title, which implies that after a save, the * is removed only after you edit again, which is obviously not what we want.

So my suggestion was wrong. We should find another place to check for modified buffers.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Thu Jan 3 13:11:37 2013, comment #4:
Francois Poulain <fpoulain>
Project Member
Mon Dec 31 01:53:58 2012, comment #3:

(Again!)(There was a problem with the page, I must post again)
edit_modify_rep::post_notify() looks like a good place for this. Something like

if (need_save())
send (SLOT_NAME, close_box (as_string (buf->buf->name) * " *"));
else
send (SLOT_NAME, close_box (as_string (buf->buf->name)));

but this changes the title to the full buffer name, so we need either to implement read(SLOT_NAME) or find out how titles are composed from buffer names (seems complicated because of tmfs-title-handlers, etc.)

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon Dec 31 01:53:27 2012, comment #2:

(There was a problem with the page, I must post again)
edit_modify_rep::post_notify() looks like a good place for this. Something like

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon Dec 31 01:50:51 2012, comment #1:

edit_modify_rep::post_notify() looks like a good place for this. Something like:

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Tue Nov 6 15:14:49 2012, original submission:

Usually, when a document has been modified (compared to the saved version), the user is advertised, e.g. by preceding the name of the file by a star ('*') in the window titlebar.

Francois Poulain <fpoulain>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mdbenito (Posted a comment)
  • -unavailable- added by fpoulain (Submitted the item)
  • -unavailable- added by fpoulain
  •  

    Do you think this task is very important?
    If so, you can click here to 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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Jan 16 15:59:37 2013mdbenitoStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Mon Dec 31 01:50:51 2012mdbenitoPriority5 - Normal=>3 - Low
      Item GroupNone=>Wishlist
      StatusNone=>Confirmed
      Assigned toNone=>mdbenito
    Tue Nov 6 15:14:49 2012fpoulainCarbon-Copy-=>Added olivier schwander

    Back to the top


    Powered by Savane 3.1-cleanup