bugGNU nano - Bugs: bug #61441, --enable-linenumbers does not...

 
 

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

bug #61441: --enable-linenumbers does not reenable the M-N toggle

Submitter:  Hannu Nyman <hnyman>
Submitted:  Sun 07 Nov 2021 07:38:58 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Thu 16 Dec 2021 10:05:00 AM UTC, comment #6: 

Released in nano-6.0.

Benno Schulenberg <bens>
Group administrator
Wed 10 Nov 2021 06:12:05 PM UTC, comment #5: 

Many thanks for the change.

Hannu Nyman <hnyman>
Wed 10 Nov 2021 08:39:44 AM UTC, comment #4: 

In commit 3a94a0bb I've added a special case for allowing toggling line numbers also in a tiny version.  Attached patch should apply fine to version 5.9.  Thanks again for reporting.

(The unused-variable warning has been fixed in git, too.)

(file #52230)

Benno Schulenberg <bens>
Group administrator
Tue 09 Nov 2021 10:06:14 AM UTC, comment #3: 

Okay, the text has been clarified in commit dfbe3ce6.

(The M-N toggle... maybe I can make it a special case.  When line numbers were added some years ago, it seemed logical to simply use the existing toggling mechanism.  It never occurred to me that one might want to have line numbers in the tiny version, and want to toggle them.  The --enable-tiny configure option mainly exists for Debian, so that they could have a really small editor for on their install disks.)

Benno Schulenberg <bens>
Group administrator
Mon 08 Nov 2021 04:34:28 PM UTC, comment #2: 

Ok, then it is not a bug, but sounds a bit counter-intuitive.

In our OpenWrt embedded router context, flash space is limited, so size is important. Tiny has been our main config item, but I thought to enable the line-numbering, so I stumbled upon the shortcut key not working, and got surprised.

You could clarify a bit the text that you quoted. Add there a clear message that the function toggling by key shortcuts stays disabled even if you enable a specific feature like linenumbering. That part is not obvious for a casual reader.

I would have imagined that enabling a functionality would also enable keystrokes, but looks like that toggling functionality is designed differently.

Hannu Nyman <hnyman>
Mon 08 Nov 2021 10:42:54 AM UTC, comment #1: 

Thanks for reporting, Hannu.

However, things are correct the way they are.  See 'info nano', and search for "enable-tiny".  There it says: "It also disables some other internals of the editor, like the function toggles, [...]".  This means that in the tiny version none of the toggles are available.  You can switch line numbers on on the command line, but you cannot toggle them.  That's what "tiny" implies: remove all that is not necessary.

Benno Schulenberg <bens>
Group administrator
Sun 07 Nov 2021 07:38:58 PM UTC, original submission:  

Based on configure.ac, the "show line numbers" functionality is supposed to be separate from the "tiny" definition.

That holds true for most of the source code, and I can compile 5.9 with -enable-tiny and --enable-linenumbers. And then the line numbers functionality can be launched from the command line with "-l" and works then.

But the key M-n does not work.

I have looked at the source code and think that the bug is in global.c, around line 1380, where ifdef LINENUMBERS has been placed inside ifndef NANO_TINY.

Trying to move the linenumbers key def a few lines earlier then causes compile error as "do_toggle_void" in global.c, prototypes.h and in nano.c is again inside ifndef NANO_TINY. (I haven't yet tried moving it out.)

Hannu Nyman <hnyman>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by hnyman (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.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-16 bens Open/ClosedOpen Closed
    2021-11-10 bens Attached File- Added 0001-bindings-allow-toggling-line-numbers-when-enabled-al.patch, #52230
        StatusInvalid Fixed
        Assigned toNone bens
        Summary--enable-linenumbers does not reenable the linenumbers toggle M-N --enable-linenumbers does not reenable the M-N toggle
    2021-11-09 bens SummaryLINENUMBERS key spec M-n is wrongly inside ifndef NANO_TINY in global.c --enable-linenumbers does not reenable the linenumbers toggle M-N
    2021-11-08 bens StatusNone Invalid

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code