bugGNU nano - Bugs: bug #28994, [Request] enable search (^W) in...


bug #28994: [Request] enable search (^W) in help (^G)

Submitted by:  None
Submitted on:  Tue Feb 23 22:03:28 2010  
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Fri May 5 09:18:17 2017, comment #7:

Released in 2.8.2. Now let's see what people say. :) (Most likely nothing at all.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue Apr 25 19:07:35 2017, comment #6:

Fixed in git: first commit 90bd25c1, completing commit 46430999.

Thanks for getting this rolling, Rishabh.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon Apr 24 15:24:05 2017, comment #5:

Rishabh reached the target more than four months ago, but only now, finally, am I getting ready to merge the feature, and iron out the last bumps.

See https://lists.gnu.org/archive/html/nano-devel/2017-04/msg00050.html.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat Nov 12 17:12:46 2016, comment #4:

Rishabh is getting closer to the target. See

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed Oct 19 19:53:38 2016, comment #3:

The second version (write the help text to a file and open it with another nano) works fine, but... as you said, it is wasteful. And I don't see how you can prevent the user from typing ^G again which would open another nano... So this is off.

The first version didn't compile for me, but after a slight tweak it did, but... I couldn't figure out how to search in the help text -- ^W doesn't work, nor /. So... what? Also, looking at the patch... you add a lot of code. But what I expected to happen is: write the help text to a temp file instead of into a giant string in memory, then read in this temp file into a new buffer (as if having typed ^R and M-F), so the user can simply use ^W and M-W to search for things. (Probably view mode will have to become a per-file attribute, but that is a later refinement.)

So, there shouldn't be any new menu or search code or anything. After the call of help_init(), write out the giant string to a secure temp file (not a file with a fixed name). Then read that file into a new buffer and switch to it. Done. No more is needed.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed Oct 19 17:03:39 2016, comment #2:

Since TODO confirms we want a search, I tried implementing this feature and have come across 2 techniques for same solution: (i) Print the help text in a file and running search on it and then map the position on the screen (of string when found). (ii) Print the help text in a file and open it in a (sub-)instance of nano.

While former one is tedious, latter is inefficient - would consume almost twice the memory. Also, latter leads to noticeable lag when user would do ^G (actually, former does it too but it is negligible.)

Patches for both of these are attached. They are only to confirm that both of them are feasible solution. They are not complete; solution is not fully implemented, they have dead code and are buggy.

First solution - https://savannah.gnu.org/bugs/download.php?file_id=38762

Second solution - https://savannah.gnu.org/bugs/download.php?file_id=38763

Rishabh Dave <prongs>
Sat Jun 14 16:32:32 2014, comment #1:

Yes, a searchable help text would be nice. But the simple solution is not possible: the help text is generated dynamically, to take key rebindings into account.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue Feb 23 22:03:28 2010, original submission:

when i enter help (with ^G) i can't use search in it to search for desired key (using ^G). please add this feature...

simplest way is to have help in some read-only file in /usr/share/doc and open it in another (sub)instance of nano.

system("nano --view /usr/share/doc/help.txt");



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by prongs (Updated the item)
  • -unavailable- added by bens (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri May 5 09:18:17 2017bensOpen/ClosedOpen=>Closed
    Tue Apr 25 19:07:35 2017bensStatusIn Progress=>Fixed
    Mon Apr 24 15:24:05 2017bensAssigned toNone=>bens
    Sat Nov 12 17:12:46 2016bensStatusNone=>In Progress
    Wed Oct 19 16:58:27 2016prongsAttached File-=>Added 0001-feature-add-search-facility-to-help-Search-and-map.patch, #38762
      Attached File-=>Added 0001-feature-add-search-facility-to-help-Through-subinstance.patch, #38763
    Sat Jun 14 16:32:32 2014bensSummary[Feature request] Enable search [^W] in help [^G]=>[Request] enable search (^W) in help (^G)

    Back to the top

    Powered by Savane 3.1-cleanup1