[85] in bug-owl

home help back first fref pref prev next nref lref last post

delete page patch

daemon@ATHENA.MIT.EDU (Jeremy Daniel)
Mon Sep 2 12:50:21 2002

To: bug-owl@MIT.EDU
From: Jeremy Daniel <jdaniel@MIT.EDU>
Date: 02 Sep 2002 12:50:19 -0400
Message-ID: <skeheh85oac.fsf@multics.mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

This command will probably be useful to many former vt users.  I
suggest binding it to tab since it has much the same purpose.  It
marks all the messages currently displayed on the screen as deleted,
except the last if it's only partially shown.  Then it goes to the
next non deleted message.

/mit/jdaniel/project/owl/build-cvs/patches/delete-page.patch
------------
Index: commands.c
===================================================================
RCS file: /mit/ktools/src/owl/repository/owl/commands.c,v
retrieving revision 1.15
diff -u -r1.15 commands.c
--- commands.c	2002/08/17 19:23:02	1.15
+++ commands.c	2002/09/02 15:04:44
@@ -459,12 +462,15 @@
   OWLCMD_ARGS("delete", owl_command_delete, OWL_CTX_INTERACTIVE,
 	      "mark a message for deletion",
 	      "delete [ -id msgid ] [ --no-move ]\n"
+              "delete page\n"
 	      "delete view\n"
 	      "delete trash",
 	      "If no message id is specified the current message is marked\n"
 	      "for deletion.  Otherwise the message with the given message\n"
 	      "id is marked for deltion.\n"
 	      "If '--no-move' is specified, don't move after deletion.\n"
+              "If 'page' is specified, deletes all messages completely\n"
+              "displayed on the current screen.\n"
 	      "If 'trash' is specified, deletes all trash/auto messages\n"
 	      "in the current view.\n"
 	      "If 'view' is specified, deletes all messages in the\n"
@@ -1356,6 +1373,11 @@
 
   if (argc==2 && !strcmp(argv[1], "trash")) {
     owl_function_delete_automsgs();
+    return NULL;
+  }
+
+  if (argc==2 && !strcmp(argv[1], "page")) {
+    owl_function_delete_page();
     return NULL;
   }
 
Index: functions.c
===================================================================
RCS file: /mit/ktools/src/owl/repository/owl/functions.c,v
retrieving revision 1.23
diff -u -r1.23 functions.c
--- functions.c	2002/08/25 19:02:14	1.23
+++ functions.c	2002/09/02 16:41:38
@@ -390,6 +390,30 @@
   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
 }
 
+void owl_function_delete_page() {
+  int topmsg, viewsize, lineno, recwinlines, i;
+  owl_view *v;
+
+  v=owl_global_get_current_view(&g);
+  viewsize=owl_view_get_size(v);
+  /* bail if there's no current message */
+  if (viewsize < 1) {
+    owl_function_makemsg("No messages in the view to delete");
+    return;
+  }
+
+  recwinlines=owl_global_get_recwin_lines(&g);
+  topmsg=owl_global_get_topmsg(&g);
+  /* mark the message for deletion */
+  lineno=0;  /* initialize lineno */
+  for (i=topmsg; i<=viewsize-1; i++) {
+    lineno+=owl_message_get_numlines(owl_view_get_element(v, i));
+    if (lineno > recwinlines)
+      break;
+    owl_view_delete_element(v, i);
+  }
+  owl_function_nextmsg_notdeleted();
+}
 
 void owl_function_expunge() {
   int curmsg;



-- 


				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/

home help back first fref pref prev next nref lref last post