Commit Graph

9782 Commits (256a0d670ef59ce1d11988375a93f8ac5228f8bf)

Author SHA1 Message Date
Benno Schulenberg 0010cd4443 tweaks: slightly reword or rewrap some comments in the sample nanorc 2021-09-15 09:55:14 +02:00
Benno Schulenberg 7d6ffd9e78 docs: don't use "light" after "bold", as the latter often implies "light"
On most terminals "bold" also makes the relevant text lighter (or just
makes it lighter, like on a Linux console).  Only some terminals allow
the user to switch this coupling of bold to light off.

Suggested-by: Hussam al-Homsi <sawuare@gmail.com>
2021-09-14 12:40:32 +02:00
Hussam al-Homsi b8daf1fb0b docs: correct the default value of the errorcolor option
It should be "bold,white,red" instead of "brightwhite,red"
because "bright" is deprecated and not documented.

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2021-09-14 12:03:04 +02:00
Benno Schulenberg fe5f05f037 files: give the user time to absorb a warning about someone else editing
That is: pause a little to jolt the user, and then leave the message
on the status bar.

This fixes https://savannah.gnu.org/bugs/?61147.

Bug existed since version 4.8, commit 416386ed.
2021-09-12 10:43:07 +02:00
Benno Schulenberg 5cedb53c62 files: write a lock file also for a freshly saved buffer
This fixes https://savannah.gnu.org/bugs/?61146

Bug existed since version 2.3.2, since --locking was introduced,
and continued to exist since version 4.8 despite commit 497f126b
claiming to have fixed it.
2021-09-12 10:00:17 +02:00
Benno Schulenberg 650dc14e0f tweaks: rename a defined type, to fit within the general pattern
So that it can be colorized as a type by a general syntax rule.

(The name is now uglier than it was, but... alas.)
2021-09-11 18:05:03 +02:00
Benno Schulenberg 43ebabe05d docs: mention how to properly colorize all types in nano's source code 2021-09-11 17:50:11 +02:00
Benno Schulenberg b6366411dc tweaks: reshuffle a few lines to avoid an #ifdef and unbalanced braces 2021-09-11 15:07:05 +02:00
Benno Schulenberg 914921887e tweaks: rename a variable, to make more sense 2021-09-11 11:09:56 +02:00
Benno Schulenberg 64a8f1930e history: emit a warning when file cannot be made private [coverity] 2021-09-08 09:15:41 +02:00
Benno Schulenberg 0ac2dfd920 docs: refer to the FAQ when <Alt+Up> does nothing on a Linux console 2021-09-04 12:29:31 +02:00
Benno Schulenberg aa553ee5d6 docs: correct the descriptions of how to invoke the spell checker
The keystrokes to invoke it changed in version 5.0.
2021-08-30 17:09:41 +02:00
Benno Schulenberg a8961c561f po: permit the Indonesian PO file to come back -- there was a big update 2021-08-27 12:37:26 +02:00
Benno Schulenberg abce19b0e4 docs: improve the recipe in the FAQ for dealing with Alt+Up on a console 2021-08-25 11:53:27 +02:00
Benno Schulenberg fc317660cb tweaks: harmonize the indentations in the FAQ somewhat 2021-08-25 11:28:45 +02:00
Benno Schulenberg 949fcde6f7 docs: indent the paragraphs in the FAQ that list commands to be typed
And use a monospaced font for them.
2021-08-25 11:27:26 +02:00
Benno Schulenberg 9f24b6ea65 po: delete the ancient PO files for Indonesian and Nynorsk
These files haven't been updated in more than fifteen years and their
number of translated strings has dropped to below twenty percent.

Also, prevent them from coming back when next syncing with the TP.
2021-08-24 10:23:06 +02:00
Benno Schulenberg c6ba4ae89a docs: improve the descriptions of several bindable functions
Some functions behave differently when some lines or a region is marked.
2021-08-23 10:12:55 +02:00
Benno Schulenberg dab3f95c71 tweaks: instead of "one" use "you", like in the rest of the man page 2021-08-23 10:04:01 +02:00
Benno Schulenberg 840ad5890f docs: move the notice in the main man page, to try and catch other eyes 2021-08-23 10:00:44 +02:00
Benno Schulenberg ae61bab60b files: when there is a slash after the dot, then there is no extension
This fixes https://savannah.gnu.org/bugs/?61071.

