jpico: Retaining search query?

  • aardvarko

    aardvarko - 2002-07-16

    In vanilla pico, when I search for something and wish to search again for the same text, it's a simple enough matter of hitting Ctrl+W again, as pico retains the text last searched for. However, jpico seems to clear the search query each time Ctrl+W is pressed. Any way to emulate pico's behavior, or a sequence of keystrokes for "Find Again" behavior?

    • Vitezslav Samel

      Vitezslav Samel - 2002-07-22

      edit your .jpicorc and change line
                 ffirst             ^W
                 fnext             ^W

      P.S. Should I change it in the mainstream version?

      • Nobody/Anonymous

        Thank you! And yes, I think so.

    • aardvarko

      aardvarko - 2002-07-23

      forgot to log in.

    • Vitezslav Samel

      Vitezslav Samel - 2002-08-05

      If I change Ctrl-W to fnext, what key sequence should have meaning of ffirst?

    • Markus Koskinen

      Markus Koskinen - 2005-03-30


      I'm using jpico 3.1 and sort of was looking for the same functionalty. In the nano/pico i had been using the
      ^W - ENTER combo is pretty nifty for scrolling through occurences of strings quite fast. Whilst the jpico search is good and doesn't require the ENTER stroke at the end, imo the nano implementation was quite userfriendly.

      At moment I'm using the normal ^W for ffirst and have -noxon and -wrap enabled and ^Q for fnext. This is working quite well for me as Q and W are adjacent keys (on QWERTY-keyboards).

      Yet having the previous search (if one has been made) as a default entry for ^W when jpico prompts for a search string would be very nice. It would naturally only use the default entry if an empty string is given (-> ENTER is pressed at an empty search prompt).

      Example prompt :
      Find (^C to abort) [previous_searchstring] :

      As i understand, this would essentially make
      ^W - ENTER - ENTER do the same as picos ^W - ENTER,
      which would be cool.

      At the moment i think it has to be done with
      ^W - KeyUp - ENTER - ENTER.

      Or just by using the fnext sequence, but somehow seeing the previous searchstring  on the prompt is very appealing to me, as i keep forgetting what I searched for. :)

      Also having -wrap apply to fnext would seem cool to me.

      I'm new to using Jpico/Joe and have just started getting familiar with the conffiles so i hope i haven't overlooked existing settings that would make this functionality possible. Anyway as this is my first post here I have to say i've liked jpico a lot and will surely be using it regardless of searchstring sequences. :)

    • Markus Koskinen

      Markus Koskinen - 2005-03-30

      >Also having -wrap apply to fnext would seem cool to me.

      My bad, it does indeed already wrap, but only once, not ad infinitum like pico.

      I didn't notice that at first, sorry.

    • Joe Allen

      Joe Allen - 2005-03-30

      I think the macro language is just powerful enough to do this
      now, sort of:

      Bind ^W to ffirst, have it hit up arrow, cut the string and paste it into a message prompt (msg) so that it displays the previous string.

      Bind Enter to a macro which tests if the user had entered anything into the prompt  if,"col!=0" and have it hit uparw,rtn,rtn if he didn't or just rtn if he did.

      It would be neat to make ^W ^W repeat the previous search.

    • Markus Koskinen

      Markus Koskinen - 2005-03-30

      Thanks for your reply, I'll have to have a glimpse at the macro language and see how it works.

      The ^W ^W sequence also sounds great though! Definately an idea worth looking into.

    • Joe Allen

      Joe Allen - 2005-04-01

      So for the latest version in CVS, I've added a new mode: -search_prompting, which makes ^W show the previous entry and accept it if you just hit return at the prompt.

      Also I've bound ^W ^W to fnext (repeat previous search).  It was previously bound to goto previous paragraph, like in pico, but I'm guessing that not many people used it.

      ^Q for fnext sounds good too, but you also need -noxon enabled (to turn off ^S/^Q flow control), which worries me (although in jmacs it's enabled).

      Also I noticed that -wrap annoys me: if you move the cursor after "Not found" and hit ^W ^W, it says "Not found" again- I think once you do any non-search function it should just start a new search (which is what incremental search in jmacs does).

    • Markus Koskinen

      Markus Koskinen - 2005-04-08

      That sounds great!
      I'll try the new version out, thanks!


Log in to post a comment.