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 06 Nov 2012 03:14:49 PM UTC  
 
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 16 Jan 2013 03:59:37 PM UTC, 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 07 Jan 2013 12:09:18 AM UTC, 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 07 Jan 2013 12:08:50 AM UTC, comment #9:

Unbelievable. Another post gone!!

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

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

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Sun 06 Jan 2013 11:58:14 PM UTC, 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 06 Jan 2013 11:31:10 PM UTC, 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 03 Jan 2013 01:11:37 PM UTC, comment #4:
Francois Poulain <fpoulain>
Project Member
Mon 31 Dec 2012 01:53:58 AM UTC, 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 31 Dec 2012 01:53:27 AM UTC, 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 31 Dec 2012 01:50:51 AM UTC, 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 06 Nov 2012 03:14:49 PM UTC, 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 16 Jan 2013 03:59:37 PM UTCmdbenitoStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Mon 31 Dec 2012 01:50:51 AM UTCmdbenitoPriority5 - Normal=>3 - Low
      Item GroupNone=>Wishlist
      StatusNone=>Confirmed
      Assigned toNone=>mdbenito
    Tue 06 Nov 2012 03:14:49 PM UTCfpoulainCarbon-Copy-=>Added olivier schwander

    Back to the top


    Powered by Savane 3.1-cleanup