Commit Graph

10386 Commits

Author SHA1 Message Date
Benno Schulenberg
572247dbd8 tweaks: reshuffle a seldom-used function to the end of an if-else series 2024-07-22 15:43:37 +02:00
Benno Schulenberg
c5a0e6b60c syntax: awk: colorize escape sequences specially 2024-07-21 14:32:56 +02:00
Benno Schulenberg
d7e8665782 syntax: awk: rewrite a regex more densely, and add the missing ~ operator
Also, improve the comment.
2024-07-18 16:14:25 +02:00
Benno Schulenberg
7c86c1a185 syntax: awk: add a missing "|" between "\?" and ":"
The "\?" and ":" are meant to match the ? and : in this construct:

    condition ? thenthis : otherwisethis

The missing "|" seems to have been a typo.
2024-07-18 13:02:54 +02:00
Benno Schulenberg
4b03cc60cf moving: for Alt+Home/Alt+End, refresh the screen when the mark is on
When the mark is on, moving the cursor to the top or bottom row should
highlight the relevant area -- thus requiring a call of edit_refresh()
to be scheduled.

Also, drop two calls of place_the_cursor(), as that is done anyhow in
the main loop, either directly, or indirectly through edit_refresh().

This fixes https://savannah.gnu.org/bugs/?65992.
Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>

Bug existed since version 8.0, since Alt+Home/Alt+End were introduced.
2024-07-17 17:23:12 +02:00
Benno Schulenberg
c356db9f44 macro: insert it in keystroke buffer without discarding latter's contents
Instead of simply overwriting the current contents of the keystroke
buffer with the contents of the macro buffer, insert the latter's
contents at the head of the keystroke buffer.

This allows using {runmacro} in a string bind, and allows typing ahead
over a laggy connection after invoking `runmacro` (normally with M-;).

This fixes https://savannah.gnu.org/bugs/?65991.
Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>

Bug exists since version 2.9.4, since string binds were introduced.
2024-07-16 16:44:48 +02:00
Benno Schulenberg
c53839cefa tweaks: rename a symbol, away from an obscure abbreviation
Also, reshuffle its definition, and change its value to match
other special codes.
2024-07-15 09:38:01 +02:00
Benno Schulenberg
887803cb67 bindings: let the central numpad key (with Ctrl) center the current line
When NumLock is off, let Ctrl plus the central key on the numeric keypad
center the current line.

