jpico: Retaining search query?

  • aardvarko

    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?

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

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

      • Thank you! And yes, I think so.

    • aardvarko

      forgot to log in.

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

    • Hi,

      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. :)

    • >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

      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.

    • 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

      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).

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