bugGNU nano - Bugs: bug #61691, [Wish] make word-completion take...


You are not allowed to post comments on this tracker with your current authentication level.

bug #61691: [Wish] make word-completion take all open buffers into account

Submitter:  Tasos Papastylianou <tpapastylianou>
Submitted:  Fri 17 Dec 2021 02:29:52 PM UTC
Severity:  1 - Wish Status:  None
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Sun 19 Jun 2022 06:43:52 PM UTC, comment #4: 

I want this feature. Attached is a patch with a preliminary implementation.

(file #53322)

Marco Diego Aurélio Mesquita <marcodiego>
Mon 17 Jan 2022 03:30:19 PM UTC, comment #3: 

Still getting to grips with the source, but I can try :)

Tasos Papastylianou <tpapastylianou>
Wed 12 Jan 2022 03:08:32 PM UTC, comment #2: 

Yes, it would be nice if nano would look at all buffers for possible completions.  If you have a patch...

(No guarantee, though, that the patch would be applied.)

Benno Schulenberg <bens>
Project Administrator
Fri 17 Dec 2021 02:33:03 PM UTC, comment #1: 

PS. A nice side-effect of this is that one could open a separate buffer and fill it with an autocompletion dictionary, that could then be accessed for word-completions in other open buffers.

Tasos Papastylianou <tpapastylianou>
Fri 17 Dec 2021 02:29:52 PM UTC, original submission:  

When editing code, I often have the following situation where:
 - I am editing a primary file
 - The primary file needs to include/import a secondary file, and then use a variable or function defined in this secondary file
 - I would like to perform word-completion from within the PRIMARY file, to get the name of the variable/function defined in the SECONDARY file.

E.g. consider this python example

# in functions.py
def a_very_important_function():   print( "Hello, World!" )

# in main.py
import functions

If a_very_important_function +verbatim+ was defined directly in the primary file, then I could simply type 'a' and then perform word completion (default key-binding: Ctrl-] ).

However, because this only appears in the secondary file, and there's no other instance of this word in the primary file, word-completion will not work, and I'll have to type the entire thing by hand.

Obviously, subsequent autocompletions on the same word will work, because this now exists in the primary file as well. However, I think it would be more useful in general, if word-completion took into account all open buffers, rather than just the current one.

I have no opinion if this behaviour should simply replace the current behaviour, or if it should be toggleable in nature.

Tasos Papastylianou <tpapastylianou>


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

Attach Files:

Attached Files
file #53322:  0001-Consider-other-buffers-when-applying-completion.patch added by marcodiego (2KiB - text/x-patch - Preliminary implementation)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by marcodiego (Updated the item)
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by tpapastylianou (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-19 marcodiego Attached File- Added 0001-Consider-other-buffers-when-applying-completion.patch, #53322
    2022-01-12 bens Severity3 - Normal 1 - Wish
        Summary[Wish] Make word-completion take into account all open buffers, not just current one [Wish] make word-completion take all open buffers into account

    Back to the top

    Powered by Savane 3.9