[68] in bug-owl
patch for staying on current message
daemon@ATHENA.MIT.EDU (Jeremy Daniel)
Sat Aug 17 11:59:45 2002
To: bug-owl@MIT.EDU
From: Jeremy Daniel <jdaniel@MIT.EDU>
Date: 17 Aug 2002 11:59:43 -0400
Message-ID: <skek7mpa32o.fsf@multics.mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
This patch trys to stay on the current message when changing views:
/mit/jdaniel/project/owl/build-cvs/nearview.patch
Index: functions.c
===================================================================
RCS file: /mit/ktools/src/owl/repository/owl/functions.c,v
retrieving revision 1.17
diff -r1.17 functions.c
1666a1667
> int curid, i;
1668a1670
> owl_message *m;
1676a1679,1680
> m = owl_view_get_element(v, owl_global_get_curmsg(&g));
>
1680c1684,1697
< owl_global_set_curmsg(&g, 0);
---
> /* figure out the message with the closest id in the new view
> there will be no message if the current view is empty */
> if (m) {
> curid = owl_message_get_id(m);
> for (i=0; i<owl_view_get_size(v)-1; i++) {
> if (owl_message_get_id(owl_view_get_element(v, i)) >= curid) {
> break;
> }
> }
> } else {
> i=0;
> }
>
> owl_global_set_curmsg(&g, i);
--
Jer
------------------------------------------------------------------
Tulgey Wood - tulgeywood@attbi.com Cell Phone: 617-429-8573 /
4 Farragut Ave (617-629-3983) jdaniel-phone@mit.edu
Somerville, MA 02144-1709 AIM: jdanielmit
Zephyr athena users over the web: http://webzephyr.mit.edu/