jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Highlight on search


On 13.09.06, John E. Davis wrote:
> =?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> wrote:
> >I think this is a good idea. I send a wishlist bugreport to the Debian
 
> Does this patch fulfill the wish?  Thanks, --John

It is even better (the wishlist bugreport spoke about blinking but I
prefer the visual mark)

I had to apply it manually, as I am still using Jed Version: 0.99.18.

I'll append a diff to the isearch.sl of 0.99.18. It also includes the
propagation of the search string to the LAST_SEARCH variable which
enables me to use repeat_search() also after a search with isearch.


Günter


--- /usr/share/jed/lib/isearch.sl	2006-07-08 13:18:31.000000000 +0200
+++ /home/milde/.jed/lib/isearch.sl	2006-09-13 10:41:16.000000000 +0200
@@ -1,7 +1,7 @@
 % Here is a new version of isearch.sl reworked by John Burnell <johnb@xxxxxxxxxxxxxxxxx>.
 % This one is said to be more emacs-like.
 %
-% %% with modifications and comments by Guenter Milde (G.Milde web.de)
+% %% with modifications and comments by Guenter Milde (milde users.sf.net)
 %
 %% Further modifications by Lloyd Zusman <ljz@xxxxxxxxxx>
 %% as well as JED to get rid of marks which were riding on the stack.
@@ -21,9 +21,10 @@
 %%
 %% You may use the following variables to change this behaviour,
 %%  either here or (better!) in your keybinding defining file (e.g. ".jedrc")
-%%
-%% This code fragment checks to see what the isearch keys are bound to
 
+require ("srchmisc");
+
+%% This code fragment checks to see what the isearch keys are bound to
 private define get_bound_key (search_func, default)
 {
    foreach (["", which_key (search_func), pop()])
@@ -168,21 +169,24 @@
 	  prompt = prompt_prefix + "search backward" + prompt_suffix;
 
 	message (prompt + str);
-
 	push_spot ();
-	if ((dir > 0) and looking_at (str))
-	  go_right (strlen (str));
+
+	IGNORE_USER_ABORT++;
+
+	if (looking_at (str) and (Last_Search_Failed == 0))
+	  mark_next_nchars (strlen(str), dir);
+	%if ((dir > 0) and looking_at (str))
+	%  go_right (strlen (str));
 	update_sans_update_hook (0);
 	pop_spot ();
 
-	IGNORE_USER_ABORT++;
-#ifeval _slang_version >= 20000
+#ifexists AnyError
 	try
 	  {
 #endif
 	     c = getkey();
 	  }
-#ifeval _slang_version >= 20000
+#ifexists AnyError
 	finally
 #endif
 	IGNORE_USER_ABORT--;
@@ -317,6 +321,8 @@
      Isearch_Last_Search = str;
    if (dir > 0)
      go_right (strlen (str) - len);
+   % save search string to LAST_SEARCH,(enabling repeat_search() of isearch)
+   save_search_string(str);   
    message ("Done.");
 }
 



--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]