Commit Graph

377 Commits (cbf226476df3747aa25520800c69b12606f6b304)

Author SHA1 Message Date
Benno Schulenberg cbf226476d rcfile: skip color commands where some color name is invalid
That is, do not fall back to the default background color when the
name for the background color is invalid, but reject the entire
color command, just like for an invalid foreground color.
2018-03-30 10:30:55 +02:00
Benno Schulenberg 570fb6c606 small addition: understand color name "normal" to mean the default color
This allows a syntax to remove the color from things that were colored
overeagerly by earlier regexes.
2018-03-28 14:03:22 +02:00
David Lawrence Ramsey 7b1f3f4fe7 tweaks: correct several parameter types
This avoids a bunch of warnings when compiled with -pedantic:

	ISO C forbids comparison of ‘void *’ with function pointer
2018-03-18 20:01:25 +01:00
Benno Schulenberg a1be8b6a19 tweaks: condense a comment and elide an 'if' 2018-03-01 11:18:56 +01:00
Benno Schulenberg de4fbadf20 tweaks: reshuffle some code, to be slightly less ugly 2018-03-01 11:08:13 +01:00
Benno Schulenberg bdd8920081 bindings: make a key defined as string work also in browser and viewer 2018-03-01 10:55:04 +01:00
Benno Schulenberg 5eccaa7633 tweaks: refactor the implanting of a key expansion 2018-02-27 13:34:32 +01:00
Benno Schulenberg c757aee235 tweaks: correct a typo that broke binding a key to a string
Commit 0cf455bc introduced the typo.
2018-02-27 10:28:52 +01:00
Benno Schulenberg ffebd31cbb tweaks: shorten the name of two record elements
Exclude the confusing, pleonastic 'sc' abbreviation from their names.
2018-02-24 19:31:11 +01:00
Benno Schulenberg b027263a37 small addition: allow customizing the color of an error message
The new option 'set errorcolor' allows the user to specify the color
combination for the status bar when an error message is displayed.
2018-02-23 12:35:17 +01:00
Benno Schulenberg 0cf455bc48 build: fix compilation when configured with --enable-tiny
And when configured with --enable-tiny --enable-nanorc.
2018-02-14 19:29:29 +01:00
Benno Schulenberg 3e1fc6385b syntaxes: remove quotes from each syntax name, and color it differently
The different color will make the name stand out, as it should, instead
of looking the same as all the regex strings.
2018-02-14 17:36:50 +01:00
Benno Schulenberg 544cda6a62 rcfile: allow a syntax name to be unquoted 2018-02-14 17:35:37 +01:00
Benno Schulenberg 467cc8edf3 tweaks: remove two deprecated options and six rebindable function names
This addresses https://savannah.gnu.org/bugs/?48992.
2018-02-04 13:51:13 +01:00
Benno Schulenberg 6d111c9343 new feature: allow binding a key to a string (in a nanorc file)
In this way a single keystroke can produce a fragment of text or a
series of commands, or a mix of the two.  It is like a prerecorded
macro.

This fulfills https://savannah.gnu.org/bugs/?52931.
2018-02-04 12:44:12 +01:00
Benno Schulenberg 7b9bd65362 tweaks: drop a useless assert, and don't abort over an unhandled option 2018-01-24 10:29:50 +01:00
Benno Schulenberg f72fecee9b copyright: update the years for the FSF
And one for me, for the much changed keyboard stuff.
2018-01-24 10:14:43 +01:00
Benno Schulenberg d85098abda tweaks: reshuffle a couple of lines, to make a bit more sense 2018-01-19 20:27:53 +01:00
Benno Schulenberg 13f8ddcaf2 tweaks: remove a handful of redundant (because always true) asserts
And rewrap some lines, three of them to make them equal to another.
2018-01-19 20:09:06 +01:00
Benno Schulenberg 37e9ada964 tweaks: change a 'do' to a 'while', and return early to elide an 'if' 2018-01-19 18:05:24 +01:00
Benno Schulenberg a99158c7c0 tweaks: remove a fragment of dead code
At that point, ptr will necessarily point at EOL -- *ptr == '\0'.
2018-01-19 17:56:17 +01:00
Benno Schulenberg 704a7d7b4f tweaks: rename two variables, for preciseness and shortness
Also remove an unneeded nulling.
2018-01-15 16:38:13 +01:00
Benno Schulenberg 64366d9992 startup: make an error message succinct and to the point
The verbosity "hid" the really relevant information:
filename, line number, and the error message.

Valid values and other details can be found in the manual pages.
2018-01-15 13:24:14 +01:00
Benno Schulenberg bd97ae7255 tweaks: set a modifier in a single place, for conciseness 2018-01-15 13:15:23 +01:00
Benno Schulenberg 2ff398c685 tweaks: reshuffle some stuff, and avoid a memory leak 2018-01-15 13:07:42 +01:00
Brand Huntsman 4b24ce1c11 startup: parse interface colors when they are read, not when initialized
When the palette is getting initialized, it is too late to send any
error messages about the rcfile options to standard error.