(This binding is not advertised anywhere
-- it's left as a little Easter egg.)
2024-07-15 09:37:48 +02:00
Benno Schulenberg
f69a08fc63 syntax: man: colorize also the .MT .ME .EX .EE .SY .OP and .YS macros
Furthermore, colorize .LP .P and .PP like .TP, as paragraph macros,
instead of inconsistenly as if they specified type faces.
2024-07-15 07:48:14 +02:00
Benno Schulenberg
4ddd61cfde po: update translations and regenerate POT file and PO files 2024-07-12 11:23:42 +02:00
Benno Schulenberg
fe39d137c7 bump version numbers and add a news item for the 8.1 release 2024-07-12 10:57:24 +02:00
Benno Schulenberg
ade975891b tweaks: add a space after a '+', for consistent formatting 2024-07-07 17:11:30 +02:00
Benno Schulenberg
479e56bdd6 tweaks: slightly reword a phrase in the explanation of --colonparsing 2024-07-07 14:27:02 +02:00
Benno Schulenberg
e5d36de24c tweaks: discard a bracketed paste in the help viewer with fewer beeps
The same change was made for the file browser two years ago,
in commit b561c386.
2024-07-07 14:25:04 +02:00
Benno Schulenberg
d824c4e633 docs: properly escape a literal '@' in the texi document
This avoids a failing `make pdf`.

Problem existed since commit 4930fbbb from five weeks ago.
2024-07-01 15:45:51 +02:00
Benno Schulenberg
f499635461 gnulib: update to its current upstream state
Also, stop distributing 'wchar_t.m4', as it was removed from gnulib
two weeks ago.
2024-07-01 11:07:03 +02:00
Benno Schulenberg
e8cf0f37f1 docs: add 'set colonparsing' to the sample nanorc 2024-06-18 15:55:00 +02:00
Benno Schulenberg
12a0c0f690 tweaks: rewrap some lines, for more even lengths
Also, slightly improve a few descriptions.
2024-06-18 10:53:28 +02:00
Benno Schulenberg
77a8841d25 tweaks: elide unhelpful occurrences of the word "will"
In most cases, "will" is just a filler word and doesn't improve clarity.

And in the bargain improve two descriptions.
2024-06-18 09:56:01 +02:00
Benno Schulenberg
7d8f13b9f7 build: use the standard autoreconf invocation
As version 0.20 of `autopoint` no longer overwrites 'extern-inline.m4',
there is no need any more for the custom calls of the various parts of
`autoreconf`.

This effectively reverts commit 4a1db96d from two and a half years ago.
2024-06-17 11:07:40 +02:00
Benno Schulenberg
ec177c84b3 build: require version 0.20 of gettext for building nano from git
Gettext-0.20 is the first version where its `autopoint` does not
overwrite the newer 'extern-inline.m4' from gnulib.

Version 0.20 is five years old, so most users will be on a distro
that includes that version of gettext or a newer one.
2024-06-17 09:50:08 +02:00
Benno Schulenberg
3809c67bb2 docs: add the Alt+Home/Alt+End shortcuts to the cheatsheet
Also, reshuffle Alt+T for balance, slightly reword the description
of Alt+A (as it differs in nature from the other toggles), and add
some spaces for better alignment.
2024-06-17 09:10:07 +02:00
Benno Schulenberg
dff779e3ad tweaks: in FAQ, use 'id' attribute instead of empty anchor with 'name'
The 'name' attribute for the <a> tag is deprecated -- 'id' is the
standard attribute that can be used in almost every tag.
2024-06-17 09:09:37 +02:00
Benno Schulenberg
ef1c9b9f2b tweaks: implement do_center() with a single call instead of three
This works because the main loop sets 'cycling_aim' to zero
whenever the current keystroke is not bound to `cycle`.
2024-06-15 09:57:06 +02:00
Benno Schulenberg
90e62db26e help: regroup the center item, placing it with the new cycle 2024-06-15 09:57:06 +02:00
Benno Schulenberg
498154804c bindings: let ^L put the cursor line at center, then top, then bottom
Something similar can be achieved with:

  bind ^T "{center}{bottomrow}{center}{toprow}" main
  bind ^B "{center}{toprow}{center}{bottomrow}" main

But that requires allocating two extra shortcuts, and it works right only
when the edit window has an odd number of rows, not with an even number.
Also, this new ^L behavior is available by default, out-of-the-box.
2024-06-15 09:57:06 +02:00
Benno Schulenberg
34dda64610 docs: explain the behavior of the new function cycle
Also colorize {cycle} when found in a nanorc file.
2024-06-15 09:57:06 +02:00
Benno Schulenberg
d1c723bc14 new feature: add bindable function cycle that pushes cursor line around
On the first call, `cycle` centers the line with the cursor, on the
second consecutive call it pushes that line to the top of the viewport,
and on the third consecutive call to the bottom of the viewport.
2024-06-15 09:57:06 +02:00
Benno Schulenberg
d477bfd4ee tweaks: drop two redundant conditions
The function do_tab() is only ever called when in the main edit window,
and never called while a bracketed paste is in progress.

(The two conditions were thoughtlessly copied when this fragment of code
was moved here three commits ago.)
2024-06-10 14:07:30 +02:00
Benno Schulenberg
6c81f60914 moving: use edit_scroll() only when scrolling one row is enough
When softwrapping with a tabsize larger than the width of the viewport,
scrolling one row when the cursor goes offscreen might not be enough,
so in that case use edit_redraw() instead.

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

Bug existed since version 2.9.6, commit 0d9080a2.
2024-06-10 08:15:28 +02:00
Benno Schulenberg
aa844ada4e tweaks: remove the now unneeded special keycode INDENT_KEY 2024-06-09 16:48:06 +02:00
Benno Schulenberg
9b7a813069 text: do not check for <Tab> + mark while getting input but in do_tab()
This allows a {tab} in a string bind to indent a marked region.

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

Problem existed since version 7.0, since braced function names
were introduced.
2024-06-09 16:42:14 +02:00
Benno Schulenberg
bc09f0992e tweaks: reshuffle some lines, to put vaguely related things together
And to slightly reduce the number of #ifdefs.
2024-06-08 17:08:17 +02:00
Benno Schulenberg
00e2309987 tweaks: make the inclusion condition for do_center() more strict
There is no reason why --enable-help should cause the centering function
to be included in a tiny version.
2024-06-08 16:56:52 +02:00
Benno Schulenberg
a98f82e27b startup: no not activate --modernbindings when name starts with "e"
Activating --modernbindings when the binary's name starts with "e"
interferes with Debian's alternatives system that symlinks `editor`
to `nano` in a default install.

(Also: why "e"?  It would have made more sense to check for "m",
similar to the checking for "r" for a restricted nano.)

This reverts commit 580eaf29 from fifteen months ago.

This addresses https://savannah.gnu.org/bugs/?65810.
Reported-by: Colin Snover <nano@zetafleet.com>
2024-06-08 12:14:08 +02:00
Benno Schulenberg
c70e6919c2 syntaxes: mention the original author of most of the syntax files
The names of the authors were retrieved from:

  git log -p --follow  syntax/<name>.nanorc

and from:

  git log -p --follow --all --  doc/nanorc.sample

For some files the original author is unclear, or
the file is/was too small to mention an author for.
2024-06-08 12:10:25 +02:00
Jaroslav Fowkes
abdf069ce3 syntax: fortran: fix a typo (a missing backslash)
The typo prevented several keywords from getting colorized.

This addresses https://savannah.gnu.org/patch/?10459.

Bug existed since version 2.1.6, commit 513157df,
since the Fortran syntax was introduced.
2024-06-07 15:34:03 +02:00
Benno Schulenberg
6be1f7e95a docs: avert hyphenation of the technical words "ncurses" and "terminfo"
This prevents an observed wrong hyphenation: "ter-minfo".

Also, add markup for "terminfo", like "ncurses" already has.
2024-06-07 14:57:02 +02:00
Benno Schulenberg
a1159ff484 syntax: man: colorize some of the things that manipulate hyphenation
Reference:
  https://www.gnu.org/software/groff/manual/groff.html.node/Manipulating-Hyphenation.html
2024-06-06 13:29:01 +02:00
Benno Schulenberg
0c2caa50cc docs: correct the description of --bold, as function tags are unaffected
The succinct function descriptions in the help lines are not shown in
reverse video by default, so they are not bolded by -D/--bold either.

Also, mention 'promptcolor' and 'minicolor' where they were missing.
2024-06-04 17:01:11 +02:00
Benno Schulenberg
dcbbbf8134 input: make sure that a string-bind return value is non-negative
A negative value would lead to misinterpretation by parse_kbinput().

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

Bug existed since version 8.0, commit 51c9f727.
2024-06-03 15:40:03 +02:00
Benno Schulenberg
05602e29cd syntax: patch: recognize also the .rej extension
The addition was inspired by `davidhcefx`.
2024-06-02 17:16:22 +02:00
Benno Schulenberg
cd53f7cf8c docs: don't say any more that -z was removed, as it has been repurposed 2024-06-02 09:23:09 +02:00
Benno Schulenberg
689748843c files: with --rectrict, prevent invoking the browser and toggling backups
Prevent also the toggling of Append and Prepend.  All four functions
should not be available in restricted mode, and are absent from the
WriteOut menu in that mode, but using {browser}, {backup}, {append}
or {prepend} in a string bind allowed to bypass the menu checks.

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

Problem existed since version 7.0, since braced function names
were introduced.
2024-06-01 11:31:09 +02:00
Benno Schulenberg
ea07eb6aa3 help: show option -Y/--syntax in --help output also in restricted mode
Since version 3.2, commit 5ca444e5, nano reads the nanorc files also
in restricted mode (when not also --ignorercfiles is given), meaning
that syntaxes are available and that a specific syntax can be selected
on the command line.  So, the --help output in restricted mode should
list the relevant option: -Y<name> / --syntax=<name>.

(This should have been part of commit b81995af from six years ago.)
2024-06-01 11:00:49 +02:00
Benno Schulenberg
5251ce1b20 tweaks: simplify a condition, to match the same condition five lines back 2024-06-01 09:30:44 +02:00
Benno Schulenberg
b3780aab33 docs: remove the 'filename:linenumber' format from the synopsis
(This should have been part of commit 4930fbbb from five days ago.)
2024-05-31 16:48:08 +02:00
Benno Schulenberg
5bc6d0ef2e tweaks: extend the deprecation period of 'set nowrap' and prefix 'bright' 2024-05-31 16:41:46 +02:00
Benno Schulenberg
b92cbf5f09 rcfile: remove old bindable function 'nowrap', alias of 'breaklonglines'
The bindable function 'nowrap' has been deprecated for three years,
since version 5.5, commit e14127b8.

(The obsolete options --nowrap and 'set nowrap' continue to exist.)
2024-05-31 15:57:01 +02:00
Benno Schulenberg
c26f901ba9 options: remove the deprecated synonym -$ of -S/--softwrap
The old short option -$ has been deprecated for four years,
since version 5.0, commit 7d3aad40.
2024-05-31 12:45:18 +02:00