patchGNU nano - Patches: patch #10161, enable setting whitespacedisplay...

 
 

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

patch #10161: enable setting whitespacedisplay from nanorc

Submitter:  - <_287868>
Submitted:  Sun 19 Dec 2021 03:30:01 AM UTC
   
 
Priority:  3 - Low Status:  Wont Do
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  None

Jump to the original submission

Fri 21 Jan 2022 03:35:17 AM UTC, comment #7: 

If you won't even read my comments, there's no point in trying to discuss this with you. Thanks anyway.

- <_287868>
Thu 20 Jan 2022 03:04:20 PM UTC, comment #6: 

There is no GUI text editor that displays whitespace as visible characters by default.  That's where I stop reading.  And then: nano is not a GUI editor.  Also, there is no option to start nano with the Y toggle in the off position (and there won't be).  There is also no rc option to run nano in view mode (it existed, but I removed it).  Those things are not needed -- audience is too small, not worth having the option.

Benno Schulenberg <bens>
Group administrator
Tue 18 Jan 2022 02:03:22 AM UTC, comment #5: 

Now that the holiays are over, I'd appreciate it if you could take another look at this.

My rationale is as follows:

Most GUI text editors and IDEs either display whitespace as default, or let you set it as a persistent option. Usually, that preference doesn't change for long periods of time. Although it's nice that nano lets you toggle it with a handy keybind, it's a shame that it doesn't currently offer the ability to turn it on by default.

Your question, "why would the user want to have whitespacedisplay on by default?" can be answered by looking at other similar flags within Nano. For example, smarthome, which has both a keybind and a nanorc option (flag too, but that's not relevant here). Why does it have a nanorc option? Why can't the user just press Alt+H whenever they want to use the Home key? Why does this patch exist - why can't the user just press Alt+P whenever they want to look at their code's whitespace?

The user can absolutely do either one, or both, of those things - it would take under a second (for most), per editor. But, unless I misunderstand the point of tooling, it's not the job of Nano to make them do those things manually when nanorc exists to eliminate those steps. The user often expects that if they use a particular feature enough, it will have a configuration option. They should be allowed to set it persistently, so that it stays on - or off - depending on their wishes. The fact that whitespacedisplay doesn't have such an option yet seems like an oversight to me, and a bug to be fixed.

Basically, the user would want whitespacedisplay on by default if that would be useful to them. Why would anyone want to view whitespace all the time? Because it's useful. It's useful to me and a lot of others consider it useful to them. You may not care for it, but then again you may not care about soft wrapping, tab size, guidestripe, or any number of other configuration options, and that's okay because they're options. This is no different :)

- <_287868>
Fri 24 Dec 2021 01:25:31 AM UTC, comment #4: 

To view whitespace? I don't know, many GUI text editors and IDEs have the option to show whitespace. Notepad++, IntelliJ, even Roblox Studio. I feel like since nano already has whitespace display implemented, it should be possible to turn it on via nanorc.

I use it for things such as spotting trailing whitespace, whitespace on empty lines, tabs in places where they should be spaces, and vice versa. Using extendsyntax to highlight these with a background color would be extremely intrusive, and pressing M-P every time I open a file would be inconvenient.

It's hard to describe the use case here because it's just preference. I want to see whitespace by default. Nano doesn't support setting it in nanorc, so this patch adds the option. :/

- <_287868>
Thu 23 Dec 2021 04:21:27 PM UTC, comment #3: 

The question was: what's the use case?  Why would the user want to have whitespacedisplay on by default?

Benno Schulenberg <bens>
Group administrator
Thu 23 Dec 2021 12:18:35 PM UTC, comment #2: 

M-P is just toggling whitespace display. The intent of this change is to allow setting its default value via nanorc - so if you want whitespace display, you don't have to press M-P to turn it on every time you open a new file.

1. You should be able to control whether whitespace display is on by default (this patch)
2. You should be able to toggle it while nano is running (already exists)

I don't have a list off the top of my head of what existing flags use this strategy, but I'm betting it's a fair number since this was so easy to implement.

- <_287868>
Thu 23 Dec 2021 12:04:50 PM UTC, comment #1: 

Thanks for the patch.  But... what's the use case?  Do you really want nano to always show spaces as dots and tabs as guillemets?  And then use M-P to switch it /off/?  I cannot imagine it.

Also, if this were accepted, then there should also something that corresponds to M-Y, something like 'set syntaxoff'.  I don't want to do that, I don't see the point.  I use M-P occassionally to make sure things are tabs or spaces as intended, and seldom use M-Y to suppress syntax coloring, but would never want them to be the default state in which nano starts up.

Benno Schulenberg <bens>
Group administrator
Sun 19 Dec 2021 03:30:01 AM UTC, original submission:  

For some reason this was not available before.

- <_287868>

 

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

Attached Files
file #52535:  whitespacedisplay.patch added by _287868 (2KiB - application/octet-stream - Fixed version of the previous patch which actually compiles and runs)
file #52534:  whitespacedisplay.patch added by _287868 (2KiB - application/octet-stream - Includes changes to documentation input files, but NOT regeneration of doc/nano.info and doc/nano.html, because my distro does not provide recent enough versions of texinfo.)

 

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

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-02-01 bens Open/ClosedOpen Closed
    2022-01-20 bens StatusNone Wont Do
    2021-12-23 bens SummaryEnable setting whitespace display from nanorc enable setting whitespacedisplay from nanorc
    2021-12-19 _287868 Attached File- Added whitespacedisplay.patch, #52535
    2021-12-19 _287868 Attached File- Added whitespacedisplay.patch, #52534

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code