This fixes https://savannah.gnu.org/bugs/?52871.
Reported-by: Brand Huntsman <alpha@qzx.com>

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-01-15 13:04:55 +01:00
Benno Schulenberg 87206c0607 tweaks: convert the indentation to use only tabs
Each leading tab is converted to two tabs, and any leading four spaces
is converted to one tab.  The intended tab size (for keeping most lines
within 80 columns) is now four.
2017-12-29 20:06:50 +01:00
David Lawrence Ramsey 62ebd93579 tweaks: use printf's z modifier for (s)size_t, instead of casting 2017-12-26 14:11:18 +01:00
Benno Schulenberg 66fd6a5ab1 options: rename 'justifytrim' to 'trimblanks', because it has morphed
The option now causes nano to trim trailing whitespace also when
hardwrapping occurs while the user is typing.
2017-12-06 20:38:13 +01:00
Benno Schulenberg 5239e7c52b copyright: update some years, and standardize on the dashed format 2017-11-12 10:46:20 +01:00
Benno Schulenberg 2122a1a2b5 tweaks: constify the result strings of getenv(), as a reminder
Also, remove an unneeded pair of braces.
2017-11-10 20:03:07 +01:00
Marco Diego Aurélio Mesquita e2d3bba86c general: do not free strings gotten from getenv(), to avoid a crash
Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
2017-11-10 19:55:44 +01:00
Simon Ochsenreither c16e79b612 startup: look for nanorc and history files also in the XDG directories
When not finding a .nanorc file in the user's home directory, nano will
look for a nanorc file in $XDG_CONFIG_HOME and in the ~/.config/nano/
fallback directory.  And when not finding a .nano/ subdir in the user's
home directory, nano will look for (or create) the history files in
$XDG_DATA_HOME or in the ~/.local/share/nano/ fallback directory.

This is a partial implementation of the XDG Base Directory Specification:
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html,
for the purpose of reducing the clutter in a user's home directory, and
to make it easier to back up just the configuration files.

Signed-off-by: Simon Ochsenreither <simon@ochsenreither.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-11-04 20:11:57 +01:00
Benno Schulenberg 1463781247 startup: when an rcfile contains errors, report this on the status bar
Suggested-by: Brand Huntsman <alpha@qzx.com>
2017-11-02 17:30:14 +01:00
Benno Schulenberg c3a11fb7ed options: remove '--quiet' and 'set quiet', because they hide problems
If the user uses a single version of nano, they have no need for
--quiet.  If they do sometimes use an older version and don't want
to see the warnings, they can use 2>/dev/null (they could make an
alias for that and put it before the call of nano).
2017-11-02 17:27:53 +01:00
Benno Schulenberg 953c2b8e79 startup: don't ask the user to press Enter upon an rcfile error
The user told nano to start, thus nano should *start* -- without
halting and without nagging the user.
2017-11-02 17:22:21 +01:00
Benno Schulenberg d5ac1ed395 tweaks: transform the token DISABLE_COLOR to ENABLE_COLOR 2017-11-01 19:45:50 +01:00
Benno Schulenberg 2a4fc9591f tweaks: transform the token DISABLE_SPELLER to ENABLE_SPELLER 2017-10-31 19:32:42 +01:00
Benno Schulenberg f034992ed6 tweaks: transform the token DISABLE_WRAPJUSTIFY to ENABLED_WRAPORJUSTIFY 2017-10-31 17:40:54 +01:00
Benno Schulenberg db0b849f9b tweaks: transform the token DISABLE_JUSTIFY to ENABLE_JUSTIFY 2017-10-31 17:40:44 +01:00
Benno Schulenberg 4e03a245ac tweaks: adjust two comments, and correct and a few cosmetic mistakes 2017-10-30 19:12:22 +01:00
Benno Schulenberg 028d12f4fb tweaks: transform the token DISABLE_OPERATINGDIR to ENABLE_OPERATINGDIR 2017-10-29 21:08:07 +01:00
Benno Schulenberg a5974bd1ec tweaks: transform the token DISABLE_WRAPPING to ENABLE_WRAPPING 2017-10-29 21:00:09 +01:00
Benno Schulenberg ff35a61355 tweaks: transform the token DISABLE_HISTORIES to ENABLE_HISTORIES 2017-10-29 19:43:05 +01:00
Benno Schulenberg 7c3c3cbb3b tweaks: discard some obsolete debugging stuff 2017-09-22 21:59:51 +02:00
David Lawrence Ramsey 5237a42d65 weeding: remove the unused be_clever parameter from do_home()/do_end() 2017-08-18 20:44:46 +02:00
Benno Schulenberg 8555820afc tweaks: rename a label, to better match its task 2017-08-16 22:00:10 +02:00
Benno Schulenberg e7bdfebdf4 rcfile: don't leak a shortcut when something goes wrong [coverity scan] 2017-08-16 21:56:56 +02:00
Urja Rannikko 1cc030f7c1 bindings: hard-bind Alt+Left and Alt+Right to buffer switching
This also fixes https://savannah.gnu.org/bugs/?51735.
Reported-by: Urja Rannikko <urjaman@gmail.com>

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-08-14 10:06:29 +02:00
Benno Schulenberg 11072ed587 tweaks: sort the includes, so it's a little easier to see what is there 2017-08-06 19:40:30 +02:00