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.
|
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 ();
}
|
Mon 07 Jan 2013 12:08:50 AM UTC, comment #9:
Unbelievable. Another post gone!!
|
Mon 07 Jan 2013 12:06:22 AM UTC, comment #8:
|
Mon 07 Jan 2013 12:02:36 AM UTC, comment #7:
Shit, I HATE this tracker. I lost my post again!!!
|
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:
|
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.
|
Thu 03 Jan 2013 01:11:37 PM UTC, comment #4:
|
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.)
|
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
|
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:
|
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.
|