GNU nano - Bugs: bug #54928, [Task] a syntax file should be...
You are not allowed to post comments on this tracker with your current authentication level.
bug #54928: [Task] a syntax file should be fully read only when the syntax gets actually used
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Wed 31 Oct 2018 06:40:36 PM UTC | ||
Severity: | 3 - Normal | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Wed 19 Jun 2019 06:28:15 AM UTC, comment #17: |
Benno Schulenberg <bens> |
Mon 03 Jun 2019 02:13:58 PM UTC, comment #16: (On my old laptop, this change made startup /feel/ slower. The real startup time has gone down from around 120 ms to around 90 ms (only a dozen syntaxes are included), but instead of there being a slight pause and then two quick screen changes (that feel as one), the screen changes immediately (or so it feels) when <Enter> is pressed, and then there is a slight pause before the file contents are shown. Indeed, the "pause" between "Reading..." and the contents being shown has become longer, because previously all regexes were compiled while the rcfiles were being parsed, but now the regexes for the active syntax get parsed only when the text file has already been read in. If the machine is fast enough and the syntax not too compicated, startup will be close enough to immediate that this extended delay between the two screen changes won't be noticed, but on slower machines... So, in git, I've tried to trim and reshuffle things a bit, to squeeze a few more nanoseconds out of the startup time.) |
Benno Schulenberg <bens> |
Mon 20 May 2019 08:39:54 AM UTC, comment #15: Fixed in git, commit cba9d8d0. Thanks for the patches.
|
Benno Schulenberg <bens> |
Mon 20 May 2019 12:16:53 AM UTC, comment #14: Looks okay, but the expression value for MAXSIZE should probably be wrapped in parentheses to make it easier to read and avoid any issues if the code that uses it ever changes. |
Brand Huntsman <brand> |
Sun 19 May 2019 11:08:12 AM UTC, comment #13: Attached are the two patches, with tweaked commit messages, some normalized whitespace, and a few reshufflings. Some things I will rename later. Okay to apply in this state? |
Benno Schulenberg <bens> |
Tue 14 May 2019 12:51:30 AM UTC, comment #12: First patch no longer displays errors until finish() or die() is called. Both patches have more descriptive commit messages. |
Brand Huntsman <brand> |
Mon 06 May 2019 07:41:15 AM UTC, comment #11: I can find only two exits that might want to display the error messages, the exit(1) in nano.c when initscr() == NULL (which doesn't have an error message itself, which is not right) and the check_vitals_mapped() in rcfile.c. But for both of these it might be actually better to not display any other error messages, as they would distract from the essential: initscr() failed / a required key binding is missing. So... I would prefer the simpler system: print all messages only upon finish() or die(). |
Benno Schulenberg <bens> |
Sun 05 May 2019 09:42:55 PM UTC, comment #10: There are exits that would need to display the errors, and exits added later on might not display the errors. The lines of code saved would only be moved to the more complicated exits, which might be aborting due to an undisplayed error.
|
Brand Huntsman <brand> |
Sun 05 May 2019 03:57:03 PM UTC, comment #9: Why bother with pausing rcfile errors? Why not always wait with printing all stored messages until exit time?
|
Benno Schulenberg <bens> |
Sun 28 Apr 2019 09:46:25 AM UTC, comment #8: No, but these new patches compile on current git. |
Brand Huntsman <brand> |
Sun 28 Apr 2019 08:55:16 AM UTC, comment #7: I'm going to look into applying this. Have you meanwhile maybe made further improvements to the patch set? |
Benno Schulenberg <bens> |
Fri 15 Mar 2019 09:57:59 AM UTC, comment #6: New patches. The second patch now sets colorpairs for syntaxes defined in nanorc (oops). The first patch now checks on_a_vt when resuming rcfile errors so they display on exit after reading from stdin on a linux console (https://savannah.gnu.org/bugs/?55912).
|
Brand Huntsman <brand> |
Sun 24 Feb 2019 04:11:30 AM UTC, comment #5: https://raw.githubusercontent.com/brndnmtthws/conky/master/extras/nano/conky.nanorc
|
Brand Huntsman <brand> |
Fri 22 Feb 2019 12:32:39 PM UTC, comment #4: Well, then the commit message of the first patch should have explained why the change is needed: that the second patch changes things so that a syntax file is fully parsed only when the syntax gets actually used, which means that any errors that it might contain would spill onto the status bar and the help lines and (if there are more) even into the edit window, after which they get mostly overwritten by the contents of the buffer, by the error message on the status bar, and by the help lines; and thus they are unreadable, and when nano exits they are gone.
|
Benno Schulenberg <bens> |
Fri 22 Feb 2019 01:35:15 AM UTC, comment #3: The second patch is useless without the first patch. Syntaxes are parsed after ncurses is active and any errors would overwrite the buffer. Fixing the linux console issue was merely a bonus of a patch needed before this feature could be implemented.
|
Brand Huntsman <brand> |
Thu 21 Feb 2019 07:57:38 PM UTC, comment #2: The first patch does not have anything to do with this issue. Please put it somewhere else.
|
Benno Schulenberg <bens> |
Thu 21 Feb 2019 01:23:40 PM UTC, comment #1: First patch queues up rcfile errors that occur after window_init(), and sends them to terminal in finish() or die(). This allows nano to startup on linux console even with rcfile errors.
|
Brand Huntsman <brand> |
Wed 31 Oct 2018 06:40:36 PM UTC, original submission:
When nano starts up, it now reads all syntax files that are included and compiles all the regexes contained in them. But in most cases, only one of these syntaxes gets "applied" (used). This means that the color regexes for all other syntaxes have been read and compiled for nothing -- a waste of time.
|
Benno Schulenberg <bens> |
Depends on the following items: None found
Items that depend on this one: None found
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 15 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2019-06-19 | bens | Open/Closed | Open | Closed | |
2019-06-18 | bens | Summary | a syntax file should be fully read only when the syntax gets actually used | [Task] a syntax file should be fully read only when the syntax gets actually used | |
2019-05-20 | bens | Status | In Progress | Fixed | |
2019-05-19 | bens | Attached File | - | Added 0001-rcfile-store-errors-and-display-them-when-nano-termi.patch, #46928 | |
Attached File | - | Added 0002-rcfile-fully-parse-a-syntax-file-only-when-needed.patch, #46929 | |||
2019-05-14 | brand | Attached File | - | Added 0001-rcfile-store-errors-and-display-when-nano-terminates.patch, #46902 | |
Attached File | - | Added 0002-rcfile-load-syntax-files-only-when-needed.patch, #46903 | |||
2019-04-28 | brand | Attached File | - | Added nanorc-0001-store-rcfile-errors-and-display-when-nano-terminates.patch, #46843 | |
Attached File | - | Added nanorc-0002-load-syntax-files-only-when-needed.patch, #46844 | |||
2019-04-28 | bens | Assigned to | None | bens | |
2019-03-15 | brand | Attached File | - | Added nanorc-0001-store-rcfile-errors-and-display-when-nano-terminates.patch, #46544 | |
Attached File | - | Added nanorc-0002-load-syntax-files-only-when-needed.patch, #46545 | |||
2019-02-21 | bens | Status | None | In Progress | |
2019-02-21 | brand | Attached File | - | Added nanorc-0001-store-rcfile-errors-and-display-when-nano-terminates.patch, #46321 | |
Attached File | - | Added nanorc-0002-load-syntax-files-only-when-needed.patch, #46322 |
Powered by Savane 3.13-d3ae.
Corresponding source code
Released in nano-4.3.