Bug existed since commit f429ebe3 from three days ago.
2021-08-23 09:52:32 +02:00
Benno Schulenberg d3a7f3abed tweaks: restore a quote that was accidentally deleted four months ago
Commit a69a8ce3 unintentionally removed the double quote that should
terminate the version string.
2021-08-23 09:39:12 +02:00
Benno Schulenberg 694cd9ddd4 build: ensure that mkstemps() is available by importing the gnulib module
The mkstemps() function is not part of the POSIX standard,
so there might be some platforms that don't have it.
2021-08-22 11:42:34 +02:00
Benno Schulenberg 47c8e627f4 build: help Haiku find the header files that define mkstemps()
The documentation (https://www.haiku-os.org/docs/api/libroot.html)
says that BSD extensions are enabled by default, but somehow this
does not seem to be the case on my system.  With _DEFAULT_SOURCE
defined, though, src/files.c now compiles fine.
2021-08-22 11:42:34 +02:00
Benno Schulenberg f429ebe34d files: add the original file's suffix to the name of a temporary file
This allows 'aspell' to recognize a C file and thus
spell check only the comments and strings.

This fulfills https://savannah.gnu.org/bugs/?61056.
2021-08-22 11:41:19 +02:00
Benno Schulenberg 083bbae0e4 tweaks: rename a variable, away form an abbreviation 2021-08-20 10:35:56 +02:00
Benno Schulenberg eaff5ec9e5 files: check the result of fdopen(), to avoid a possible crash
When safe_tempfile() returns a valid filename, it should also
return a valid open stream.

This fixes https://savannah.gnu.org/bugs/?61064.

Bug existed since version 1.3.8, commit 5e068c60.
2021-08-20 10:28:42 +02:00
Benno Schulenberg 51eb938fea tweaks: rewrap three lines, for esthetics 2021-08-20 10:14:21 +02:00
Benno Schulenberg 296c5a32c7 docs: replace a non-problem in the FAQ with something possibly useful
Opening a file whose name starts with a plus is not a problem at all.
Instead describe how to get the Alt+Up keystroke to scroll on a Linux
console (on Debian and friends).

This addresses https://savannah.gnu.org/bugs/?57294.
2021-08-18 11:54:54 +02:00
Hussam al-Homsi ef6ccc47c8 syntax: perl, ruby: remove arbitrary highlighting of here documents
The rules assume that 'STOP' (for Perl) or EOT (for Ruby) is the
terminating string while it could be anything.  Also, the rules
don't take quotes nor backticks nor a tilde into account.

In short: these coloring rules are far too limited.

References:
  https://perldoc.perl.org/perlop#%3C%3CEOF
  https://docs.ruby-lang.org/en/3.0.0/doc/syntax/literals_rdoc.html#label-Here+Documents+-28heredocs-29

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2021-08-09 09:56:50 +02:00
Benno Schulenberg eea2dfce48 tweaks: fix a typo 2021-07-31 20:48:10 +02:00
Benno Schulenberg 85682abbd5 docs: add a simulated "screenshot" of nano to the README
Suggested-by: Lars Wirzenius -- https://liw.fi/readme-review/
2021-07-21 10:15:07 +02:00
Benno Schulenberg 4005ee3284 docs: mention in the README which licenses cover nano's code and docs
Suggested-by: Lars Wirzenius -- https://liw.fi/readme-review/
2021-07-21 10:01:35 +02:00
Benno Schulenberg 9ead4c87a7 docs: add a paragraph at the start of the README about what nano is
Suggested-by: Lars Wirzenius -- https://liw.fi/readme-review/
2021-07-21 09:29:12 +02:00
Benno Schulenberg 1b5d9171f2 tweaks: try chmodding a dump file only when it was actually written 2021-07-14 10:38:02 +02:00
Benno Schulenberg 50543300d9 tweaks: reshuffle some code to elide a variable, and improve a comment 2021-07-14 10:36:15 +02:00
Benno Schulenberg d9469b894f tweaks: remove a redundant feedback message
Any error message will already have been written to the terminal by
statusline().  Also, "Buffer not written to" looked too much like
"Buffer written to"; one had to look closely to see the difference.
2021-07-14 10:21:01 +02:00
Benno Schulenberg 6b9c24f7dd feedback: when not in curses mode, write error messages to the terminal
No errors ought to occur when not in curses mode, but when they *do*
occur, increase the chances that we can figure out what happened.
2021-07-14 10:16:31 +02:00
Benno Schulenberg 5954eeaff2 tweaks: reshuffle a fragment of code, to prepare for the next change 2021-07-14 10:08:32 +02:00
Benno Schulenberg c84a769733 memory: free any allocated strings, also in the emergency code path 2021-07-14 10:06:04 +02:00
Benno Schulenberg e3ef778756 files: when the buffer is nameless, include the PID in name of dump file
Make sure that when multiple nanos with nameless buffers die,
each of them tries saving those buffers to different files.

This addresses https://savannah.gnu.org/bugs/?60902.
Reported-by: Julian Rosen <julianrosen@gmail.com>
2021-07-14 10:02:44 +02:00
Benno Schulenberg 806e8e439f tweaks: reshuffle some lines to elide a variable
Having a local variable that gets assigned to just once looks rather
poor.  To me it makes more sense to have two separate exit points: one
for failure somewhere in the middle, and one for success at the end.
This way it is completely clear which value gets returned when.
2021-07-10 16:18:29 +02:00
Benno Schulenberg 30aaea2d04 tweaks: rename a variable and flip its logic, to avoid two negations
Plus, it makes more sense to start in the state "not saved" than in
the state "failed".
2021-07-10 15:56:38 +02:00
Benno Schulenberg d0cb64650b usage: improve the description of the --positionlog option
And make the wording for the --historylog option similar.

This fixes https://savannah.gnu.org/bugs/?60868.

Bug existed since version 2.3.0, commit 8e2a9307, since the
saving and restoring of the cursor position was introduced.
2021-07-01 16:45:49 +02:00
Benno Schulenberg 0694255893 tweaks: adjust a description of 'showcursor', to match the other ones 2021-07-01 16:12:06 +02:00
Benno Schulenberg 5563c710d0 docs: improve the description of the 'tabstospaces' option
It never mentioned to how many spaces a tab would be converted.
2021-07-01 09:52:10 +02:00
Benno Schulenberg 177e4e5805 general: prevent die() from getting recursed into
When something that is called from die() calls die() again,
there is nothing we can do any more but give up.

This would have prevented the spiralling as
seen in https://savannah.gnu.org/bugs/?60853.
2021-06-30 15:54:21 +02:00
Benno Schulenberg 8d1a666dcf input: give up on the input stream only after millions of errors
This mitigates a problem seen sometimes among the Red Hat crash reports:
somehow wgetch() keeps returning ERR, as if it were in nodelay mode.
(I've seen this happen once after nano came out of suspension.)

Using a much larger error-count value gives the user a few seconds
to type something and hopefully get out of the error condition.
2021-06-29 14:31:22 +02:00
Benno Schulenberg fc01c5a10e feedback: when not in curses mode, just skip displaying any message
Calling die() could trigger another call of emergency_save(), which
could fail and cause another call to statusline(), which would call
die() again...  Spiralling until stack space runs out.

This fixes https://savannah.gnu.org/bugs/?60853.

Bug existed since version 5.1, commit 7942dab0.

Original report was in https://bugzilla.redhat.com/1976410.
Reported-by: Souptik Dutta Roy <duttaroy.souptik@gmail.com>
2021-06-29 13:07:41 +02:00
Benno Schulenberg 896f174f94 syntax: rust: update the license to GPL3 or newer
With permission from the copyright holder:
    https://lists.gnu.org/archive/html/nano-devel/2021-06/msg00037.html

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2021-06-27 11:17:37 +02:00