[614] in BarnOwl Developers

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

[D-O-H] r717 - trunk/owl

daemon@ATHENA.MIT.EDU (glasser@MIT.EDU)
Thu Oct 29 18:07:58 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
Date: Sat, 19 May 2007 18:35:31 -0400
To: dirty-owl-hackers@mit.edu
From: glasser@MIT.EDU
Reply-To: dirty-owl-hackers@MIT.EDU

Author: glasser
Date: 2007-05-19 18:35:30 -0400 (Sat, 19 May 2007)
New Revision: 717

Modified:
   trunk/owl/commands.c
Log:
Add a "setsearch" command which sets the search highlight string without
moving the cursor.

* commands.c
  (commands_to_init): Add "setsearch" command and documentation.
  (owl_command_setsearch): Implementation of new command.


Modified: trunk/owl/commands.c
===================================================================
--- trunk/owl/commands.c	2007-05-19 22:23:40 UTC (rev 716)
+++ trunk/owl/commands.c	2007-05-19 22:35:30 UTC (rev 717)
@@ -712,6 +712,14 @@
 	      "default searches are done fowards, if -r is used the search\n"
 	      "is performed backwards"),
 
+  OWLCMD_ARGS("setsearch", owl_command_setsearch, OWL_CTX_INTERACTIVE,
+	      "set the search highlight string without searching",
+	      "setsearch <string>",
+	      "The setsearch command highlights all occurences of its\n"
+          "argument and makes it the default argument for future\n"
+          "search commands, but does not move the cursor.  With\n"
+          "no argument, it makes search inactive."),
+
   OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY,
 	      "login to an AIM account",
 	      "aimlogin <screenname> [<password>]\n",
@@ -2383,6 +2391,23 @@
   return(NULL);
 }
 
+char *owl_command_setsearch(int argc, char **argv, char *buff)
+{
+  char *buffstart;
+
+  buffstart=skiptokens(buff, 1);
+
+  owl_global_set_search_active(&g, buffstart);
+
+  if (!*buffstart) {
+    owl_global_set_search_inactive(&g);
+  }
+
+  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
+  
+  return(NULL);
+}
+
 char *owl_command_aimlogin(int argc, char **argv, char *buff)
 {
   if ((argc<2) || (argc>3)) {


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