Compare commits

..

50 Commits

Author SHA1 Message Date
Chris Allegretta
651bb5009f GNU nano 2.3.99pre2 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5113 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-07 00:26:43 +00:00
Chris Allegretta
86c6cd1725 2015-02-03 Alex Henrie <alexhenrie24@gmail.com>
* src/cut.c (do_cut_text): Make sure to set modified even when
        using --enable-tiny.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5112 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-03 22:49:57 +00:00
Benno Schulenberg
bd98ff02f6 Avoiding to trim the nano version number on the status bar.
Patch by Kamil Dudka.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5111 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-01 10:07:08 +00:00
Benno Schulenberg
057ef182cd Avoiding to print a wrong PID on the status bar.
Patch by Kamil Dudka.  Bug reported by Don Swaner.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5110 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-01 09:58:02 +00:00
Benno Schulenberg
67cdd5ee1e Making sure that 'lockprog' and 'lockuser' are properly terminated.
Patch by Kamil Dudka.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5109 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-01 09:48:50 +00:00
Benno Schulenberg
92896a708d Avoiding to write uninitialized bytes to the lock file.
Patch by Kamil Dudka.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5108 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-01 09:39:27 +00:00
Benno Schulenberg
57fa775f25 Updating the copyright years to include 2015.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5107 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-01 09:32:02 +00:00
Benno Schulenberg
8d53aa3ad2 Adding a general entry for all translators plus the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5106 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-02-01 09:19:58 +00:00
Chris Allegretta
5b1fb56a8f Take 2 at file locking fixes. New args to close_buffer() and
switch_to_prevnext_buffer() to support message passthrough
when trying to lock files using multibuffer.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5105 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-20 06:15:34 +00:00
Chris Allegretta
6948d2e779 2015-01-13 Chris Allegretta <chrisa@asty.org>
* src/files.c (open_buffer): Check here for locking and properly
        handle choosing to not open a file when locked instead of in
        open_file().  Fixes Savannah bug 42373 reported by Benno Schulenberg



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5104 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-14 02:36:30 +00:00
Chris Allegretta
69429ce274 Back to SVN version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5103 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-06 15:28:02 +00:00
Chris Allegretta
170679294b GNU nano 2.3.99pre1 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5101 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-06 15:20:04 +00:00
Chris Allegretta
4b3f2771b5 2015-01-03 Chris Allegretta <chrisa@asty.org>
* New formatter code to support syntaxes like
        go which have tools to automatically lint and reformat the text for
        you (gofmt), which is lovely.  rcfile option formatter, function
        text.c:do_formatter() and some other calls.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5100 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-03 07:24:17 +00:00
Benno Schulenberg
a44def03a0 Adding Mark to the scroll.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5099 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-12-28 22:27:56 +00:00
Benno Schulenberg
9f1b1e2b14 Removing the names of past translators from the Easter-egg scroll.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5098 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-12-28 22:23:31 +00:00
Benno Schulenberg
e99f0b609b Gettextizing the "File being edited" prompt,
and improving its wording.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5097 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-12-28 21:58:27 +00:00
Benno Schulenberg
5bb10d25ef Colorizing the section headers %pretrans and %posttrans fully.
Original patch from Savannah patch #8573 by Daniel Vrátil.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5096 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-11-30 12:05:13 +00:00
Benno Schulenberg
edabd27cd8 Recognizing also header lines that use "/usr/bin/env" to call
the program, instead of just a direct call via "/bin/program".
Doing this for Shell scripts, and for Python, Perl and Ruby.
This fixes Savannah bug #43270 reported by Kitty.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5095 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-09-21 15:29:40 +00:00
Benno Schulenberg
97a5d1270a Replacing the old get_shortcut() wrapper with the new func_from_key().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5094 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-29 20:03:58 +00:00
Benno Schulenberg
f729c6dae5 Adding name of reporter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5093 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-29 19:22:15 +00:00
Benno Schulenberg
a3cc4e6ecd Improving some wordings and formatting in the texinfo document.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5092 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-10 16:27:30 +00:00
Benno Schulenberg
2a9536c4e8 Removing a mistaken doubled-up | which causes
an 'empty (sub)expression' error on MacOS X.
This fixes Savannah bug #42929.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5091 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-07 20:27:21 +00:00
Benno Schulenberg
1f960f7e34 Improving some of the wordings and formatting of the nanorc manpage.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5090 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-03 20:57:15 +00:00
Benno Schulenberg
3f4389b968 Tweaking the formatting of the man pages a bit
so that po4a will create a nicer POT file.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5089 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-03 20:25:16 +00:00
Benno Schulenberg
700c43bd42 Standardizing the formatting of command-line options -- each one separately.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5088 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-02 20:47:35 +00:00
Benno Schulenberg
2ec70b6466 Separating short and long option by a customary comma
instead of putting the long one between parentheses.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5087 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-01 21:04:35 +00:00
Benno Schulenberg
cf9f32b009 Reordering a few things, and adjusting some whitespace.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5086 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-31 20:49:32 +00:00
Benno Schulenberg
fcd4468f90 Adjusting some indentation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5085 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-31 20:44:19 +00:00
Benno Schulenberg
7239fda971 Using still further the func_from_key() wrapper instead of get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5084 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 21:07:15 +00:00
Benno Schulenberg
47dffa483f Using still more the func_from_key() wrapper instead of get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5083 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 20:16:28 +00:00
Benno Schulenberg
266e0496ab Using the more direct func_from_key() wrapper instead of get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5082 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:32:03 +00:00
Benno Schulenberg
dbb5e7cd8e Moving first_sc_for() next to its sister function too.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5081 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:23:41 +00:00
Benno Schulenberg
80750632d0 Moving strtokeytype() next to its sister function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5080 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:18:00 +00:00
Benno Schulenberg
d23283e249 Removing the now unused and unneeded addition ability to the shortcut list.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5079 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:13:46 +00:00
Jordi Mallach
7ffc7b0438 * doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5078 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-24 16:11:20 +00:00
Benno Schulenberg
1a8c90eec7 Removing 'undo' from the valid options, so it gets coloured brightred.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5077 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-22 08:17:20 +00:00
Jordi Mallach
ea40ebb648 * doc/nanorc.sample.in: Remove ‘undo’ section which is now obsolete.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5076 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-21 21:27:15 +00:00
Chris Allegretta
1c8cdfd174 Add release to ChangeLog and back to svn version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5075 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-17 15:32:28 +00:00
Chris Allegretta
0dfd5f7f67 GNU nano 2.3.6 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5073 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-17 15:17:49 +00:00
Jordi Mallach
35cb2c8659 * doc/man/rnano.1: Additional printing formatting improvement from
Bjarni Ingi Gislason.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5072 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-17 06:27:08 +00:00
Jordi Mallach
3d5de0df51 * doc/man/fr/nano.1, doc/man/fr/rnano.1: Apply similar escaping fixes
to French manpages.
* doc/man/fr/nano.1, doc/man/fr/rnano.1, doc/man/fr/nanorc.5: Recode
as UTF-8.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5071 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 17:25:55 +00:00
Jordi Mallach
a3710f695f * doc/syntax/debian.nanorc: Add https, tor and spacewalk to supported
APT methods.
* doc/syntax/debian.nanorc: Apply the syntax to apt/sources.list.d/
entries as well, as reported by Rodolphe Pelloux-Prayer.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5070 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 11:22:02 +00:00
Jordi Mallach
18be89773c doc/man/nano.1, doc/man/rnano.1: Add some escaping and formatting
fixes as suggested Bjarni Ingi Gislason <bjarniig@rhi.hi.is> in
Debian bugs #662842 and #726956.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5069 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 11:07:08 +00:00
Benno Schulenberg
a9fdfd0799 Normalizing some tabbing.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5068 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 08:53:16 +00:00
Benno Schulenberg
2394e52ebc Making sure line renumbering starts far enough back after
undoing a cut or paste.  And fixing two memory leaks.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5067 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 08:46:42 +00:00
Chris Allegretta
ee7bbf4650 2014-07-13 David Lawrence Ramsey <pooka109@gmail.com>
* ChangeLog: Typo fix



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5066 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-13 19:46:32 +00:00
Benno Schulenberg
8914bd5b1a Not silencing the warning about datarootdir being ignored --
it is not merely a warning, it also activates a workaround.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5065 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-12 08:17:52 +00:00
Benno Schulenberg
5dde918e24 Not speaking of "line wrap" but of "text add" when undoing/redoing
text additions that caused automatic line breaks.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5064 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-11 19:14:25 +00:00
Benno Schulenberg
300e27745b Refixing a typo in a statusbar error message.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5063 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-11 18:35:08 +00:00
Chris Allegretta
cfc396c32e Add 2.3.5 to ChangeLog, and back to svn version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5062 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-11 13:46:32 +00:00
64 changed files with 17855 additions and 16545 deletions

150
ChangeLog
View File

@@ -1,3 +1,151 @@
GNU nano 2.3.99pre2 - 2015.02.06
2015-02-03 Alex Henrie <alexhenrie24@gmail.com>
* src/cut.c (do_cut_text): Make sure to set modified even when
using --enable-tiny.
2015-02-01 Kamil Dudka <kdudka@redhat.com>
* src/files.c (write_lockfile): Avoid writing uninitialized bytes to
the lock file -- a simple null_at() would not initialize the buffer.
* src/files.c (do_lockfile): Make sure that 'lockprog' and 'lockuser'
are terminated -- strncpy() does not guarantee that on its own.
* src/files.c (do_lockfile): Avoid printing a wrong PID on the status
bar due to treating serialized PID bytes as signed integers. This
addresses https://bugzilla.redhat.com/1186384 reported by Don Swaner.
* src/files.c (write_lockfile): Do not trim the nano version number
-- snprintf() counts the trailing zero into the size limit.
2015-02-01 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (do_credits): Add a general entry for all translators.
* src/nano.c (version), src/winio.c (do_credits): Update the copyright
years to include 2015.
2015-01-13 Chris Allegretta <chrisa@asty.org>
* src/files.c (open_buffer): Check here for locking and properly
handle choosing to not open a file when locked instead of in
open_file(). Fixes Savannah bug 42373 reported by Benno Schulenberg
GNU nano 2.3.99pre1 - 2015.01.06
2015-01-03 Chris Allegretta <chrisa@asty.org>
* New formatter code to support syntaxes like
go which have tools to automatically lint and reformat the text for
you (gofmt), which is lovely. rcfile option formatter, function
text.c:do_formatter() and some other calls.
2014-12-28 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (do_lockfile): Gettextize the "File being edited"
prompt, and improve its wording.
* src/winio.c (do_credits): Remove the names of past translators
from the Easter-egg scroll.
* THANKS: Add a missing historical translator name.
* src/winio.c (do_credits): Add Mark to the scroll, for all his
undo work, colouring nano's interface, and other patches.
2014-11-30 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/spec.nanorc: Colorize %pretrans and %posttrans fully.
Original patch from Savannah patch #8573 by Daniel Vrátil.
2014-09-21 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/{perl,python,ruby,sh}.nanorc: Recognize also header
lines of the form "#!/usr/bin/env thing" besides "#!/bin/thing".
This fixes Savannah bug #43270 reported by Kitty.
2014-08-29 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_justify): Replace the old get_shortcut() wrapper
with the new func_from_key().
2014-08-10 Benno Schulenberg <bensberg@justemail.net>
* doc/texinfo/nano.texi: Improve some wordings and formatting.
2014-08-07 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/nanorc.nanorc: Remove a mistaken OR which causes a
'Bad regex, empty (sub)expression' error on some systems. This
fixes Savannah bug #42929 reported by Misty De Meo.
2014-08-03 Benno Schulenberg <bensberg@justemail.net>
* doc/man/nano.1, doc/man/rnano.1: Tweak the formatting a bit so that
po4a will create a nicer POT file.
* doc/man/nanorc.5: Improve some of the wordings and formatting.
2014-08-02 Benno Schulenberg <bensberg@justemail.net>
* doc/texinfo/nano.texi: Standardize the formatting of command-line
options -- each one separately. Also add some more markup.
2014-08-01 Benno Schulenberg <bensberg@justemail.net>
* doc/man/nano.1, doc/man/rnano.1: Separate short and long option
by a comma instead of putting the long one between parentheses.
And showing the required quotes around the argument of -Q.
2014-07-31 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (do_insertfile): Adjust some indentation.
* src/prompt.c (do_statusbar_input), src/browser.c (do_browser):
Reorder a few things, and adjust some whitespace.
2014-07-27 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (add_to_sclist): Remove the now unused and unneeded
addition ability from this builder function of the shortcut list.
* src/global.c (strtokeytype): Move this to a better place.
* src/global.c (first_sc_for): Move this too to a better place.
* src/prompt.c (do_yesno_prompt): Use the new and more direct
func_from_key() wrapper instead of get_shortcut().
* src/text.c (do_linter): Likewise.
* src/files.c (do_insertfile, do_writeout): Likewise.
2014-07-24 Jordi Mallach <jordi@gnu.org>
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
2014-07-22 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/nanorc.nanorc: Remove 'undo' from the valid options.
2014-07-21 Jordi Mallach <jordi@gnu.org>
* doc/nanorc.sample.in: Remove undo section which is now obsolete.
GNU nano 2.3.6 - 2014.07.17
2014-07-16 Jordi Mallach <jordi@gnu.org>
* doc/man/rnano.1: Additional printing formatting improvement from
Bjarni Ingi Gislason.
2014-07-16 Jordi Mallach <jordi@gnu.org>
* doc/man/fr/nano.1, doc/man/fr/rnano.1: Apply similar escaping fixes
to French manpages.
* doc/man/fr/nano.1, doc/man/fr/rnano.1, doc/man/fr/nanorc.5: Recode
as UTF-8.
2014-07-16 Jordi Mallach <jordi@gnu.org>
* doc/syntax/debian.nanorc: Add https, tor and spacewalk to supported
APT methods.
* doc/syntax/debian.nanorc: Apply the syntax to apt/sources.list.d/
entries as well, as reported by Rodolphe Pelloux-Prayer.
2014-07-16 Jordi Mallach <jordi@gnu.org>
* doc/man/nano.1, doc/man/rnano.1: Add some escaping and formatting
fixes as suggested Bjarni Ingi Gislason <bjarniig@rhi.hi.is> in
Debian bugs #662842 and #726956.
2014-07-16 Benno Schulenberg <bensberg@justemail.net>
* src/text.c: Normalize the tabbing.
2014-07-16 Mark Majeres <mark@engine12.com>
* src/text.c (do_undo): Make sure renumbering starts far enough back
after undoing a cut or paste. This fixes a segmentation fault when
undoing a repeated cutting and pasting of the first line of a file.
* src/nano.c (move_to_filestruct, copy_from_filestruct): Fix two leaks.
2014-07-13 David Lawrence Ramsey <pooka109@gmail.com>
* ChangeLog: Typo fix.
2014-07-12 Benno Schulenberg <bensberg@justemail.net>
* configure.ac: The warning about datarootdir being ignored is
not merely a warning, it also activates a workaround.
2014-07-11 Mark Majeres <mark@engine12.com>
* src/text.c (do_undo, do_redo): Do not speak of "line wrap"
but instead of "text add" when undoing/redoing text additions
that caused automatic line breaks.
2014-07-11 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (write_lockfile): Refix typo in error message.
GNU nano 2.3.5 - 2014.07.11
2014-07-11 Chris Allegretta <chrisa@asty.org>
* src/files.c (do_lockfile, open_file): If locking fails,
allow the lock failure message to be preserved AND
@@ -118,7 +266,7 @@
* src/help.c (do_help): Same thing for 'firstline'/'lastline'.
2014-06-23 Benno Schulenberg <bensberg@justemail.net>
* src/nano.h, src/move.c (do_up, do_down), src/winio.c (edit_scrol):
* src/nano.h, src/move.c (do_up, do_down), src/winio.c (edit_scroll):
Rename UP_DIR and DOWN_DIR to UPWARD and DOWNWARD, for clarity.
* src/proto.h, src/global.c, src/search.c: Rename 'no_replace_void()'
to 'flip_replace_void()', to show what it actually does.

25
NEWS
View File

@@ -1,3 +1,28 @@
2015.02.06 - GNU nano 2.3.99pre2 "Snowblind" is released. This release
contains only fixes, including: a long-standing problem
with cutting in nano-tiny, several memory alignment
improvements, and issues with leftover file locks. Please
keep reporting bugs so we can geta happy and healthy
2.4.0 soon. Thanks for using nano!
2015.01.06 - GNU nano 2.3.99pre1 "Junior" is released. As the first
2.4 release candidate there will be fewer new features
but many bugfixes going forward. This release contains
new support for language reformatters like go's gofmt
command which takes the place of the spelling checker.
Fixes in this release include many syntax highlighting
fixes and improvements, and documentation formatting updates.
As always please report bugs via the Savannah bug page for
nano (https://savannah.gnu.org/bugs/?group=nano), so we can
release a super awesome and bug-free 2.4.0 soon!
2014.07.17 - GNU nano 2.3.6 "Columbo" is released. This release
contains a fix for installing internationalization
files. Also included are scattered documentation
(in particular man page) fixes, and a few touch ups
to syntax highlighting definitions. Oh, just one
more thing, thanks for using nano!
2014.07.11 - GNU nano 2.3.5 "lucky day" is released. This release
contains many visible and under-the-hood fixes for
components such as file locking, more fixes to the

1
THANKS
View File

@@ -23,6 +23,7 @@ Eivind Kjørstad <ekj@vestdata.no> Norwegian Nynorsk translator
Florian König <floki@bigfoot.com> German translator
Wojciech Kotwica <wkotwica@post.pl> Polish translator
Clement Laforet <clem_laf@wanadoo.fr> French translator
Daniele Medri <madrid@linux.it> Italian translator
Gergely Nagy <algernon@debian.org> Hungarian translator
Kalle Olavi Niemitalo <kon@iki.fi> Finnish translator
A. Murat EREN <meren@comu.edu.tr> Turkish translator

View File

@@ -20,16 +20,12 @@
#
# $Id$
AC_INIT([GNU nano], [2.3.5], [nano-devel@gnu.org], [nano])
AC_INIT([GNU nano], [2.3.99pre2], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
dnl Silence a pointless warning from the gettext Makefile.
AC_DEFUN([AC_DATAROOTDIR_CHECKED])
dnl Make sure the ONCE macros are available.
AC_PREREQ(2.61)

View File

@@ -2,14 +2,14 @@
.\" Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
.\" Free Software Foundation, Inc.
.\"
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
.\" Ce travail d'adaptation est dans le domaine public. Attention, la
.\" page traduite reste soumise au droit d'auteur de ses auteurs
.\" originaux.
.\"
.\" The French translation of this document is a public domain work of
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
.\" 2005, 2006 and 2007. The translated man page in itself is still
.\" subject to the copyright of its original authors.
.\"
@@ -29,20 +29,20 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" Ce document est publié sous une double licence. Vous pouvez
.\" Ce document est publié sous une double licence. Vous pouvez
.\" le distribuer et le modifier selon les termes de l'une des deux
.\" licences ci-dessous :
.\" licences ci-dessous :
.\"
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
.\" le cas, consultez <http://www.gnu.org/licenses/>.
.\"
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2 ou,
.\" à votre choix, supérieure, telle que publiée par la Free
.\" à votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation, sans section invariante, ni texte de
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" une copie de la Licence de documentation libre GNU avec ce
.\" programme. Si ce n'est pas le cas, consultez
.\" <http://www.gnu.org/licenses/>.
@@ -50,71 +50,71 @@
.\" $Id$
.TH NANO 1 "version 2.0.0" "29\ novembre\ 2007"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\"
.SH NOM
nano \- NAno un NOuvel éditeur, un clone libre et amélioré de Pico
nano \- NAno un NOuvel éditeur, un clone libre et amélioré de Pico
.SH SYNOPSIS
.B nano
.I [OPTIONS]\ [[\+LIGNE,COLONNE]\ FICHIER]...
.I [OPTIONS]\ [[+LIGNE,COLONNE]\ FICHIER]...
.br
.SH DESCRIPTION
Cette page de manuel décrit brièvement la commande \fBnano\fR.
Cette page de manuel décrit brièvement la commande \fBnano\fR.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" respectively.
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à remplacer
Pico, l'éditeur par défaut du logiciel non libre Pine. \fBnano\fR ne se
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à remplacer
Pico, l'éditeur par défaut du logiciel non libre Pine. \fBnano\fR ne se
contentant pas de copier l'interface et l'ergonomie de Pico, il offre
également certaines fonctions manquantes (ou désactivées par défaut)
dans Pico. Ces fonctionnalités sont, par exemple, les fonctions de
recherche et de remplacement, et la possibilité de sauter directement à
une ligne et à une colonne précise.
également certaines fonctions manquantes (ou désactivées par défaut)
dans Pico. Ces fonctionnalités sont, par exemple, les fonctions de
recherche et de remplacement, et la possibilité de sauter directement à
une ligne et à une colonne précise.
.SH OPTIONS
.TP
.B \+\fILIGNE\fP,\fICOLONNE\fP
Démarre avec le curseur positionné à la colonne \fICOLONNE\fP de
la ligne \fILIGNE\fR (l'un des deux, au moins, devant être spécifié) au
lieu de démarrer à la colonne\ 1, ligne\ 1.
.B +\fILIGNE\fP,\fICOLONNE\fP
Démarre avec le curseur positionné à la colonne \fICOLONNE\fP de
la ligne \fILIGNE\fR (l'un des deux, au moins, devant être spécifié) au
lieu de démarrer à la colonne\ 1, ligne\ 1.
.TP
.B \-?
Identique à \fB-h (\-\-help)\fP.
Identique à \fB\-h (\-\-help)\fP.
.TP
.B \-A (\-\-smarthome)
Rend plus malin le fonctionnement de la touche «\ Début\ ». Lorsque l'on
appuie sur cette touche à n'importe quel endroit excepté au tout début
du texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur
se positionnera au début du texte de la ligne (qu'il soit en avant ou en
arrière). Si le curseur est déjà là, il se placera au vrai début de la
Rend plus malin le fonctionnement de la touche «\ Début\ ». Lorsque l'on
appuie sur cette touche à n'importe quel endroit excepté au tout début
du texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur
se positionnera au début du texte de la ligne (qu'il soit en avant ou en
arrière). Si le curseur est déjà là, il se placera au vrai début de la
ligne.
.TP
.B \-B (\-\-backup)
Lors de l'écriture d'un fichier, crée une copie de sécurité de la
version précédente, en ajoutant un tilde (~) au nom du fichier.
Lors de l'écriture d'un fichier, crée une copie de sécurité de la
version précédente, en ajoutant un tilde (~) au nom du fichier.
.TP
.B \-D (\-\-boldtext)
Utilise des caractères gras à la place de la vidéo inverse.
Utilise des caractères gras à la place de la vidéo inverse.
.TP
.B \-C \fIrépertoire\fP (\-\-backupdir=\fIrépertoire\fP)
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
de sécurité uniques si celles-ci sont activées.
.B \-C \fIrépertoire\fP (\-\-backupdir=\fIrépertoire\fP)
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
de sécurité uniques si celles-ci sont activées.
.TP
.B \-E (\-\-tabstospaces)
Convertit les tabulations clavier en espaces.
.TP
.B \-F (\-\-multibuffer)
Active le mode multi-espace, autorisant l'édition simultanée de
Active le mode multi-espace, autorisant l'édition simultanée de
plusieurs fichiers, si ce mode est disponible.
.TP
.B \-H (\-\-historylog)
Enregistre les chaînes ayant fait l'objet d'une recherche ou d'un
Enregistre les chaînes ayant fait l'objet d'une recherche ou d'un
remplacement dans le fichier \fI~/.nano_history\fR afin de permettre leur
réutilisation. Ceci n'est possible que si \fBnano\fR est configuré pour
réutilisation. Ceci n'est possible que si \fBnano\fR est configuré pour
utiliser les fichiers nanorc.
.TP
.B \-I (\-\-ignorercfiles)
@@ -122,63 +122,63 @@ Ne pas utiliser pas les fichiers \fISYSCONFDIR/nanorc\fR et
\fI~/.nanorc\fR (si \fBnano\fR est capable de les utiliser).
.TP
.B \-K (\-\-rebindkeypad)
Interprète les touches du pavé numérique afin qu'elles fonctionnent
Interprète les touches du pavé numérique afin qu'elles fonctionnent
toutes correctement. Vous ne devriez utiliser cette option que si ce
n'est pas le cas, car nano ne sera plus capable d'utiliser la souris
correctement lorsque cette option sera activée.
correctement lorsque cette option sera activée.
.TP
.B \-L (\-\-nonewlines)
Ne pas ajouter de passage à la ligne à la fin des fichiers.
Ne pas ajouter de passage à la ligne à la fin des fichiers.
.TP
.B \-N (\-\-noconvert)
Désactive la conversion automatique des fichiers depuis les formats Mac et
Désactive la conversion automatique des fichiers depuis les formats Mac et
DOS.
.TP
.B \-O (\-\-morespace)
Utiliser la ligne blanche située sous la ligne de titre comme
espace supplémentaire d'édition.
Utiliser la ligne blanche située sous la ligne de titre comme
espace supplémentaire d'édition.
.TP
.B \-Q \fIchaîne\fP (\-\-quotestr=\fIchaîne\fP)
Définit le préfixe par défaut des citations. Nano utilise ce préfixe
pour réaliser une justification correcte des citations. Si nano est
capable d'utiliser des expressions rationnelles, le préfixe par défaut
.B \-Q \fIchaîne\fP (\-\-quotestr=\fIchaîne\fP)
Définit le préfixe par défaut des citations. Nano utilise ce préfixe
pour réaliser une justification correcte des citations. Si nano est
capable d'utiliser des expressions rationnelles, le préfixe par défaut
sera "\fI^([\ \\t]*[#:>\\|}])+\fP", sinon, ce sera "\fI>\ \fP". Dans
l'expression rationnelle précédente, «\ \fI\\t\fP\ » représente une
l'expression rationnelle précédente, «\ \fI\\t\fP\ » représente une
tabulation.
.TP
.B \-R (\-\-restricted)
Mode restreint\ : aucune lecture ou écriture de fichiers non indiqués
Mode restreint\ : aucune lecture ou écriture de fichiers non indiqués
sur la ligne de commande, pas de lecture des fichiers nanorc,
interdiction de suspendre, interdiction d'ajouter au début, à la fin,
de sauvegarder un fichier ayant déjà un nom sous un nom différent,
d'utiliser une copie de sécurité ou le correcteur orthographique. Cette
option peut aussi être activée en appelant \fBnano\fP sous un nom
commençant par «\ r\ » (par exemple «\ rnano\ »).
interdiction de suspendre, interdiction d'ajouter au début, à la fin,
de sauvegarder un fichier ayant déjà un nom sous un nom différent,
d'utiliser une copie de sécurité ou le correcteur orthographique. Cette
option peut aussi être activée en appelant \fBnano\fP sous un nom
commençant par «\ r\ » (par exemple «\ rnano\ »).
.TP
.B \-S (\-\-smooth)
Active le défilement progressif. Le texte défilera ligne-par-ligne au lieu
de défiler morceau-par-morceau.
Active le défilement progressif. Le texte défilera ligne-par-ligne au lieu
de défiler morceau-par-morceau.
.TP
.B \-T \fInombre\fP (\-\-tabsize=\fInombre\fP)
Définit la taille (largeur) des tabulations en nombre de colonnes. Le
nombre indiqué doit être strictement supérieur à 0. La valeur par défaut
Définit la taille (largeur) des tabulations en nombre de colonnes. Le
nombre indiqué doit être strictement supérieur à 0. La valeur par défaut
est de 8.
.TP
.B \-U (\-\-quickblank)
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
d'état disparaîtront après une frappe clavier au lieu de 25. Notez que
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
d'état disparaîtront après une frappe clavier au lieu de 25. Notez que
l'option \fB-c\fP prend le pas sur cette option.
.TP
.B \-V (\-\-version)
Affiche la version, puis s'arrête.
Affiche la version, puis s'arrête.
.TP
.B \-W (\-\-wordbounds)
Détection plus précise des limites de mots, obtenue en considérant les
caractères de ponctuation comme faisant partie des mots.
Détection plus précise des limites de mots, obtenue en considérant les
caractères de ponctuation comme faisant partie des mots.
.TP
.B \-Y \fIchaîne\fP (\-\-syntax=\fIchaîne\fP)
.B \-Y \fIchaîne\fP (\-\-syntax=\fIchaîne\fP)
Indique quel mode de colorisation syntaxique adopter, parmi les modes
définis dans le fichier \fI.nanorc\fR, si cette fonctionnalité est
définis dans le fichier \fI.nanorc\fR, si cette fonctionnalité est
disponible.
.TP
.B \-c (\-\-const)
@@ -186,111 +186,111 @@ Affiche en permanence la position du curseur. Notez que cette option
prend le pas sur l'option \fB-U\fP.
.TP
.B \-d (\-\-rebinddelete)
Interprète différemment la touche «\ Supprimer\ », afin que les touches
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
Vous ne devriez avoir besoin de cette option que si, sur votre système,
la touche «\ Effacement arrière\ » produit l'effet de la touche
«\ Supprimer\ ».
Interprète différemment la touche «\ Supprimer\ », afin que les touches
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
Vous ne devriez avoir besoin de cette option que si, sur votre système,
la touche «\ Effacement arrière\ » produit l'effet de la touche
«\ Supprimer\ ».
.TP
.B \-h (\-\-help)
Affiche un résumé des options de lancement de nano, puis s'arrête.
Affiche un résumé des options de lancement de nano, puis s'arrête.
.TP
.B \-i (\-\-autoindent)
Indentation automatique. Commence chaque nouvelle ligne au même niveau que
la ligne précédente. Utile pour l'édition de code source.
Indentation automatique. Commence chaque nouvelle ligne au même niveau que
la ligne précédente. Utile pour l'édition de code source.
.TP
.B \-k (\-\-cut)
Coupe le texte du curseur à la fin de la ligne, au lieu de couper la
ligne entière.
Coupe le texte du curseur à la fin de la ligne, au lieu de couper la
ligne entière.
.TP
.B \-l (\-\-nofollow)
Si le fichier édité est un lien symbolique, au lieu de le suivre,
remplace le lien par le nouveau fichier. Sans doute utile pour éditer
Si le fichier édité est un lien symbolique, au lieu de le suivre,
remplace le lien par le nouveau fichier. Sans doute utile pour éditer
les fichiers de \fI/tmp\fR, non\ ?
.TP
.B \-m (\-\-mouse)
Active l'utilisation de la souris, si elle est disponible pour votre
système. Lorsque celle-ci est activée, il est possible d'utiliser la
système. Lorsque celle-ci est activée, il est possible d'utiliser la
souris pour positionner le curseur, pour marquer le texte (avec un
double-clic) et pour lancer les fonctions correspondant aux raccourcis.
Il est possible d'utiliser la souris sous X\ Window ou en mode console
avec gpm.
.TP
.B \-o \fIrépertoire\fP (\-\-operatingdir=\fIrépertoire\fP)
Définit le répertoire de travail. Demande à \fBnano\fP de mettre en place
quelque chose de similaire à un environnement d'exécution restreint
.B \-o \fIrépertoire\fP (\-\-operatingdir=\fIrépertoire\fP)
Définit le répertoire de travail. Demande à \fBnano\fP de mettre en place
quelque chose de similaire à un environnement d'exécution restreint
(\fIchroot\fR).
.TP
.B \-p (\-\-preserve)
Préserve les séquences XON et XOFF (^Q et ^S), afin qu'elle soient reçues
Préserve les séquences XON et XOFF (^Q et ^S), afin qu'elle soient reçues
par le terminal.
.TP
.B \-r \fIcolonne\fP (\-\-fill=\fIcolonne\fP)
Passe automatiquement à la ligne une fois arrivé à la colonne
\fIcolonne\fR. Si la valeur indiquée est de 0 ou moins, le point de
passage à la ligne aura lieu à la taille de l'écran moins \fIcolonne\fR.
Cela permet de faire varier le point de passage à la ligne lorsque l'on
change la taille de l'écran. La valeur par défaut est de \-8.
Passe automatiquement à la ligne une fois arrivé à la colonne
\fIcolonne\fR. Si la valeur indiquée est de 0 ou moins, le point de
passage à la ligne aura lieu à la taille de l'écran moins \fIcolonne\fR.
Cela permet de faire varier le point de passage à la ligne lorsque l'on
change la taille de l'écran. La valeur par défaut est de \-8.
.TP
.B \-s \fIprogramme\fP (\-\-speller=\fIprogramme\fP)
Choix d'un correcteur orthographique de remplacement.
.TP
.B \-t (\-\-tempfile)
S'il a été modifié, le fichier sera sauvegardé automatiquement sans
demande de confirmation. Identique à l'option \fB-t\fP de Pico.
S'il a été modifié, le fichier sera sauvegardé automatiquement sans
demande de confirmation. Identique à l'option \fB-t\fP de Pico.
.TP
.B \-v (\-\-view)
Mode visualisation (lecture seule).
.TP
.B \-w (\-\-nowrap)
Désactive le passage automatique à la ligne.
Désactive le passage automatique à la ligne.
.TP
.B \-x (\-\-nohelp)
Désactive la barre d'aide affichée en bas de l'écran.
Désactive la barre d'aide affichée en bas de l'écran.
.TP
.B \-z (\-\-suspend)
Autorise à suspendre l'éditeur.
Autorise à suspendre l'éditeur.
.TP
.B \-a, \-b, \-e, \-f, \-g, \-j
Ignoré, pour être compatible avec Pico.
Ignoré, pour être compatible avec Pico.
.SH "FICHIERS D'INITIALISATION"
\fBnano\fR lit les fichiers d'initialisation dans l'ordre suivant\ :
\fISYSCONFDIR/nanorc\fR, puis \fI~/.nanorc\fR. Référez-vous à la page de
\fISYSCONFDIR/nanorc\fR, puis \fI~/.nanorc\fR. Référez-vous à la page de
manuel de \fBnanorc(5)\fR et au fichier d'exemple \fInanorc.sample\fR,
qui devraient tous les deux être livrés avec \fBnano\fR.
qui devraient tous les deux être livrés avec \fBnano\fR.
.SH NOTES
Si aucun correcteur orthographique de remplacement n'est indiqué dans la
Si aucun correcteur orthographique de remplacement n'est indiqué dans la
ligne de commande ou dans l'un des fichiers nanorc, \fBnano\fR prendra
la commande indiquée par la variable d'environnement \fBSPELL\fR si
elle est définie.
la commande indiquée par la variable d'environnement \fBSPELL\fR si
elle est définie.
Dans certains cas, \fBnano\fR essaiera de sauvegarder le fichier en cours
d'édition dans un fichier de secours. Cela arrivera principalement si
\fBnano\fR reçoit un signal SIGHUP ou SIGTERM, ou bien se trouve à court de
mémoire. Le nom de ce fichier de secours sera \fInano.save\fR si le fichier en
cours n'avait pas encore de nom, ou sera composé du nom du fichier en cours
suivi du suffixe «\ .save\ ». Si un fichier de ce nom existe déjà dans
le répertoire, un «\ .save\ » et un nombre seront ajoutés à la fin du
d'édition dans un fichier de secours. Cela arrivera principalement si
\fBnano\fR reçoit un signal SIGHUP ou SIGTERM, ou bien se trouve à court de
mémoire. Le nom de ce fichier de secours sera \fInano.save\fR si le fichier en
cours n'avait pas encore de nom, ou sera composé du nom du fichier en cours
suivi du suffixe «\ .save\ ». Si un fichier de ce nom existe déjà dans
le répertoire, un «\ .save\ » et un nombre seront ajoutés à la fin du
nom du fichier en cours afin de le rendre unique (par exemple,
«\ .save.1\ »). En mode multi-espace, \fBnano\fR réalisera une
«\ .save.1\ »). En mode multi-espace, \fBnano\fR réalisera une
sauvegarde de tous les fichiers en cours dans leurs fichiers de secours
respectifs.
.SH BOGUES
Merci de nous faire parvenir vos commentaires et de nous signaler les
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
La liste de discussion anglophone \fBnano\fR est disponible à l'adresse
La liste de discussion anglophone \fBnano\fR est disponible à l'adresse
\fBnano-devel@gnu.org\fR.
Pour vous abonner, envoyez un courrier électronique à
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
Pour vous abonner, envoyez un courrier électronique à
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
N'hésitez pas également à envoyez vos commentaires, suggestions et
corrections relatives à l'adaptation française de cette page de manuel
ou du logiciel à \fBjean-philippe.guerard@tigreraye.org\fR.
N'hésitez pas également à envoyez vos commentaires, suggestions et
corrections relatives à l'adaptation française de cette page de manuel
ou du logiciel à \fBjean-philippe.guerard@tigreraye.org\fR.
.SH "SITE INTERNET"
http://www.nano-editor.org/
@@ -300,27 +300,27 @@ http://www.nano-editor.org/
.TP
\fBnanorc\fR(5)
.PP
\fI/usr/share/doc/nano/\fR (ou son équivalent sur votre système)
\fI/usr/share/doc/nano/\fR (ou son équivalent sur votre système)
.SH AUTEUR
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
\fIAUTHORS\fR et \fITHANKS\fR pour plus d'information). Cette page de
manuel a été initialement rédigée par Jordi Mallach <jordi@gnu.org> pour
le système Debian (mais elle peut être utilisée par d'autres).
manuel a été initialement rédigée par Jordi Mallach <jordi@gnu.org> pour
le système Debian (mais elle peut être utilisée par d'autres).
.SH TRADUCTION
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
de la version 1.54 du 11\ octobre\ 2007 de la page de manuel de nano
2.0.0. Cette page a été relue par Gérard Delafond.
2.0.0. Cette page a été relue par Gérard Delafond.
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
vous en rencontrez, que ce soit dans la version française ou dans la
version originale, n'hésitez pas à les signaler à l'auteur ou au
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
vous en rencontrez, que ce soit dans la version française ou dans la
version originale, n'hésitez pas à les signaler à l'auteur ou au
traducteur.
La version originale la plus à jour de ce document est toujours
La version originale la plus à jour de ce document est toujours
consultable via la commande\ :
LANGUAGE=en man nano

View File

@@ -2,14 +2,14 @@
.\" Copyright (C) 2003, 2004, 2005, 2006, 2007
.\" Free Software Foundation, Inc.
.\"
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
.\" Ce travail d'adaptation est dans le domaine public. Attention, la
.\" page traduite reste soumise au droit d'auteur de ses auteurs
.\" originaux.
.\"
.\" The French translation of this document is a public domain work of
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
.\" 2005, 2006 and 2007. The translated man page in itself is still
.\" subject to the copyright of its original authors.
.\"
@@ -29,20 +29,20 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" Ce document est publié sous une double licence. Vous pouvez
.\" Ce document est publié sous une double licence. Vous pouvez
.\" le distribuer et le modifier selon les termes de l'une des deux
.\" licences ci-dessous :
.\" licences ci-dessous :
.\"
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est
.\" pas le cas, consultez <http://www.gnu.org/licenses/>.
.\"
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2
.\" ou, à votre choix, supérieure, telle que publiée par la Free
.\" ou, à votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation, sans section invariante, ni texte de
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" une copie de la Licence de documentation libre GNU avec ce
.\" programme. Si ce n'est pas le cas, consultez
.\" <http://www.gnu.org/licenses/>.
@@ -50,50 +50,50 @@
.\" $Id$
.TH NANORC 5 "version 2.0.0" "29\ novembre\ 2007"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.SH NOM
nanorc \- fichier de configuration de l'éditeur nano du projet GNU
nanorc \- fichier de configuration de l'éditeur nano du projet GNU
.SH DESCRIPTION
Cette page de manuel décrit brièvement le fichier de configuration de
l'éditeur \fBnano\fP GNU.
Cette page de manuel décrit brièvement le fichier de configuration de
l'éditeur \fBnano\fP GNU.
.PP
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à
remplacer Pico, l'éditeur par défaut du logiciel non libre Pine.
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à
remplacer Pico, l'éditeur par défaut du logiciel non libre Pine.
\fBnano\fP ne se contentant pas de copier l'interface et l'ergonomie de
Pico, il offre également certaines fonctionnalités manquantes (ou
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
les fonctions de recherche et de remplacement et la possibilité de
sauter directement à une ligne et à une colonne précise.
Pico, il offre également certaines fonctionnalités manquantes (ou
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
les fonctions de recherche et de remplacement et la possibilité de
sauter directement à une ligne et à une colonne précise.
.PP
Le fichier \fInanorc\fP contient les paramètres par défaut de
\fBnano\fP. Il ne doit pas être au format DOS ou Mac. Lors de son
démarrage, nano commencera par lire le fichier de configuration général
Le fichier \fInanorc\fP contient les paramètres par défaut de
\fBnano\fP. Il ne doit pas être au format DOS ou Mac. Lors de son
démarrage, nano commencera par lire le fichier de configuration général
\fISYSCONFDIR/nanorc\fP, puis lira le fichier de configuration personnel
de l'utilisateur \fI~/.nanorc\fP.
.SH OPTIONS
Le fichier de configuration accepte une série de commandes \fBset\fP
(activer) et \fBunset\fP (désactiver), qui permettent de définir le
paramétrage de nano au démarrage sans avoir à utiliser d'options de
Le fichier de configuration accepte une série de commandes \fBset\fP
(activer) et \fBunset\fP (désactiver), qui permettent de définir le
paramétrage de nano au démarrage sans avoir à utiliser d'options de
ligne de commande. De plus, les mots clefs \fBsyntax\fP (syntaxe),
\fBcolor\fP (couleur) et \fBicolor\fP (couleur insensible à la casse)
sont utilisés pour définir les règles de colorisation pour différents
\fBcolor\fP (couleur) et \fBicolor\fP (couleur insensible à la casse)
sont utilisés pour définir les règles de colorisation pour différents
motifs de texte. \fBnano\fP lit une commande par ligne.
Les options du fichier de configuration ont priorité sur les valeurs par
défaut utilisées par nano. Les options de la ligne de commande sont
Les options du fichier de configuration ont priorité sur les valeurs par
défaut utilisées par nano. Les options de la ligne de commande sont
prioritaires par rapport aux options du fichier de configuration. Les
options sont désactivées (unset) par défaut, sauf les options prenant un
options sont désactivées (unset) par défaut, sauf les options prenant un
argument.
Les apostrophes («\ \fI'\fP\ ») et les guillemets droits («\ \fI"\fP\ »)
présents dans des chaînes de caractères utilisées comme paramètres n'ont
pas besoin d'être précédées d'une barre oblique inversée
\ \fI\\\fP\ »). La chaîne sera terminée par le dernier guillemet
Les apostrophes («\ \fI'\fP\ ») et les guillemets droits («\ \fI"\fP\ »)
présents dans des chaînes de caractères utilisées comme paramètres n'ont
pas besoin d'être précédées d'une barre oblique inversée
\ \fI\\\fP\ »). La chaîne sera terminée par le dernier guillemet
droit. Par exemple, pour l'option \fBbrackets\fP, "\fI"')>]}\fP"
correspondra à \fI"\fP, \fI'\fP, \fI)\fP, \fI>\fP, \fI]\fP et \fI}\fP.
correspondra à \fI"\fP, \fI'\fP, \fI)\fP, \fI>\fP, \fI]\fP et \fI}\fP.
Les commandes et arguments reconnus sont\ :
@@ -102,69 +102,69 @@ Les commandes et arguments reconnus sont\ :
Active l'indentation automatique.
.TP
.B set/unset backup
Crée des copies de sécurité nommées
Crée des copies de sécurité nommées
.IR nom_du_fichier~ .
.TP
.B set backupdir "\fIrépertoire\fP"
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
de sécurité uniques, si l'enregistrement de copies de sécurité est
activé.
.B set backupdir "\fIrépertoire\fP"
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
de sécurité uniques, si l'enregistrement de copies de sécurité est
activé.
.TP
.B set/unset backwards
Par défaut, les recherches se font vers l'arrière.
Par défaut, les recherches se font vers l'arrière.
.TP
.B set/unset boldtext
Utilise des caractères gras à la place de la vidéo inverse.
Utilise des caractères gras à la place de la vidéo inverse.
.TP
.B set brackets "\fIchaîne\fP"
Définit les caractères considérés comme des crochets fermants lors de la
justification des paragraphes. Ces caractères ne doivent pas contenir
d'espaces. Seules les ponctuations terminales, éventuellement suivies
.B set brackets "\fIchaîne\fP"
Définit les caractères considérés comme des crochets fermants lors de la
justification des paragraphes. Ces caractères ne doivent pas contenir
d'espaces. Seules les ponctuations terminales, éventuellement suivies
de crochets fermants, peuvent terminer une phrase.
La valeur par défaut de cette option est\ : "\fI"')>]}\fP".
La valeur par défaut de cette option est\ : "\fI"')>]}\fP".
N.D.T.\ : reportez-vous au paragraphe sur l'option \fBpunct\fR pour
plus d'informations.
.TP
.B set/unset casesensitive
Par défaut, les recherches ne tiennent pas compte de la casse.
Par défaut, les recherches ne tiennent pas compte de la casse.
.TP
.B set/unset const
Affiche en permanence la position du curseur dans la ligne d'état.
Affiche en permanence la position du curseur dans la ligne d'état.
.TP
.B set/unset cut
Par défaut, coupe le texte du curseur à la fin de la ligne, au lieu de
couper la ligne entière.
Par défaut, coupe le texte du curseur à la fin de la ligne, au lieu de
couper la ligne entière.
.TP
.B set fill \fIn\fP
Passe automatiquement à la ligne une fois arrivé à la colonne
\fIn\fR. Si la valeur indiquée est de 0 ou moins, le point de passage à
la ligne aura lieu à la taille de l'écran moins \fIn\fR. Cela permet de
faire varier le point de passage à la ligne lorsque l'on change la
taille de l'écran. La valeur par défaut est de \-8.
Passe automatiquement à la ligne une fois arrivé à la colonne
\fIn\fR. Si la valeur indiquée est de 0 ou moins, le point de passage à
la ligne aura lieu à la taille de l'écran moins \fIn\fR. Cela permet de
faire varier le point de passage à la ligne lorsque l'on change la
taille de l'écran. La valeur par défaut est de \-8.
.TP
.B set/unset historylog
Active l'utilisation de
.I ~/.nano_history
pour enregistrer et relire les chaînes ayant fait l'objet d'une
pour enregistrer et relire les chaînes ayant fait l'objet d'une
recherche ou d'un remplacement.
.TP
.B set matchbrackets "\fIchaîne\fP"
Définit les crochets ouvrants et fermant pour la recherche de crochets
.B set matchbrackets "\fIchaîne\fP"
Définit les crochets ouvrants et fermant pour la recherche de crochets
correspondants. Cette liste ne doit pas contenir de blancs. L'ensemble
des crochets ouvrants doit être indiqué en premier, suivi de l'ensemble
des crochets fermant, qui doit être dans le même ordre. La valeur par
défaut de cette option est "\fI(<[{)>]}\fP".
des crochets ouvrants doit être indiqué en premier, suivi de l'ensemble
des crochets fermant, qui doit être dans le même ordre. La valeur par
défaut de cette option est "\fI(<[{)>]}\fP".
.TP
.B set/unset morespace
Utiliser la ligne blanche située sous la ligne de titre comme espace
supplémentaire d'édition.
Utiliser la ligne blanche située sous la ligne de titre comme espace
supplémentaire d'édition.
.TP
.B set/unset mouse
Active l'utilisation de la souris, si elle est disponible pour votre
système. Lorsque celle-ci est activée, il est possible d'utiliser la
système. Lorsque celle-ci est activée, il est possible d'utiliser la
souris pour positionner le curseur, pour marquer le texte (avec un
double-clic) et pour lancer les fonctions correspondant aux raccourcis.
Il est possible d'utiliser la souris sous X\ Window ou en mode console
@@ -178,167 +178,167 @@ espace.
Pas de conversion depuis les formats DOS et Mac.
.TP
.B set/unset nofollow
Ne suit pas les liens symboliques lors de l'écriture des fichiers.
Ne suit pas les liens symboliques lors de l'écriture des fichiers.
.TP
.B set/unset nohelp
Désactive les lignes d'aide affichée en bas de l'écran.
Désactive les lignes d'aide affichée en bas de l'écran.
.TP
.B set/unset nonewlines
Ne pas ajouter de passage à la ligne à la fin des fichiers.
Ne pas ajouter de passage à la ligne à la fin des fichiers.
.TP
.B set/unset nowrap
Désactive le passage automatique à la ligne.
Désactive le passage automatique à la ligne.
.TP
.B set operatingdir "\fIrépertoire\fP"
\fBnano\fP ne lira et n'écrira des fichiers qu'à l'intérieur du
\fIrépertoire\fP et de ses sous-répertoires. De plus, celui-ci devient
le répertoire courant, afin que les fichiers soient lus depuis ce
répertoire. Par défaut, cette fonction est désactivée.
.B set operatingdir "\fIrépertoire\fP"
\fBnano\fP ne lira et n'écrira des fichiers qu'à l'intérieur du
\fIrépertoire\fP et de ses sous-répertoires. De plus, celui-ci devient
le répertoire courant, afin que les fichiers soient lus depuis ce
répertoire. Par défaut, cette fonction est désactivée.
.TP
.B set/unset preserve
Préserve les séquences XON et XOFF (^Q et ^S).
Préserve les séquences XON et XOFF (^Q et ^S).
.TP
.B set punct "\fIchaîne\fP"
Définit les caractères interprétés comme des ponctuations terminales
lors de la justification des paragraphes. Ces caractères ne peuvent
inclure de blancs. Seules les ponctuations terminales, éventuellement
.B set punct "\fIchaîne\fP"
Définit les caractères interprétés comme des ponctuations terminales
lors de la justification des paragraphes. Ces caractères ne peuvent
inclure de blancs. Seules les ponctuations terminales, éventuellement
suivies de crochets fermants, peuvent terminer une phrase. La valeur par
défaut de cette option est "\fI!.?\fP".
défaut de cette option est "\fI!.?\fP".
N.D.T.\ : ce réglage permet, lors de la justification, de conserver
2\ espaces au lieu d'une derrière les ponctuations terminales, ce qui
N.D.T.\ : ce réglage permet, lors de la justification, de conserver
2\ espaces au lieu d'une derrière les ponctuations terminales, ce qui
correspond aux normes typographiques anglo-saxonnes, mais n'a pas lieu
d'être en français. Pour le français, le plus simple est d'indiquer,
dans le fichier nanorc, une chaîne vide pour ce paramètre.
d'être en français. Pour le français, le plus simple est d'indiquer,
dans le fichier nanorc, une chaîne vide pour ce paramètre.
.TP
.B set/unset quickblank
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
d'état disparaîtront après une frappe clavier au lieu de 25.
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
d'état disparaîtront après une frappe clavier au lieu de 25.
.TP
.B set quotestr "\fIchaîne\fP"
Définit le préfixe par défaut utilisé pour les citations dans les
courriers électroniques. Ce préfixe est utilisé pour réaliser une
justification correcte de ces citations. Il s'agira, si votre système le
permet, d'une expression rationnelle étendue. Dans le cas
contraire, il s'agira d'une chaîne de texte brut. Si vous disposez des
expressions rationnelles, la valeur par défaut de cette option sera
.B set quotestr "\fIchaîne\fP"
Définit le préfixe par défaut utilisé pour les citations dans les
courriers électroniques. Ce préfixe est utilisé pour réaliser une
justification correcte de ces citations. Il s'agira, si votre système le
permet, d'une expression rationnelle étendue. Dans le cas
contraire, il s'agira d'une chaîne de texte brut. Si vous disposez des
expressions rationnelles, la valeur par défaut de cette option sera
"\fI^([\ \\t]*[#:>\\|}])+\fP", sinon, ce sera ">\ ". Notez que le
«\ \\t\ » ci-dessus correspond à un caractère de tabulation.
«\ \\t\ » ci-dessus correspond à un caractère de tabulation.
.TP
.B set/unset rebinddelete
Interprète différemment la touche «\ Supprimer\ », afin que les touches
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
Vous ne devriez avoir besoin de cette option que si, sur votre système,
la touche «\ Effacement arrière\ » produit l'effet de la touche «\
Supprimer\ ».
Interprète différemment la touche «\ Supprimer\ », afin que les touches
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
Vous ne devriez avoir besoin de cette option que si, sur votre système,
la touche «\ Effacement arrière\ » produit l'effet de la touche «\
Supprimer\ ».
.TP
.B set/unset rebindkeypad
Interprète les touches du pavé numérique afin qu'elles fonctionnent
Interprète les touches du pavé numérique afin qu'elles fonctionnent
toutes correctement. Vous ne devriez utiliser cette option que si ce
n'est pas le cas, car nano ne sera plus capable d'utiliser la souris
correctement lorsque cette option sera activée.
correctement lorsque cette option sera activée.
.TP
.B set/unset regexp
Utilise par défaut des expressions rationnelles étendues pour les
Utilise par défaut des expressions rationnelles étendues pour les
recherches.
.TP
.B set/unset smarthome
Rend plus malin le fonctionnement de la touche «\ Début\ ». Lorsque
cette touche est pressée à n'importe quel endroit excepté au tout début
du texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur
se positionnera au début du texte de la ligne (qu'il soit en avant ou en
arrière). Si le curseur est déjà là, il se placera au vrai début de la
Rend plus malin le fonctionnement de la touche «\ Début\ ». Lorsque
cette touche est pressée à n'importe quel endroit excepté au tout début
du texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur
se positionnera au début du texte de la ligne (qu'il soit en avant ou en
arrière). Si le curseur est déjà là, il se placera au vrai début de la
ligne.
.TP
.B set/unset smooth
Active le défilement ligne-par-ligne du texte.
Active le défilement ligne-par-ligne du texte.
.TP
.B set speller "\fIprogramme\fP"
Utilise le correcteur orthographique \fIprogramme\fP au lieu du
correcteur intégré, qui s'appuie sur \fIspell\fP.
correcteur intégré, qui s'appuie sur \fIspell\fP.
.TP
.B set/unset suspend
Autorise à suspendre \fBnano\fP.
Autorise à suspendre \fBnano\fP.
.TP
.B set tabsize \fIn\fP
Utilise une taille de tabulation de \fIn\fP colonnes. Cette valeur doit
être strictement supérieure à 0. La valeur par défaut est de\ 8.
être strictement supérieure à 0. La valeur par défaut est de\ 8.
.TP
.B set/unset tabstospaces
Convertit les tabulations clavier en espaces.
.TP
.B set/unset tempfile
S'il a été modifié, le fichier sera sauvegardé automatiquement en
S'il a été modifié, le fichier sera sauvegardé automatiquement en
quittant, sans demande de confirmation.
.TP
.B set/unset view
Interdit de modifier les fichiers.
.TP
.B set whitespace "\fIchaîne\fP"
Définit les deux caractères utilisés pour afficher les premiers
caractères des tabulations et des espaces. Ces deux caractères doivent
être mono-colonne.
.B set whitespace "\fIchaîne\fP"
Définit les deux caractères utilisés pour afficher les premiers
caractères des tabulations et des espaces. Ces deux caractères doivent
être mono-colonne.
.TP
.B set/unset wordbounds
Détection plus précise des limites de mots, obtenue en considérant les
caractères de ponctuation comme faisant partie des mots.
Détection plus précise des limites de mots, obtenue en considérant les
caractères de ponctuation comme faisant partie des mots.
.TP
.B syntax "\fIchaîne\fP" ["\fImotif_de_fichier\fP" ... ]
Définit une syntaxe nommée \fIchaîne\fP qui pourra être activé via
.B syntax "\fIchaîne\fP" ["\fImotif_de_fichier\fP" ... ]
Définit une syntaxe nommée \fIchaîne\fP qui pourra être activé via
l'option \fB-Y\fP (ou \fB--syntax\fP) ou qui sera automatiquement
activée si le nom du fichier en cours correspond à l'expression
rationnelle étendue \fImotif_de_fichier\fP. Toutes les instructions
suivantes de colorisation \fBcolor\fP ou \fBicolor\fP s'appliqueront à
cette syntaxe, jusqu'à la définition d'une nouvelle syntaxe.
activée si le nom du fichier en cours correspond à l'expression
rationnelle étendue \fImotif_de_fichier\fP. Toutes les instructions
suivantes de colorisation \fBcolor\fP ou \fBicolor\fP s'appliqueront à
cette syntaxe, jusqu'à la définition d'une nouvelle syntaxe.
La syntaxe nommée \fInone\fP (aucune) est réservée\ ; si elle est
indiquée dans la ligne de commande, cela revient à ne définir aucune
syntaxe. La syntaxe nommée \fIdefault\fP (par défaut) est spéciale, elle
ne nécessite aucun motif de \fImotif_de_fichier\fP, et s'applique aux
fichiers ne correspondant à aucun des \fImotif_de_fichier\fP des autres
La syntaxe nommée \fInone\fP (aucune) est réservée\ ; si elle est
indiquée dans la ligne de commande, cela revient à ne définir aucune
syntaxe. La syntaxe nommée \fIdefault\fP (par défaut) est spéciale, elle
ne nécessite aucun motif de \fImotif_de_fichier\fP, et s'applique aux
fichiers ne correspondant à aucun des \fImotif_de_fichier\fP des autres
syntaxes.
.TP
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
Pour la syntaxe en cours, affiche toutes les expressions correspondant à
l'expression rationnelle étendue \fImotif\fP en utilisant la couleur de
Pour la syntaxe en cours, affiche toutes les expressions correspondant à
l'expression rationnelle étendue \fImotif\fP en utilisant la couleur de
texte \fIcouleur_texte\fP et la couleur de fond \fIcouleur_fond\fP,
l'une de ces deux couleurs au moins devant être définie. Les couleurs
acceptées par \fBnano\fP pour le texte et le fond sont\ : \fIwhite\fP
l'une de ces deux couleurs au moins devant être définie. Les couleurs
acceptées par \fBnano\fP pour le texte et le fond sont\ : \fIwhite\fP
(blanc), \fIblack\fP (noir), \fIred\fP (rouge), \fIblue\fP (bleu),
\fIgreen\fP (vert), \fIyellow\fP (jaune), \fImagenta\fP, et \fIcyan\fP.
Pour la couleur du texte, vous pouvez ajouter à ces couleurs le préfixe
Pour la couleur du texte, vous pouvez ajouter à ces couleurs le préfixe
\fIbright\fP (lumineux) pour obtenir une couleur plus lumineuse. Si
votre terminal est capable de gérer la transparence, ne pas spécifier de
\fIcouleur_fond\fP indique à \fBnano\fP d'essayer d'utiliser un fond
votre terminal est capable de gérer la transparence, ne pas spécifier de
\fIcouleur_fond\fP indique à \fBnano\fP d'essayer d'utiliser un fond
transparent.
.TP
.B icolor \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
Comme ci-dessus, mais la recherche des motifs est effectuée sans tenir
Comme ci-dessus, mais la recherche des motifs est effectuée sans tenir
compte de la casse.
.TP
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
Affiche les expressions commençant par l'expression rationnelle étendue
\fImotif_début\fP et se terminant par l'expression rationnelle étendue
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
Affiche les expressions commençant par l'expression rationnelle étendue
\fImotif_début\fP et se terminant par l'expression rationnelle étendue
\fImotif_fin\fP en utilisant la couleur de texte \fIcouleur_texte\fP
et la couleur de fond \fIcouleur_fond\fP, l'une de ces deux couleurs au
moins devant être définie. Cela permet à la colorisation syntaxique de
s'étendre sur plusieurs lignes. Notez que toutes les occurrences
successives de \fImotif_début\fP après le \fImotif_début\fP initial
seront surlignées jusqu'à la prochaine instance de \fImotif_fin\fP.
moins devant être définie. Cela permet à la colorisation syntaxique de
s'étendre sur plusieurs lignes. Notez que toutes les occurrences
successives de \fImotif_début\fP après le \fImotif_début\fP initial
seront surlignées jusqu'à la prochaine instance de \fImotif_fin\fP.
.TP
.B icolor \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
Comme ci-dessus, mais la recherche des motifs est effectuée sans tenir
.B icolor \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
Comme ci-dessus, mais la recherche des motifs est effectuée sans tenir
compte de la casse.
.TP
.B include "\fIfichier_de_syntaxes\fP"
Lit le fichier \fIfichier_de_syntaxes\fP contenant une liste
autosuffisante de définitions de syntaxes. Ce fichier ne doit contenir
autosuffisante de définitions de syntaxes. Ce fichier ne doit contenir
que des commandes \fBsyntax\fP, \fBcolor\fP et \fBicolor\fP.
.SH FICHIERS
.TP
.I $SYSCONFDIR/nanorc
Fichier de configuration général
Fichier de configuration général
.TP
.I ~/.nanorc
Fichier de configuration personnel
@@ -348,29 +348,29 @@ Fichier de configuration personnel
.TP
\fBnano\fP(1)
.PP
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (ou son équivalent sur
votre système)
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (ou son équivalent sur
votre système)
.SH AUTEUR
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
manuel a été initialement rédigée par Jordi Mallach <jordi@gnu.org> pour
le système Debian (mais elle peut être utilisée par d'autres).
manuel a été initialement rédigée par Jordi Mallach <jordi@gnu.org> pour
le système Debian (mais elle peut être utilisée par d'autres).
.SH TRADUCTION
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir de
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir de
la version 1.56 du 11\ octobre\ 2007 de la page de manuel de nanorc
(pour la version 2.0.0 de nano). Cette page a été relue par Gérard
(pour la version 2.0.0 de nano). Cette page a été relue par Gérard
Delafond.
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
vous en rencontrez, que ce soit dans la version française ou dans la
version originale, n'hésitez pas à les signaler à l'auteur ou au
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
vous en rencontrez, que ce soit dans la version française ou dans la
version originale, n'hésitez pas à les signaler à l'auteur ou au
traducteur.
La version originale la plus à jour de ce document est toujours
La version originale la plus à jour de ce document est toujours
consultable via la commande\ :
LANGUAGE=en man nano

View File

@@ -3,13 +3,13 @@
.\" Skeleton based on nano-tiny.1:
.\" Copyright (C) 2002 Free Software Foundation, Inc.
.\"
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2006 et 2007. Ce travail
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2006 et 2007. Ce travail
.\" d'adaptation est dans le domaine public. Attention, la page traduite
.\" reste soumise au droit d'auteur de ses auteurs originaux.
.\"
.\" The French translation of this document is a public domain work of
.\" Jean-Philippe Guérard. This translation work was made in 2006 and
.\" Jean-Philippe Guérard. This translation work was made in 2006 and
.\" 2007. The translated man page in itself is still subject to the
.\" copyright of its original authors.
.\"
@@ -29,20 +29,20 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" Ce document est publié sous une double licence. Vous pouvez
.\" Ce document est publié sous une double licence. Vous pouvez
.\" le distribuer et le modifier selon les termes de l'une des deux
.\" licences ci-dessous :
.\" licences ci-dessous :
.\"
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
.\" le cas, consultez <http://www.gnu.org/licenses/>.
.\"
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2 ou,
.\" à votre choix, supérieure, telle que publiée par la Free
.\" à votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation, sans section invariante, ni texte de
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" une copie de la Licence de documentation libre GNU avec ce
.\" programme. Si ce n'est pas le cas, consultez
.\" <http://www.gnu.org/licenses/>.
@@ -50,105 +50,105 @@
.\" $Id$
.TH RNANO 1 "version 2.0.0" "29\ novembre\ 20O7"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\"
.SH NOM
rnano \- Le mode restreint de NAno un NOuvel éditeur, un clone libre et
amélioré de Pico
rnano \- Le mode restreint de NAno un NOuvel éditeur, un clone libre et
amélioré de Pico
.SH SYNOPSIS
.B rnano
.I [OPTIONS]\ [[\+LIGNE,COLONNE]\ FICHIER]...
.I [OPTIONS]\ [[+LIGNE,COLONNE]\ FICHIER]...
.br
.SH DESCRIPTION
Cette page de manuel décrit brièvement la commande \fBrnano\fR.
Cette page de manuel décrit brièvement la commande \fBrnano\fR.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" respectively.
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à
remplacer Pico, l'éditeur par défaut du logiciel non libre Pine.
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à
remplacer Pico, l'éditeur par défaut du logiciel non libre Pine.
\fBnano\fR ne se contentant pas de copier l'interface et l'ergonomie de
Pico, il offre également certaines fonctions manquantes (ou désactivées
par défaut) dans Pico. Ces fonctionnalités sont, par exemple, les
fonctions de recherche et de remplacement, et la possibilité de sauter
directement à une ligne et à une colonne précise..
Pico, il offre également certaines fonctions manquantes (ou désactivées
par défaut) dans Pico. Ces fonctionnalités sont, par exemple, les
fonctions de recherche et de remplacement, et la possibilité de sauter
directement à une ligne et à une colonne précise..
.PP
\fBrnano\fP est une version de \fBnano\fP fonctionnant en mode
restreint, qui ne permet d'éditer que les fichiers indiqués et qui
n'autorise pas l'utilisateur à accéder au système de fichier ou à un
interpréteur de commandes.
restreint, qui ne permet d'éditer que les fichiers indiqués et qui
n'autorise pas l'utilisateur à accéder au système de fichier ou à un
interpréteur de commandes.
.PP
En mode restreint, \fBnano\fP refusera\ :
.IP \[bu] 2
de lire ou d'écrire dans un fichier n'ayant pas été indiqué dans la
de lire ou d'écrire dans un fichier n'ayant pas été indiqué dans la
ligne de commande\ ;
.IP \[bu]
de lire un fichier nanorc\ ;
.IP \[bu]
de permettre de suspendre l'édition\ ;
de permettre de suspendre l'édition\ ;
.IP \[bu]
de permettre d'ajouter en début ou en fin d'un fichier, ou de
l'enregistrer sous un nom différent\ ;
de permettre d'ajouter en début ou en fin d'un fichier, ou de
l'enregistrer sous un nom différent\ ;
.IP \[bu]
l'utilisation de copies de sécurité ou de la correction orthographique.
l'utilisation de copies de sécurité ou de la correction orthographique.
.SH OPTIONS
.TP
.B \+\fILIGNE\fP,\fICOLONNE\fP
Démarre avec le curseur positionné à la colonne \fICOLONNE\fP de
la ligne \fILIGNE\fR (l'un des deux, au moins, devant être spécifié) au
lieu de démarrer à la colonne\ 1, ligne\ 1.
.B +\fILIGNE\fP,\fICOLONNE\fP
Démarre avec le curseur positionné à la colonne \fICOLONNE\fP de
la ligne \fILIGNE\fR (l'un des deux, au moins, devant être spécifié) au
lieu de démarrer à la colonne\ 1, ligne\ 1.
.TP
.B \-?
Identique à \fB-h (\-\-help)\fP.
Identique à \fB\-h (\-\-help)\fP.
.TP
.B \-h (\-\-help)
Affiche un résumé des options de lancement de nano, puis s'arrête.
Affiche un résumé des options de lancement de nano, puis s'arrête.
.TP
.B \-V (\-\-version)
Affiche la version, puis s'arrête.
Affiche la version, puis s'arrête.
.PP
Reportez-vous à la page de manuel \fBnano\fP(1) si vous souhaitez
consulter la documentation complète de \fBnano\fP.
Reportez-vous à la page de manuel \fBnano\fP(1) si vous souhaitez
consulter la documentation complète de \fBnano\fP.
.SH BOGUES
Merci de nous faire parvenir vos commentaires et de nous signaler les
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
La liste de discussion anglophone \fBnano\fR est disponible à l'adresse
La liste de discussion anglophone \fBnano\fR est disponible à l'adresse
\fBnano-devel@gnu.org\fR.
Pour vous abonner, envoyez un courrier électronique à
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
Pour vous abonner, envoyez un courrier électronique à
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
N'hésitez pas également à envoyez vos commentaires, suggestions et
corrections relatives à l'adaptation française de cette page de manuel
ou du logiciel à \fBjean-philippe.guerard@tigreraye.org\fR.
N'hésitez pas également à envoyez vos commentaires, suggestions et
corrections relatives à l'adaptation française de cette page de manuel
ou du logiciel à \fBjean-philippe.guerard@tigreraye.org\fR.
.SH "SITE INTERNET"
http://www.nano-editor.org/
.SH AUTEUR
Chris Allegretta <chrisa@asty.org> et d'autres (voir le fichier
\fIAUTHORS\fR). Cette page de manuel a été initialement rédigée par
Thijs Kinkhorst <thijs@kinkhorst.com>, pour le système GNU Debian (mais
elle peut être utilisée par d'autres).
\fIAUTHORS\fR). Cette page de manuel a été initialement rédigée par
Thijs Kinkhorst <thijs@kinkhorst.com>, pour le système GNU Debian (mais
elle peut être utilisée par d'autres).
.SH TRADUCTION
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
de la version 1.19 du 6\ novembre\ 2007 de la page de manuel de rnano
(pour la version 2.0.0 de nano).
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
vous en rencontrez, que ce soit dans la version française ou dans la
version originale, n'hésitez pas à les signaler à l'auteur ou au
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
vous en rencontrez, que ce soit dans la version française ou dans la
version originale, n'hésitez pas à les signaler à l'auteur ou au
traducteur.
La version originale la plus à jour de ce document est toujours
La version originale la plus à jour de ce document est toujours
consultable via la commande\ :
LANGUAGE=en man nano

View File

@@ -20,7 +20,7 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.TH NANO 1 "version 2.3.5" "June 2014"
.TH NANO 1 "version 2.3.7" "August 2014"
.\" Please adjust this date whenever revising the manpage.
.\"
@@ -29,8 +29,7 @@ nano \- Nano's ANOther editor, an enhanced free Pico clone
.SH SYNOPSIS
.B nano
.RI [ options "] [[\+" line , column "]\ " file "]..."
.br
.RI [ options "] [[+" line , column "]\ " file "]..."
.SH DESCRIPTION
\fBnano\fP is a small, free and friendly editor which aims to replace
@@ -41,70 +40,70 @@ replace" and "go to line and column number".
.SH OPTIONS
.TP
.B \+\fIline\fP,\fIcolumn\fP
.B +\fIline\fP,\fIcolumn\fP
Places the cursor on line number \fIline\fP and at column number \fIcolumn\fP
(at least one of which must be specified) on startup, instead of the
default line 1, column 1.
.TP
.B \-A (\-\-smarthome)
.BR \-A ", " \-\-smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
.TP
.B \-B (\-\-backup)
.BR \-B ", " \-\-backup
When saving a file, back up the previous version of it to the current
filename suffixed with a tilde (\fB~\fP).
.TP
.B \-C \fIdir\fP (\-\-backupdir=\fIdir\fP)
.BR \-C\ \fIdirectory\fR ", " \-\-backupdir= \fIdirectory
Set the directory where \fBnano\fP puts unique backup files, if file
backups are enabled.
.TP
.B \-D (\-\-boldtext)
.BR \-D ", " \-\-boldtext
Use bold text instead of reverse video text.
.TP
.B \-E (\-\-tabstospaces)
.BR \-E ", " \-\-tabstospaces
Convert typed tabs to spaces.
.TP
.B \-F (\-\-multibuffer)
.BR \-F ", " \-\-multibuffer
Enable multiple file buffers (if support for them has been compiled in).
.TP
.B \-G (\-\-locking)
.BR \-G ", " \-\-locking
Enable vim-style file locking when editing files.
.TP
.B \-H (\-\-historylog)
.BR \-H ", " \-\-historylog
Log search and replace strings to \fI~/.nano/search_history\fP, so they can be
retrieved in later sessions.
.TP
.B \-I (\-\-ignorercfiles)
.BR \-I ", " \-\-ignorercfiles
Don't look at the system's \fBnanorc\fP nor at \fB~/.nanorc\fP.
.TP
.B \-K (\-\-rebindkeypad)
.BR \-K ", " \-\-rebindkeypad
Interpret the numeric keypad keys so that they all work properly. You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
.TP
.B \-L (\-\-nonewlines)
.BR \-L ", " \-\-nonewlines
Don't add newlines to the ends of files.
.TP
.B \-N (\-\-noconvert)
.BR \-N ", " \-\-noconvert
Disable automatic conversion of files from DOS/Mac format.
.TP
.B \-O (\-\-morespace)
.BR \-O ", " \-\-morespace
Use the blank line below the titlebar as extra editing space.
.TP
.B \-P (\-\-poslog)
.BR \-P ", " \-\-poslog
Log and later read back the location of the cursor and place it there
again.
.TP
.B \-Q \fIstr\fP (\-\-quotestr=\fIstr\fP)
.BR "\-Q ""\fIcharacters\fB""" ", " "\-\-quotestr=""" \fIcharacters\fR """
Set the quoting string for justifying. The default is
"\fI^([\ \\t]*[#:>\\|}])+\fP" if extended regular expression support is
available, or "\fI>\ \fP" otherwise. Note that \fI\\t\fP stands for a
\fB"^([\ \\t]*[#:>\\|}])+"\fP if extended regular expression support is
available, or \fB">\ "\fP otherwise. Note that \fB\\t\fP stands for a
Tab.
.TP
.B \-R (\-\-restricted)
.BR \-R ", " \-\-restricted
Restricted mode: don't read or write to any file not specified on the
command line; don't read any \fInanorc\fP files nor history files;
don't allow suspending nor spell checking;
@@ -113,80 +112,80 @@ different name if it already has one; and don't use backup files.
This restricted mode is also accessible by invoking \fBnano\fP
with any name beginning with 'r' (e.g. "rnano").
.TP
.B \-S (\-\-smooth)
.BR \-S ", " \-\-smooth
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
.TP
.B \-T \fInumber\fP (\-\-tabsize=\fInumber\fP)
.BR \-T\ \fInumber\fR ", " \-\-tabsize= \fInumber
Set the size (width) of a tab to \fInumber\fP columns. The value of
\fInumber\fP must be greater than 0. The default value is 8.
.TP
.B \-U (\-\-quickblank)
.BR \-U ", " \-\-quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25. Note that \fB\-c\fP overrides this.
.TP
.B \-V (\-\-version)
.BR \-V ", " \-\-version
Show the current version number and exit.
.TP
.B \-W (\-\-wordbounds)
.BR \-W ", " \-\-wordbounds
Detect word boundaries more accurately by treating punctuation
characters as part of a word.
.TP
.B \-Y \fIname\fP (\-\-syntax=\fIname\fP)
.BR \-Y\ \fIname\fR ", " \-\-syntax= \fIname
Specify the name of the syntax highlighting to use from among the ones
defined in the \fInanorc\fP files.
.TP
.B \-c (\-\-const)
.BR \-c ", " \-\-const
Constantly show the cursor position. Note that this overrides \fB\-U\fP.
.TP
.B \-d (\-\-rebinddelete)
.BR \-d ", " \-\-rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
.TP
.B \-h (\-\-help)
.BR \-h ", " \-\-help
Show a summary of the available command-line options and exit.
.TP
.B \-i (\-\-autoindent)
.BR \-i ", " \-\-autoindent
Indent new lines to the previous line's indentation. Useful when
editing source code.
.TP
.B \-k (\-\-cut)
.BR \-k ", " \-\-cut
Make the 'Cut Text' command (normally ^K) cut from the current cursor
position to the end of the line, instead of cutting the entire line.
.TP
.B \-l (\-\-nofollow)
.BR \-l ", " \-\-nofollow
If the file being edited is a symbolic link, replace the link with
a new file instead of following it. Good for editing files in
\fI/tmp\fP, perhaps?
.TP
.B \-m (\-\-mouse)
.BR \-m ", " \-\-mouse
Enable mouse support, if available for your system. When enabled, mouse
clicks can be used to place the cursor, set the mark (with a double
click), and execute shortcuts. The mouse will work in the X Window
System, and on the console when gpm is running. Text can still be
selected through dragging by holding down the Shift key.
.TP
.B \-n (\-\-noread)
.BR \-n ", " \-\-noread
Treat any name given on the command line as a new file. This allows
\fBnano\fR to write to named pipes: it will start with a blank buffer,
and will write to the pipe when the user saves the "file". This way
\fBnano\fR can be used as an editor in combination with for instance
\fBgpg\fR without having to write sensitive data to disk first.
.TP
.B \-o \fIdir\fP (\-\-operatingdir=\fIdir\fP)
.BR \-o\ \fIdirectory\fR ", " \-\-operatingdir= \fIdirectory
Set the operating directory. This makes \fBnano\fP set up something
similar to a chroot.
.TP
.B \-p (\-\-preserve)
.BR \-p ", " \-\-preserve
Preserve the XON and XOFF sequences (^Q and ^S) so they will be caught
by the terminal.
.TP
.B \-q (\-\-quiet)
.BR \-q ", " \-\-quiet
Do not report errors in the \fInanorc\fP files nor ask them to be
acknowledged by pressing Enter at startup.
.TP
.B \-r \fInumber\fP (\-\-fill=\fInumber\fP)
.BR \-r\ \fInumber\fR ", " \-\-fill= \fInumber
Hard-wrap lines at column \fInumber\fP. If this value is 0 or less, wrapping
will occur at the width of the screen less \fInumber\fP columns, allowing
the wrap point to vary along with the width of the screen if the screen
@@ -194,36 +193,36 @@ is resized. The default value is \-8. This option conflicts with
.B \-w
-- the last one given takes effect.
.TP
.B \-s \fIprogram\fP (\-\-speller=\fIprogram\fP)
Enable alternative spell checker command.
.BR \-s\ \fIprogram\fR ", " \-\-speller= \fIprogram
Use this alternative spell checker command.
.TP
.B \-t (\-\-tempfile)
Always save changed buffer without prompting. Same as Pico's \fB\-t\fP
.BR \-t ", " \-\-tempfile
Always save a changed buffer without prompting. Same as Pico's \fB\-t\fP
option.
.TP
.B \-v (\-\-view)
.BR \-v ", " \-\-view
View-file (read-only) mode.
.TP
.B \-w (\-\-nowrap)
.BR \-w ", " \-\-nowrap
Disable the hard-wrapping of long lines. This option conflicts with
.B \-r
-- the last one given takes effect.
.TP
.B \-x (\-\-nohelp)
.BR \-x ", " \-\-nohelp
Don't show the two help lines at the bottom of the screen.
.TP
.B \-z (\-\-suspend)
.BR \-z ", " \-\-suspend
Enable the suspend ability.
.TP
.B \-$ (\-\-softwrap)
.BR \-$ ", " \-\-softwrap
Enable 'soft wrapping'. This will make \fBnano\fP attempt to display the
entire contents of any line, even if it is longer than the screen width, by
continuing it over multiple screen lines. Since
\&'$' normally refers to a variable in the Unix shell, you should specify
this option last when using other options (e.g. 'nano \-wS$') or pass it
separately (e.g. 'nano \-wS \-$').
this option last when using other options (e.g.\& 'nano \-wS$') or pass it
separately (e.g.\& 'nano \-wS \-$').
.TP
.B \-a, \-b, \-e, \-f, \-g, \-j
.BR \-a ", " \-b ", " \-e ", " \-f ", " \-g ", " \-j
Ignored, for compatibility with Pico.
.SH INITIALIZATION FILE
@@ -244,7 +243,7 @@ SIGTERM or runs out of memory. It will write the buffer into a file
named \fInano.save\fP if the buffer didn't have a name already, or will
add a ".save" suffix to the current filename. If an emergency file with
that name already exists in the current directory, it will add ".save"
plus a number (e.g. ".save.1") to the current filename in order to make
plus a number (e.g.\& ".save.1") to the current filename in order to make
it unique. In multibuffer mode, \fBnano\fP will write all the open
buffers to their respective emergency files.
@@ -267,7 +266,7 @@ http://www.nano-editor.org/
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
Chris Allegretta <chrisa@asty.org>, et al (see the files \fIAUTHORS\fP and
\fITHANKS\fP for details). This manual page was originally written by
Jordi Mallach <jordi@gnu.org>, for the Debian system (but may be used by
others).

View File

@@ -38,38 +38,42 @@ commands, which can be used to configure nano on startup without using
command-line options. Additionally, there are some commands to define
syntax highlighting and to rebind keys -- see the two separate sections
on those. \fBnano\fP reads one command per line.
.PP
Options in \fInanorc\fP files take precedence over nano's defaults, and
command-line options override \fInanorc\fP settings. Also, options are
unset by default, except for those that take arguments.
Quotes inside string parameters don't have to be escaped with
command-line options override \fInanorc\fP settings. Also, options that
do not take an argument are unset by default. So using the \fBunset\fR
command is only needed when wanting to override a setting of the system's
\fInanorc\fR file in your own \fB~/.nanorc\fR. Options that take an
argument cannot be unset.
.PP
Below, the \fIstring\fR parameters need to be enclosed in double quotes.
Quotes inside these string parameters don't have to be escaped with
backslashes. The last double quote in the string will be treated as its
end. For example, for the \fBbrackets\fP option, "\fB"')>]}\fP" will
match \fB"\fP, \fB'\fP, \fB)\fP, \fB>\fP, \fB]\fP, and \fB}\fP.
.PP
The supported commands and arguments are:
.TP 3
.B set/unset allow_insecure_backup
.B set allow_insecure_backup
When backing up files, allow the backup to succeed even if its permissions
can't be (re)set due to special OS considerations. You should
NOT enable this option unless you are sure you need it.
.TP
.B set/unset autoindent
.B set autoindent
Use auto-indentation.
.TP
.B set/unset backup
.B set backup
Create backup files by adding a tilde (\fB~\fP) to each file's name.
.TP
.B set backupdir "\fIdirectory\fP"
Set the directory where \fBnano\fP puts unique backup files, if file
backups are enabled.
.TP
.B set/unset backwards
.B set backwards
Do backwards searches by default.
.TP
.B set/unset boldtext
.B set boldtext
Use bold instead of reverse video for the titlebar, statusbar, key combos,
and selected text. This can be overridden for the first three by setting
the options \fBtitlecolor\fP, \fBstatuscolor\fP, and \fBkeycolor\fP.
@@ -80,26 +84,26 @@ paragraphs. This may not include blank characters. Only closing
punctuation (see \fBpunct\fP), optionally followed by the specified
closing brackets, can end sentences. The default value is "\fB"')>]}\fP".
.TP
.B set/unset casesensitive
.B set casesensitive
Do case-sensitive searches by default.
.TP
.B set/unset const
.B set const
Constantly display the cursor position in the status bar.
.TP
.B set/unset cut
.B set cut
Use cut-to-end-of-line by default, instead of cutting the whole line.
.TP
.B set fill \fIn\fP
Hard-wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the
maximum line length will be the screen width less \fIn\fP columns. The
default value is \-8.
.B set fill \fInumber\fR
Hard-wrap lines at column number \fInumber\fR. If \fInumber\fR is 0 or less,
the maximum line length will be the screen width less \fInumber\fP columns.
The default value is \fB\-8\fR.
.TP
.B set functioncolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the function descriptions
in the two help lines at the bottom of the screen.
See \fBset titlecolor\fR for more details.
.TP
.B set/unset historylog
.B set historylog
Enable the use of \fB~/.nano/search_history\fP for saving and reading
search/replace strings.
.TP
@@ -108,7 +112,7 @@ Specify the color combination to use for the shortcut key combos
in the two help lines at the bottom of the screen.
See \fBset titlecolor\fR for more details.
.TP
.B set/unset locking
.B set locking
Enable vim-style lock-files for when editing files.
.TP
.B set matchbrackets "\fIstring\fP"
@@ -117,32 +121,32 @@ searches. This may not include blank characters. The opening set must
come before the closing set, and the two sets must be in the same order.
The default value is "\fB(<[{)>]}\fP".
.TP
.B set/unset morespace
.B set morespace
Use the blank line below the titlebar as extra editing space.
.TP
.B set/unset mouse
.B set mouse
Enable mouse support, if available for your system. When enabled, mouse
clicks can be used to place the cursor, set the mark (with a double
click), and execute shortcuts. The mouse will work in the X Window
System, and on the console when gpm is running. Text can still be
selected through dragging by holding down the Shift key.
.TP
.B set/unset multibuffer
.B set multibuffer
Allow inserting files into their own buffers.
.TP
.B set/unset noconvert
.B set noconvert
Don't convert files from DOS/Mac format.
.TP
.B set/unset nofollow
.B set nofollow
Don't follow symlinks when writing files.
.TP
.B set/unset nohelp
.B set nohelp
Don't display the two help lines at the bottom of the screen.
.TP
.B set/unset nonewlines
.B set nonewlines
Don't automatically add a newline to the ends of files.
.TP
.B set/unset nowrap
.B set nowrap
Don't hard-wrap text at all.
.TP
.B set operatingdir "\fIdirectory\fP"
@@ -151,10 +155,10 @@ subdirectories. Also, the current directory is changed to here, so
files are inserted from this directory. By default, the operating
directory feature is turned off.
.TP
.B set/unset poslog
.B set poslog
Save the cursor position of files between editing sessions.
.TP
.B set/unset preserve
.B set preserve
Preserve the XON and XOFF keys (^Q and ^S).
.TP
.B set punct "\fIstring\fP"
@@ -163,11 +167,11 @@ paragraphs. This may not include blank characters. Only the
specfified closing punctuation, optionally followed by closing brackets
(see \fBbrackets\fP), can end sentences. The default value is "\fB!.?\fP".
.TP
.B set/unset quickblank
.B set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
.TP
.B set/unset quiet
.B set quiet
\fBnano\fP will not report errors in the \fInanorc\fP file nor ask them
to be acknowledged by pressing Enter at startup. If this is used, it
should be placed at the top of the file to be fully effective.
@@ -180,30 +184,30 @@ otherwise a literal string. The default value is
support, and "\fB>\ \fP" otherwise. Note that '\\t' stands for a literal
Tab character.
.TP
.B set/unset rebinddelete
.B set rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
.TP
.B set/unset rebindkeypad
.B set rebindkeypad
Interpret the numeric keypad keys so that they all work properly. You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
.TP
.B set/unset regexp
.B set regexp
Do extended regular expression searches by default.
.TP
.B set/unset smarthome
.B set smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
.TP
.B set/unset smooth
.B set smooth
Use smooth scrolling by default.
.TP
.B set/unset softwrap
.B set softwrap
Enable soft line wrapping for easier viewing of very long lines.
.TP
.B set speller "\fIspellprog\fP"
@@ -214,17 +218,17 @@ calls \fIspell\fP.
Specify the color combination to use for the statusbar.
See \fBset titlecolor\fR for more details.
.TP
.B set/unset suspend
.B set suspend
Allow \fBnano\fP to be suspended.
.TP
.B set tabsize \fIn\fP
Use a tab size of \fIn\fP columns. The value of \fIn\fP must be greater
than 0. The default value is 8.
.B set tabsize \fInumber\fR
Use a tab size of \fInumber\fR columns. The value of \fInumber\fP must be
greater than 0. The default value is \fB8\fR.
.TP
.B set/unset tabstospaces
.B set tabstospaces
Convert typed tabs to spaces.
.TP
.B set/unset tempfile
.B set tempfile
Save automatically on exit, don't prompt.
.TP
.B set titlecolor \fIfgcolor\fR,\fIbgcolor\fR
@@ -233,14 +237,14 @@ Valid color names for foreground and background are:
.BR white , \ black , \ red , \ blue , \ green , \ yellow , \ magenta ", and " cyan .
And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
.TP
.B set/unset view
.B set view
Disallow file modification.
.TP
.B set whitespace "\fIstring\fP"
Set the two characters used to indicate the presence of tabs and
spaces. They must be single-column characters.
.TP
.B set/unset wordbounds
.B set wordbounds
Detect word boundaries more accurately by treating punctuation
characters as parts of words.
@@ -266,6 +270,11 @@ For the currently defined syntax, use the given \fIprogram\fR
to invoke the linter (this overrides the speller function when
defined).
.TP
.BI formatter " program " \fR[ "arg " \fR...]
For the currently defined syntax, use the given \fIprogram\fR
to automatically re-format text, useful in certain programming
languages (e.g. go)
.TP
.BR header " [""\fIregex\fR"" ...]
For the currently defined syntax, add one or more regexes which will
be compared against the very first line of the file to be edited,
@@ -464,7 +473,7 @@ Goes to the last line of the file.
Goes to a specific line (and column if specified).
.TP
.B gototext
Switches from targetting a line number to searching for text.
Switches from targeting a line number to searching for text.
.TP
.B findbracket
Moves the cursor to the bracket (brace, parenthesis, etc.) that matches

View File

@@ -1,7 +1,7 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
.\" Skeleton based on nano-tiny.1:
.\" Copyright (C) 2002 Free Software Foundation, Inc.
.\" $Id$
.\"
.\" Copyright (C) 2002, 2005, 2006, 2007, 2014 Free Software Foundation, Inc.
.\"
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
@@ -19,8 +19,7 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH RNANO 1 "version 2.3.3" "April 2014"
.TH RNANO 1 "version 2.3.7" "August 2014"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
@@ -29,8 +28,7 @@ Pico clone
.SH SYNOPSIS
.B rnano
.RI [ options "] [[\+" line , column "]\ " file "]..."
.br
.RI [ options "] [[+" line , column "]\ " file "]..."
.SH DESCRIPTION
\fBnano\fP is a small, free and friendly editor which aims to replace
@@ -43,7 +41,7 @@ replace" and "go to line and column number".
specific files and doesn't allow the user access to the filesystem or a
command shell.
.PP
In restricted mode, \fBnano\fP will \fInot\fP:
In restricted mode, \fBnano\fP will \fInot\/\fP:
.IP \[bu] 2
read or write to any file not specified on the command line;
.IP \[bu]
@@ -58,14 +56,13 @@ use backup files or spell checking.
.SH OPTIONS
.TP
.B \-h (\-\-help)
Show a summary of command line options and exit.
.BR \-h ", " \-\-help
Show a summary of command-line options and exit.
.TP
.B \-V (\-\-version)
.BR \-V ", " \-\-version
Show the current version number and exit.
.PP
See the \fBnano\fP(1) manpage for the complete documentation of
\fBnano\fP.
See the \fBnano\fP(1) manpage for all of the possible options.
.SH BUGS
Please send any comments or bug reports to \fBnano@nano-editor.org\fP.
@@ -79,7 +76,7 @@ of "subscribe".
http://www.nano-editor.org/
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS for details).
Chris Allegretta <chrisa@asty.org>, et al (see the file AUTHORS for details).
This manual page was originally written by Thijs Kinkhorst
<thijs@kinkhorst.com>, for the Debian system (but may be used by
others).

View File

@@ -165,10 +165,6 @@
## Save automatically on exit; don't prompt.
# set tempfile
## Enable the new (EXPERIMENTAL) generic undo code, not just for line
## cuts.
# set undo
## Disallow file modification. Why would you want this in an rcfile? ;)
# set view

View File

@@ -1,14 +1,14 @@
## Here is an example for apt's sources.list.
syntax "apt/sources.list" "sources\.list(\.old|~)?$"
syntax "apt/sources.list" "sources\.list(\.old|~)?$" "apt/sources\.list\.d/.*\.list$"
# Coloring the deb lines, working from tail to head. First the
# components -- well, everything, and thus also the components.
color brightmagenta "^deb.*"
# Distribution -- well, everything, except the components.
color brightred "^deb(-src)? ((http|ftp|rsh|ssh|file|copy):/[^ ]+|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+"
color brightred "^deb(-src)? ((http(s)?|ftp|rsh|ssh|file|copy|tor|spacewalk):/[^ ]+|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+"
# URIs.
color brightgreen "(http|ftp|rsh|ssh|file|copy):/[^ ]+"
color brightgreen "(http(s)?|ftp|rsh|ssh|file|copy|tor|spacewalk):/[^ ]+"
# CDroms.
color brightgreen "cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/"
# And finally the initial deb tag.

View File

@@ -40,3 +40,6 @@ color brightblue start="/\*" end="\*/"
# Trailing whitespace.
color ,green "[[:space:]]+$"
# Set up the formatter since spelling is probably useless...
formatter gofmt -w

View File

@@ -6,12 +6,12 @@ syntax "nanorc" "\.?nanorc$"
icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|i?color|extendsyntax).*$"
# Keywords
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|poslog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|undo|view|wordbounds)\>"
icolor yellow "^[[:space:]]*set[[:space:]]+(functioncolor|keycolor||statuscolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|poslog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|view|wordbounds)\>"
icolor yellow "^[[:space:]]*set[[:space:]]+(functioncolor|keycolor|statuscolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace)[[:space:]]+"
icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+[[:alpha:]]+[[:space:]]*$"
icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]*$"
icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|linter)[[:space:]]+.*$"
icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|linter|formatter)[[:space:]]+.*$"
icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|extendsyntax)\>"
# Colors

View File

@@ -1,7 +1,7 @@
## Here is an example for Perl.
syntax "perl" "\.p[lm]$"
header "^#!.*/perl[-0-9._]*"
header "^#!.*perl[-0-9._]*"
magic "Perl script text"
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"

View File

@@ -1,7 +1,7 @@
## Here is an example for Python.
syntax "python" "\.py$"
header "^#!.*/python[-0-9._]*"
header "^#!.*python[-0-9._]*"
# Function definitions.
icolor brightblue "def [0-9A-Z_]+"

View File

@@ -1,7 +1,7 @@
## Here is an example for Ruby.
syntax "ruby" "\.rb$"
header "^#!.*/ruby[-0-9._]*"
header "^#!.*ruby[-0-9._]*"
# Asciibetical list of reserved words.
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"

View File

@@ -1,7 +1,7 @@
## Here is an example for Bourne shell scripts.
syntax "sh" "\.sh$"
header "^#!.*/(ba|k|pdk)?sh[-0-9_]*"
header "^#!.*(ba|k|pdk)?sh[-0-9_]*"
magic "(POSIX|Bourne.*) shell script text"
icolor brightgreen "^[0-9A-Z_]+\(\)"

View File

@@ -24,8 +24,8 @@ color yellow start="%__" end="\ "
color magenta start="%\{" end="\}"
color yellow start="%\{__" end="\}"
# Sections.
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|preun|post|postun)"
color red "^%(trigger|triggerin|triggerpostun|triggerun|verifyscript)"
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|pretrans|preun)"
color red "^%(post|posttrans|postun|trigger|triggerin|triggerpostun|triggerun|verifyscript)"
# Conditionals and defines.
color brightred "%(if|else|endif|define|global|undefine)"

View File

@@ -7,9 +7,9 @@
@c This file has the new style title page commands.
@c Run 'makeinfo' rather than 'texinfo-format-buffer'.
@smallbook
@set EDITION 0.2
@set VERSION 2.3.5
@set UPDATED June 2014
@set EDITION 0.3
@set VERSION 2.3.7
@set UPDATED August 2014
@dircategory Editors
@direntry
@@ -23,7 +23,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
@subtitle version 2.3.5
@subtitle version 2.3.7
@author Chris Allegretta
@page
@@ -119,187 +119,226 @@ Email bug reports to @email{nano@@nano-editor.org}.
@node Command Line Options
@section Command Line Options
@code{nano} takes the following options from the command line:
@command{nano} takes the following options from the command line:
@table @code
@item +<line>,<column>
Start at line number <line> and column number <column> (at least one of
@table @option
@item +@var{line},@var{column}
Start at line number @var{line} and column number @var{column} (at least one of
which must be specified) instead of the default of line 1, column 1.
@item -A, --smarthome
@item -A
@itemx --smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
@item -B, --backup
@item -B
@itemx --backup
When saving a file, back up the previous version of it to the current
filename suffixed with a ~.
filename suffixed with a @samp{~}.
@item -C <dir>, --backupdir=<dir>
Set the directory where @code{nano} puts unique backup files if file
@item -C @var{directory}
@itemx --backupdir=@var{directory}
Set the directory where @command{nano} puts unique backup files if file
backups are enabled.
@item -D, --boldtext
@item -D
@itemx --boldtext
Use bold text instead of reverse video text.
@item -E, --tabstospaces
@item -E
@itemx --tabstospaces
Convert typed tabs to spaces.
@item -F, --multibuffer
@item -F
@itemx --multibuffer
Enable multiple file buffers (if support for them has been compiled in).
@item -G, --locking
@item -G
@itemx --locking
Enable vim-style file locking when editing files.
@item -H, --historylog
Log search and replace strings to ~/.nano/search_history, so they can be
retrieved in later sessions.
@item -H
@itemx --historylog
Log search and replace strings to @file{~/.nano/search_history},
so they can be retrieved in later sessions.
@item -I, --ignorercfiles
Don't look at the system's nanorc file nor at the user's ~/.nanorc.
@item -I
@itemx --ignorercfiles
Don't look at the system's nanorc file nor at the user's @file{~/.nanorc}.
@item -K, --rebindkeypad
@item -K
@itemx --rebindkeypad
Interpret the numeric keypad keys so that they all work properly. You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
@item -L, --nonewlines
@item -L
@itemx --nonewlines
Don't add newlines to the ends of files.
@item -N, --noconvert
@item -N
@itemx --noconvert
Disable automatic conversion of files from DOS/Mac format.
@item -O, --morespace
@item -O
@itemx --morespace
Use the blank line below the titlebar as extra editing space.
@item -P, --poslog
@item -P
@itemx --poslog
Log for each file the last location of the cursor, and read it
back upon reopening the file and place it there again.
@item -Q <str>, --quotestr=<str>
@item -Q "@var{characters}"
@itemx --quotestr="@var{characters}"
Set the quoting string for justifying. The default value is
@quotation
@code{^([ \t]*[|>:@}#])+}
"^([ \t]*[|>:@}#])+"
@end quotation
if extended regular expression support is available, or "> " otherwise.
if extended regular expression support is available, or @code{> } otherwise.
Note that @code{\t} above stands for a literal Tab character.
@item -R, --restricted
@item -R
@itemx --restricted
Restricted mode: don't read or write to any file not specified on the
command line; don't read any nanorc files nor history files; don't allow
suspending nor spell checking; don't
allow a file to be appended to, prepended to, or saved under a different
name if it already has one; and don't use backup files.
This restricted mode is also accessible by invoking @code{nano} with
any name beginning with 'r' (e.g. "rnano").
This restricted mode is also accessible by invoking @command{nano} with
any name beginning with @samp{r} (e.g. @command{rnano}).
@item -S, --smooth
@item -S
@itemx --smooth
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
@item -T <number>, --tabsize=<number>
Set the displayed tab length to <number> columns. The value of <number>
must be greater than 0. The default value is 8.
@item -T @var{number}
@itemx --tabsize=@var{number}
Set the displayed tab length to @var{number} columns. The value of
@var{number} must be greater than 0. The default value is @samp{8}.
@item -U, --quickblank
@item -U
@itemx --quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25. Note that -c overrides this.
keystroke instead of 25. Note that @option{-c} overrides this.
@item -V, --version
@item -V
@itemx --version
Show the current version number and exit.
@item -W, --wordbounds
@item -W
@itemx --wordbounds
Detect word boundaries more accurately by treating punctuation
characters as parts of words.
@item -Y <name>, --syntax=<name>
@item -Y @var{name}
@itemx --syntax=@var{name}
Specify a specific syntax from the nanorc files to use for highlighting.
See @xref{Syntax Highlighting}, for more info.
@item -c, --const
@item -c
@itemx --const
Constantly display the cursor position and line number on the statusbar.
Note that this overrides -U.
Note that this overrides @option{-U}.
@item -d, --rebinddelete
@item -d
@itemx --rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
@item -h, --help
@item -h
@itemx --help
Show a summary of command-line options and exit.
@item -i, --autoindent
@item -i
@itemx --autoindent
Automatically indent new lines to the same number of spaces and tabs as
the previous line.
@item -k, --cut
@item -k
@itemx --cut
Make the 'Cut Text' command (normally ^K) cut from the current cursor
position to the end of the line, instead of cutting the entire line.
@item -l, --nofollow
@item -l
@itemx --nofollow
When writing files, if the given file is a symbolic link, it is removed
and a new file is created.
@item -m, --mouse
@item -m
@itemx --mouse
Enable mouse support, if available for your system. When enabled, mouse
clicks can be used to place the cursor, set the mark (with a double
click), and execute shortcuts. The mouse will work in the X Window
System, and on the console when gpm is running. Text can still be
selected through dragging by holding down the Shift key.
@item -n, --noread
@item -n
@itemx --noread
Treat any name given on the command line as a new file. This allows
@code{nano} to write to named pipes: it will start with a blank buffer,
@command{nano} to write to named pipes: it will start with a blank buffer,
and will write to the pipe when the user saves the "file". This way
@code{nano} can be used as an editor in combination with for instance
@code{gpg} without having to write sensitive data to disk first.
@command{nano} can be used as an editor in combination with for instance
@command{gpg} without having to write sensitive data to disk first.
@item -o <dir>, --operatingdir=<dir>
Set operating directory. Makes @code{nano} set up something similar to
a chroot.
@item -o @var{directory}
@itemx --operatingdir=@var{directory}
Set the operating directory. This makes @command{nano} set up something
similar to a chroot.
@item -p, --preserve
@item -p
@itemx --preserve
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
editor can be stopped and started.
@item -q, --quiet
@item -q
@itemx --quiet
Do not report errors in the nanorc file nor ask them to be acknowledged
by pressing Enter at startup.
@item -r <number>, --fill=<number>
Hard-wrap lines at column <number> (by inserting a newline character).
@item -r @var{number}
@itemx --fill=@var{number}
Hard-wrap lines at column @var{number} (by inserting a newline character).
If the given value is 0 or less, wrapping will occur at the width of
the screen minus the given amount, allowing the wrapping width to
vary along with the width of the screen if and when it is resized.
The default value is -8. This option conflicts with -w -- the last
one given takes effect.
The default value is @samp{-8}. This option conflicts with @option{-w}
-- the last one given takes effect.
@item -s <program>, --speller=<program>
Invoke the given program as the spell checker. By default, @code{nano}
uses the command specified in the SPELL environment variable, or, if
SPELL is not set, its own interactive spell checker that requires the
@code{spell} program to be installed on your system.
@item -s @var{program}
@itemx --speller=@var{program}
Invoke the given program as the spell checker. By default, @command{nano}
uses the command specified in the @env{SPELL} environment variable, or,
if @env{SPELL} is not set, its own interactive spell checker that requires
the @command{spell} program to be installed on your system.
@item -t, --tempfile
@item -t
@itemx --tempfile
Don't ask whether or not to save the current contents of the file when
exiting, assume yes. This is most useful when using @code{nano} as the
exiting, assume yes. This is most useful when using @command{nano} as the
composer of a mailer program.
@item -v, --view
@item -v
@itemx --view
Don't allow the contents of the file to be altered. Note that this
option should NOT be used in place of correct file permissions to
implement a read-only file.
@item -w, --nowrap
@item -w
@itemx --nowrap
Don't hard-wrap long lines at any length. This option conflicts with
-r -- the last one given takes effect.
@option{-r} -- the last one given takes effect.
@anchor{Expert Mode}
@item -x, --nohelp
@item -x
@itemx --nohelp
Expert Mode: don't show the Shortcut Lists at the bottom of the screen.
This affects the location of the statusbar as well, as in Expert Mode it
is located at the very bottom of the editor.
@@ -307,19 +346,26 @@ is located at the very bottom of the editor.
Note: When accessing the help system, Expert Mode is temporarily
disabled to display the help-system navigation keys.
@item -z, --suspend
Enable the ability to suspend @code{nano} using the system's suspend
@item -z
@itemx --suspend
Enable the ability to suspend @command{nano} using the system's suspend
keystroke (usually ^Z).
@item -$, --softwrap
Enable 'soft wrapping'. This will make @code{nano} attempt to display the
@item -$
@itemx --softwrap
Enable 'soft wrapping'. This will make @command{nano} attempt to display the
entire contents of any line, even if it is longer than the screen width, by
continuing it over multiple screen lines. Since
'$' normally refers to a variable in the Unix shell, you should specify
@samp{$} normally refers to a variable in the Unix shell, you should specify
this option last when using other options (e.g. @code{nano -wS$}) or pass it
separately (e.g. @code{nano -wS -$}).
@item -a, -b, -e, -f, -g, -j
@item -a
@itemx -b
@itemx -e
@itemx -f
@itemx -g
@itemx -j
Ignored, for compatibility with Pico.
@end table
@@ -532,8 +578,11 @@ and to rebind keys -- @xref{Syntax Highlighting}, and @xref{Rebinding Keys}.
@code{nano} will read one command per line.
Options in nanorc files take precedence over @code{nano}'s defaults, and
command-line options override nanorc settings. Options are also unset
by default, except for those that take arguments.
command-line options override nanorc settings. Also, options that do not
take an argument are unset by default. So using the @code{unset} command
is only needed when wanting to override a setting of the system's nanorc
file in your own @file{~/.nanorc}. Options that take an argument cannot
be unset.
Quotes inside string parameters don't have to be escaped with
backslashes. The last double quote in the string will be treated as its
@@ -553,15 +602,15 @@ The supported settings in a nanorc file are:
@table @code
@item set/unset allow_insecure_backup
@item set allow_insecure_backup
When backing up files, allow the backup to succeed even if its
permissions can't be (re)set due to special OS considerations.
You should NOT enable this option unless you are sure you need it.
@item set/unset autoindent
@item set autoindent
Use auto-indentation.
@item set/unset backup
@item set backup
When saving a file, back up the previous version of it to the current
filename suffixed with a tilde (@code{~}).
@@ -569,88 +618,88 @@ filename suffixed with a tilde (@code{~}).
Set the directory where @code{nano} puts unique backup files, if file
backups are enabled.
@item set/unset backwards
@item set backwards
Do backwards searches by default.
@item set/unset boldtext
@item set boldtext
Use bold instead of reverse video for the titlebar, statusbar, key combos,
and selected text. This can be overridden for the first three by setting
the options "titlecolor", "statuscolor", and "keycolor".
@item set brackets "string"
@item set brackets "@var{string}"
Set the characters treated as closing brackets when justifying
paragraphs. This may not include blank characters. Only closing
punctuation (see "punct"), optionally followed by the specified
closing brackets, can end sentences. The default value is
@quotation
@code{""')>]@}"}
""')>]@}"
@end quotation
@item set/unset casesensitive
@item set casesensitive
Do case-sensitive searches by default.
@item set/unset const
@item set const
Constantly display the cursor position in the status bar.
@item set/unset cut
@item set cut
Use cut-to-end-of-line by default, instead of cutting the whole line.
@item set fill "n"
Hard-wrap lines at column number "n". If "n" is 0 or less, the maximum line
length will be the screen width less "n" columns. The default value is
-8.
@item set fill @var{number}
Hard-wrap lines at column number @var{number}. If @var{number} is 0 or less,
the maximum line length will be the screen width less @var{number} columns.
The default value is -8.
@item set functioncolor fgcolor,bgcolor
@item set functioncolor @var{fgcolor},@var{bgcolor}
Specify the color combination to use for the function descriptions
in the two help lines at the bottom of the screen.
See "set titlecolor" for more details.
See @code{set titlecolor} for more details.
@item set/unset historylog
Enable the use of ~/.nano/search_history for saving and reading
@item set historylog
Enable the use of @file{~/.nano/search_history} for saving and reading
search/replace strings.
@item set keycolor fgcolor,bgcolor
@item set keycolor @var{fgcolor},@var{bgcolor}
Specify the color combination to use for the shortcut key combos
in the two help lines at the bottom of the screen.
See "set titlecolor" for more details.
See @code{set titlecolor} for more details.
@item set/unset locking
@item set locking
Enable vim-style lock-files for when editing files.
@item set matchbrackets "string"
@item set matchbrackets "@var{string}"
Set the opening and closing brackets that can be found by bracket
searches. This may not include blank characters. The opening set must
come before the closing set, and the two sets must be in the same order.
The default value is
@quotation
@code{"(<[@{)>]@}"}
"(<[@{)>]@}"
@end quotation
@item set/unset morespace
@item set morespace
Use the blank line below the titlebar as extra editing space.
@item set/unset mouse
@item set mouse
Enable mouse support, so that mouse clicks can be used to place the
cursor, set the mark (with a double click), or execute shortcuts.
@item set/unset multibuffer
@item set multibuffer
Allow inserting files into their own buffers.
@item set/unset noconvert
@item set noconvert
Don't convert files from DOS/Mac format.
@item set/unset nofollow
@item set nofollow
Don't follow symlinks when writing files.
@item set/unset nohelp
@item set nohelp
Don't display the help lists at the bottom of the screen.
@item set/unset nonewlines
@item set nonewlines
Don't add newlines to the ends of files.
@item set/unset nowrap
@item set nowrap
Don't hard-wrap text at all.
@item set operatingdir "directory"
@@ -659,102 +708,102 @@ subdirectories. Also, the current directory is changed to here, so
files are inserted from this directory. By default, the operating
directory feature is turned off.
@item set/unset poslog
@item set poslog
Save the cursor position of files between editing sessions.
@item set/unset preserve
@item set preserve
Preserve the XON and XOFF keys (^Q and ^S).
@item set punct "string"
@item set punct "@var{string}"
Set the characters treated as closing punctuation when justifying
paragraphs. This may not include blank characters. Only the
specified closing punctuation, optionally followed by closing brackets
(see "brackets"), can end sentences. The default value is @code{"!.?"}.
(see "brackets"), can end sentences. The default value is "!.?".
@item set/unset quickblank
@item set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
@item set/unset quiet
@item set quiet
When set, @code{nano} will not report errors in the nanorc file nor ask them
to be acknowledged by pressing Enter at startup. If this option is used, it
should be placed at the top of the file to be fully effective.
@item set quotestr "string"
@item set quotestr "@var{string}"
The email-quote string, used to justify email-quoted paragraphs. This
is an extended regular expression if your system supports them,
otherwise a literal string. The default value is
@quotation
@code{"^([ \\t]*[#:>\\|@}])+"}
"^([ \\t]*[#:>\\|@}])+"
@end quotation
if you have extended regular expression support, and "> " otherwise.
Note that '\\t' stands for a literal Tab character.
@item set/unset rebinddelete
@item set rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
@item set/unset rebindkeypad
@item set rebindkeypad
Interpret the numeric keypad keys so that they all work properly. You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
@item set/unset regexp
@item set regexp
Do extended regular expression searches by default.
@item set/unset smarthome
@item set smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
@item set/unset smooth
@item set smooth
Use smooth scrolling by default.
@item set/unset softwrap
@item set softwrap
Enable soft line wrapping for easier viewing of very long lines.
@item set speller "spellprog"
Use spelling checker "spellprog" instead of the built-in one, which
calls "spell".
@item set statuscolor fgcolor,bgcolor
@item set statuscolor @var{fgcolor},@var{bgcolor}
Specify the color combination to use for the statusbar.
See "set titlecolor" for more details.
See @code{set titlecolor} for more details.
@item set/unset suspend
@item set suspend
Allow @code{nano} to be suspended.
@item set tabsize "n"
Use a tab size of "n" columns. The value of "n" must be greater than 0.
The default value is 8.
@item set tabsize @var{number}
Use a tab size of @var{number} columns. The value of @var{number} must be
greater than 0. The default value is 8.
@item set/unset tabstospaces
@item set tabstospaces
Convert typed tabs to spaces.
@item set/unset tempfile
@item set tempfile
Save automatically on exit, don't prompt.
@item set titlecolor fgcolor,bgcolor
@item set titlecolor @var{fgcolor},@var{bgcolor}
Specify the color combination to use for the titlebar.
Valid color names for foreground and background are:
white, black, red, blue, green, yellow, magenta, and cyan.
And either "fgcolor" or ",bgcolor" may be left out.
And either @var{fgcolor} or @var{,bgcolor} may be left out.
@item set/unset view
@item set view
Disallow file modification.
@anchor{Whitespace}
@item set whitespace "string"
@item set whitespace "@var{string}"
Set the two characters used to indicate the presence of tabs and
spaces. They must be single-column characters. The default pair
for a UTF-8 locale is "»·", and for other locales ">.".
@item set/unset wordbounds
@item set wordbounds
Detect word boundaries more accurately by treating punctuation
characters as part of a word.
@@ -989,7 +1038,7 @@ Goes to the last line of the file.
Goes to a specific line (and column if specified).
@item gototext
Switches from targetting a line number to searching for text.
Switches from targeting a line number to searching for text.
@item findbracket
Moves the cursor to the bracket (brace, parenthesis, etc.) that matches

843
po/bg.po

File diff suppressed because it is too large Load Diff

1088
po/ca.po

File diff suppressed because it is too large Load Diff

1142
po/cs.po

File diff suppressed because it is too large Load Diff

853
po/da.po

File diff suppressed because it is too large Load Diff

1813
po/de.po

File diff suppressed because it is too large Load Diff

897
po/eo.po

File diff suppressed because it is too large Load Diff

857
po/es.po

File diff suppressed because it is too large Load Diff

843
po/eu.po

File diff suppressed because it is too large Load Diff

879
po/fi.po

File diff suppressed because it is too large Load Diff

897
po/fr.po

File diff suppressed because it is too large Load Diff

843
po/ga.po

File diff suppressed because it is too large Load Diff

846
po/gl.po

File diff suppressed because it is too large Load Diff

845
po/hu.po

File diff suppressed because it is too large Load Diff

850
po/id.po

File diff suppressed because it is too large Load Diff

851
po/it.po

File diff suppressed because it is too large Load Diff

844
po/ja.po

File diff suppressed because it is too large Load Diff

843
po/ms.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1016
po/nb.po

File diff suppressed because it is too large Load Diff

880
po/nl.po

File diff suppressed because it is too large Load Diff

849
po/nn.po

File diff suppressed because it is too large Load Diff

1103
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

847
po/ro.po

File diff suppressed because it is too large Load Diff

849
po/ru.po

File diff suppressed because it is too large Load Diff

847
po/sl.po

File diff suppressed because it is too large Load Diff

882
po/sr.po

File diff suppressed because it is too large Load Diff

2016
po/sv.po

File diff suppressed because it is too large Load Diff

850
po/tr.po

File diff suppressed because it is too large Load Diff

878
po/uk.po

File diff suppressed because it is too large Load Diff

900
po/vi.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -268,12 +268,12 @@ char *do_browser(char *path, DIR *dir)
} else if (func == do_up_void) {
if (selected >= width)
selected -= width;
} else if (func == do_left) {
if (selected > 0)
selected--;
} else if (func == do_down_void) {
if (selected + width <= filelist_len - 1)
selected += width;
} else if (func == do_left) {
if (selected > 0)
selected--;
} else if (func == do_right) {
if (selected < filelist_len - 1)
selected++;
@@ -581,8 +581,7 @@ void browser_refresh(void)
/* The maximum length of the file information in
* columns: seven for "--", "(dir)", or the file size,
* and 12 for "(parent dir)". */
bool dots = (COLS >= 15 && filetaillen >= longest -
foomaxlen - 1);
bool dots = (COLS >= 15 && filetaillen >= longest - foomaxlen - 1);
/* Do we put an ellipsis before the filename? Don't set
* this to TRUE if we have fewer than 15 columns (i.e.
* one column for padding, plus seven columns for a

View File

@@ -219,10 +219,9 @@ void do_cut_text(
/* Leave the text in the cutbuffer, and mark the file as
* modified. */
if (!copy_text) {
set_modified();
}
if (!copy_text)
#endif /* !NANO_TINY */
set_modified();
/* Update the screen. */
edit_refresh_needed = TRUE;

View File

@@ -126,6 +126,7 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
pid_t mypid;
uid_t myuid;
struct passwd *mypwuid;
struct stat fileinfo;
char *lockdata = charalloc(1024);
char myhostname[32];
ssize_t lockdatalen = 1024;
@@ -141,12 +142,14 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
mypid = getpid();
if (gethostname(myhostname, 31) < 0) {
statusbar(_("Couldn't determine hosttname for lock file: %s"), strerror(errno));
statusbar(_("Couldn't determine hostname for lock file: %s"), strerror(errno));
return -1;
}
if (delete_lockfile(lockfilename) < 0)
return -1;
/* Check if the lock exists before we try to delete it...*/
if (stat(lockfilename, &fileinfo) != -1)
if (delete_lockfile(lockfilename) < 0)
return -1;
if (ISSET(INSECURE_BACKUP))
cflags = O_WRONLY | O_CREAT | O_APPEND;
@@ -156,11 +159,13 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
fd = open(lockfilename, cflags,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
/* Maybe we just don't have write access. Don't stop us from
* opening the file at all, just don't set the lock_filename and
* return success. */
if (fd < 0 && errno == EACCES)
return 1;
/* Maybe we just don't have write access. Print an error message
and continue. */
if (fd < 0) {
statusbar(_("Error writing lock file %s: %s"), lockfilename,
strerror(errno));
return 0;
}
/* Now we've got a safe file stream. If the previous open() call
* failed, this will return NULL. */
@@ -190,12 +195,12 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
* our lockfile' message in here...
*
* This is likely very wrong, so this is a WIP. */
null_at(&lockdata, lockdatalen);
memset(lockdata, 0, lockdatalen);
lockdata[0] = 0x62;
lockdata[1] = 0x30;
lockdata[24] = mypid % 256;
lockdata[25] = mypid / 256;
snprintf(&lockdata[2], 10, "nano %s", VERSION);
snprintf(&lockdata[2], 11, "nano %s", VERSION);
strncpy(&lockdata[28], mypwuid->pw_name, 16);
strncpy(&lockdata[68], myhostname, 31);
strncpy(&lockdata[108], origfilename, 768);
@@ -229,8 +234,8 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
int delete_lockfile(const char *lockfilename)
{
if (unlink(lockfilename) < 0 && errno != ENOENT) {
statusbar(_("Error deleting lock file %s: %s"), lockfilename,
strerror(errno));
statusbar(_("Error deleting lock file %s: %s"), lockfilename,
strerror(errno));
return -1;
}
return 1;
@@ -248,7 +253,7 @@ int do_lockfile(const char *filename)
+ strlen(locking_suffix) + 3;
char *lockfilename = charalloc(lockfilesize);
char *lockfiledir = NULL;
char lockprog[12], lockuser[16];
static char lockprog[11], lockuser[17];
struct stat fileinfo;
int lockfd, lockpid;
@@ -279,7 +284,7 @@ int do_lockfile(const char *filename)
return -1;
}
strncpy(lockprog, &lockbuf[2], 10);
lockpid = lockbuf[25] * 256 + lockbuf[24];
lockpid = (unsigned char)lockbuf[25] * 256 + (unsigned char)lockbuf[24];
strncpy(lockuser, &lockbuf[28], 16);
#ifdef DEBUG
fprintf(stderr, "lockpid = %d\n", lockpid);
@@ -288,7 +293,7 @@ int do_lockfile(const char *filename)
fprintf(stderr, "user which created this lock file should be %s\n",
lockuser);
#endif
sprintf(promptstr, "File being edited (by %s, PID %d, user %s), continue?",
sprintf(promptstr, _("File is being edited (by %s, PID %d, user %s); continue?"),
lockprog, lockpid, lockuser);
ans = do_yesno_prompt(FALSE, promptstr);
if (ans < 1) {
@@ -314,6 +319,7 @@ int do_lockfile(const char *filename)
* necessary, and then open and read the file, if applicable. */
void open_buffer(const char *filename, bool undoable)
{
bool quiet = FALSE;
bool new_buffer = (openfile == NULL
#ifndef DISABLE_MULTIBUFFER
|| ISSET(MULTIBUFFER)
@@ -337,13 +343,31 @@ void open_buffer(const char *filename, bool undoable)
/* If we're loading into a new buffer, add a new entry to
* openfile. */
if (new_buffer)
if (new_buffer) {
make_new_buffer();
#ifndef NANO_TINY
if (ISSET(LOCKING) && filename[0] != '\0') {
int lockstatus = do_lockfile(filename);
if (lockstatus < 0) {
#ifndef DISABLE_MULTIBUFFER
if (openfile->next) {
close_buffer(TRUE);
return;
}
#endif
} else if (lockstatus == 0) {
quiet = TRUE;
}
}
#endif
}
/* If the filename isn't blank, and we are not in NOREAD_MODE,
* open the file. Otherwise, treat it as a new file. */
rc = (filename[0] != '\0' && !ISSET(NOREAD_MODE)) ?
open_file(filename, new_buffer, &f) : -2;
open_file(filename, new_buffer, quiet, &f) : -2;
/* If we have a file, and we're loading into a new buffer, update
* the filename. */
@@ -395,7 +419,7 @@ void replace_buffer(const char *filename)
/* If the filename isn't blank, open the file. Otherwise, treat it
* as a new file. */
rc = (filename[0] != '\0') ? open_file(filename, TRUE, &f) : -2;
rc = (filename[0] != '\0') ? open_file(filename, TRUE, FALSE, &f) : -2;
/* Reinitialize the text of the current buffer. */
free_filestruct(openfile->fileage);
@@ -431,14 +455,15 @@ void display_buffer(void)
#ifndef DISABLE_MULTIBUFFER
/* Switch to the next file buffer if next_buf is TRUE. Otherwise,
* switch to the previous file buffer. */
void switch_to_prevnext_buffer(bool next_buf)
void switch_to_prevnext_buffer(bool next_buf, bool quiet)
{
assert(openfile != NULL);
/* If only one file buffer is open, indicate it on the statusbar and
* get out. */
if (openfile == openfile->next) {
statusbar(_("No more open file buffers"));
if (quiet == FALSE)
statusbar(_("No more open file buffers"));
return;
}
@@ -454,9 +479,10 @@ void switch_to_prevnext_buffer(bool next_buf)
display_buffer();
/* Indicate the switch on the statusbar. */
statusbar(_("Switched to %s"),
((openfile->filename[0] == '\0') ? _("New Buffer") :
openfile->filename));
if (quiet == FALSE)
statusbar(_("Switched to %s"),
((openfile->filename[0] == '\0') ? _("New Buffer") :
openfile->filename));
#ifdef DEBUG
dump_filestruct(openfile->current);
@@ -467,19 +493,21 @@ void switch_to_prevnext_buffer(bool next_buf)
/* Switch to the previous entry in the openfile filebuffer. */
void switch_to_prev_buffer_void(void)
{
switch_to_prevnext_buffer(FALSE);
switch_to_prevnext_buffer(FALSE, FALSE);
}
/* Switch to the next entry in the openfile filebuffer. */
void switch_to_next_buffer_void(void)
{
switch_to_prevnext_buffer(TRUE);
switch_to_prevnext_buffer(TRUE, FALSE);
}
/* Delete an entry from the openfile filebuffer, and switch to the one
* after it. Return TRUE on success, or FALSE if there are no more open
* file buffers. */
bool close_buffer(void)
* file buffers.
* quiet - should we print messages switching bufers
*/
bool close_buffer(bool quiet)
{
assert(openfile != NULL);
@@ -492,7 +520,7 @@ bool close_buffer(void)
#endif
/* Switch to the next file buffer. */
switch_to_next_buffer_void();
switch_to_prevnext_buffer(TRUE, quiet);
/* Close the file buffer we had open before. */
unlink_opennode(openfile->prev);
@@ -888,10 +916,10 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable, bool checkw
* Return -2 if we say "New File", -1 if the file isn't opened, and the
* fd opened otherwise. The file might still have an error while reading
* with a 0 return value. *f is set to the opened file. */
int open_file(const char *filename, bool newfie, FILE **f)
int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
{
struct stat fileinfo, fileinfo2;
int fd, quiet = 0;
int fd;
char *full_filename;
assert(filename != NULL && f != NULL);
@@ -906,16 +934,6 @@ int open_file(const char *filename, bool newfie, FILE **f)
full_filename = mallocstrcpy(NULL, filename);
#ifndef NANO_TINY
if (ISSET(LOCKING)) {
int lockstatus = do_lockfile(full_filename);
if (lockstatus < 0)
return -1;
else if (lockstatus == 0)
quiet = 1;
}
#endif
if (stat(full_filename, &fileinfo) == -1) {
/* Well, maybe we can open the file even if the OS says it's
* not there. */
@@ -1026,7 +1044,6 @@ void do_insertfile(
size_t current_x_save = openfile->current_x;
ssize_t current_y_save = openfile->current_y;
bool edittop_inside = FALSE;
const sc *s;
#ifndef NANO_TINY
bool right_side_up = FALSE, single_line = FALSE;
#endif
@@ -1084,14 +1101,13 @@ void do_insertfile(
break;
} else {
size_t pww_save = openfile->placewewant;
functionptrtype func = func_from_key(&i);
ans = mallocstrcpy(ans, answer);
s = get_shortcut(&i);
#ifndef NANO_TINY
#ifndef DISABLE_MULTIBUFFER
if (s && s->scfunc == new_buffer_void) {
if (func == new_buffer_void) {
/* Don't allow toggling if we're in view mode. */
if (!ISSET(VIEW_MODE))
TOGGLE(MULTIBUFFER);
@@ -1100,14 +1116,14 @@ void do_insertfile(
continue;
}
#endif
if (s && s->scfunc == flip_execute_void) {
if (func == flip_execute_void) {
execute = !execute;
continue;
}
#endif /* !NANO_TINY */
#ifndef DISABLE_BROWSER
if (s && s->scfunc == to_files_void) {
if (func == to_files_void) {
char *tmp = do_browse_from(answer);
if (tmp == NULL)
@@ -1131,18 +1147,18 @@ void do_insertfile(
continue;
#ifndef NANO_TINY
/* Keep track of whether the mark begins inside the
* partition and will need adjustment. */
if (openfile->mark_set) {
filestruct *top, *bot;
size_t top_x, bot_x;
/* Keep track of whether the mark begins inside the
* partition and will need adjustment. */
if (openfile->mark_set) {
filestruct *top, *bot;
size_t top_x, bot_x;
mark_order((const filestruct **)&top, &top_x,
mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x,
&right_side_up);
single_line = (top == bot);
}
single_line = (top == bot);
}
#endif
#ifndef DISABLE_MULTIBUFFER
@@ -2234,7 +2250,6 @@ bool do_writeout(bool exiting)
static bool did_credits = FALSE;
#endif
bool retval = FALSE;
const sc *s;
currmenu = MWRITEFILE;
@@ -2306,11 +2321,12 @@ bool do_writeout(bool exiting)
retval = FALSE;
break;
} else {
functionptrtype func = func_from_key(&i);
ans = mallocstrcpy(ans, answer);
s = get_shortcut(&i);
#ifndef DISABLE_BROWSER
if (s && s->scfunc == to_files_void) {
if (func == to_files_void) {
char *tmp = do_browse_from(answer);
if (tmp == NULL)
@@ -2322,26 +2338,26 @@ bool do_writeout(bool exiting)
} else
#endif /* !DISABLE_BROWSER */
#ifndef NANO_TINY
if (s && s->scfunc == dos_format_void) {
if (func == dos_format_void) {
openfile->fmt = (openfile->fmt == DOS_FILE) ? NIX_FILE :
DOS_FILE;
continue;
} else if (s && s->scfunc == mac_format_void) {
} else if (func == mac_format_void) {
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE :
MAC_FILE;
continue;
} else if (s && s->scfunc == backup_file_void) {
} else if (func == backup_file_void) {
TOGGLE(BACKUP_FILE);
continue;
} else
#endif /* !NANO_TINY */
if (s && s->scfunc == prepend_void) {
if (func == prepend_void) {
append = (append == PREPEND) ? OVERWRITE : PREPEND;
continue;
} else if (s && s->scfunc == append_void) {
} else if (func == append_void) {
append = (append == APPEND) ? OVERWRITE : APPEND;
continue;
} else if (s && s->scfunc == do_help_void) {
} else if (func == do_help_void) {
continue;
}

View File

@@ -285,21 +285,7 @@ void flip_execute_void(void)
{
}
/* Set the type of command key based on the string. */
key_type strtokeytype(const char *str)
{
if (str[0] == '^')
return CONTROL;
else if (str[0] == 'M')
return META;
else if (str[0] == 'F')
return FKEY;
else
return RAWINPUT;
}
/* Add a string to the function list struct.
* Does not allow updates, not yet anyway. */
/* Add a function to the function list. */
void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help,
bool blank_after, bool viewok)
{
@@ -326,54 +312,26 @@ void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *h
#endif
}
/* Return the first shortcut in the list of shortcuts that
* matches the given func in the given menu. */
const sc *first_sc_for(int menu, void (*func)(void))
{
const sc *s;
for (s = sclist; s != NULL; s = s->next)
if ((s->menu & menu) && s->scfunc == func)
return s;
#ifdef DEBUG
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long)func, menu);
#endif
/* Otherwise... */
return NULL;
}
/* Add a string to the shortcut list.
* Allows updates to existing entries in the list. */
/* Add a key combo to the shortcut list. */
void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggle)
{
sc *s;
static sc *tailsc;
sc *s = (sc *)nmalloc(sizeof(sc));
if (sclist == NULL) {
sclist = (sc *)nmalloc(sizeof(sc));
s = sclist;
s->next = NULL;
} else {
for (s = sclist; s->next != NULL; s = s->next)
if (s->menu == menu && s->keystr == scstring)
break;
/* Start the list, or tack on the next item. */
if (sclist == NULL)
sclist = s;
else
tailsc->next = s;
tailsc = s;
s->next = NULL;
if (s->menu != menu || s->keystr != scstring) { /* i.e. this is not a replace... */
#ifdef DEBUG
fprintf(stderr, "No match found...\n");
#endif
s->next = (sc *)nmalloc(sizeof(sc));
s = s->next;
s->next = NULL;
}
}
s->type = strtokeytype(scstring);
/* Fill in the data. */
s->menu = menu;
s->scfunc = func;
s->toggle = toggle;
s->keystr = (char *) scstring;
s->scfunc = func;
s->type = strtokeytype(scstring);
assign_keyinfo(s);
#ifdef DEBUG
@@ -391,6 +349,23 @@ void replace_scs_for(void (*oldfunc)(void), void (*newfunc)(void))
s->scfunc = newfunc;
}
/* Return the first shortcut in the list of shortcuts that
* matches the given func in the given menu. */
const sc *first_sc_for(int menu, void (*func)(void))
{
const sc *s;
for (s = sclist; s != NULL; s = s->next)
if ((s->menu & menu) && s->scfunc == func)
return s;
#ifdef DEBUG
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long)func, menu);
#endif
/* Otherwise... */
return NULL;
}
/* Return the given menu's first shortcut sequence, or the default value
* (2nd arg). Assumes currmenu for the menu to check. */
int sc_seq_or(void (*func)(void), int defaultval)
@@ -416,6 +391,19 @@ functionptrtype func_from_key(int *kbinput)
return NULL;
}
/* Return the type of command key based on the given string. */
key_type strtokeytype(const char *str)
{
if (str[0] == '^')
return CONTROL;
else if (str[0] == 'M')
return META;
else if (str[0] == 'F')
return FKEY;
else
return RAWINPUT;
}
/* Assign the info to the shortcut struct.
* Assumes keystr is already assigned, naturally. */
void assign_keyinfo(sc *s)
@@ -651,6 +639,7 @@ void shortcut_init(void)
const char *nano_lint_msg = N_("Invoke the linter, if available");
const char *nano_prevlint_msg = N_("Go to previous linter msg");
const char *nano_nextlint_msg = N_("Go to next linter msg");
const char *nano_formatter_msg = N_("Invoke formatter, if available");
#endif
#endif /* !DISABLE_HELP */
@@ -747,6 +736,8 @@ void shortcut_init(void)
#ifndef DISABLE_COLOR
add_to_funcs(do_linter, MMAIN,
N_("To Linter"), IFSCHELP(nano_lint_msg), BLANKAFTER, NOVIEW);
add_to_funcs(do_formatter, MMAIN,
N_("Formatter"), IFSCHELP(nano_formatter_msg), TOGETHER, NOVIEW);
#endif
#ifndef NANO_TINY
@@ -1019,6 +1010,8 @@ void shortcut_init(void)
#ifndef DISABLE_COLOR
add_to_sclist(MMAIN, "^T", do_linter, 0);
add_to_sclist(MMAIN, "F12", do_linter, 0);
add_to_sclist(MMAIN, "^T", do_formatter, 0);
add_to_sclist(MMAIN, "F12", do_formatter, 0);
#endif
#endif
add_to_sclist(MMAIN, "^C", do_cursorpos_void, 0);
@@ -1190,17 +1183,24 @@ void shortcut_init(void)
}
#ifndef DISABLE_COLOR
void set_lint_shortcuts(void)
void set_lint_or_format_shortcuts(void)
{
#ifndef DISABLE_SPELLER
replace_scs_for(do_spell, do_linter);
if (openfile->syntax->formatter) {
replace_scs_for(do_spell, do_formatter);
replace_scs_for(do_linter, do_formatter);
} else {
replace_scs_for(do_spell, do_linter);
replace_scs_for(do_formatter, do_linter);
}
#endif
}
void set_spell_shortcuts(void)
{
#ifndef DISABLE_SPELLER
replace_scs_for(do_linter, do_spell);
replace_scs_for(do_formatter, do_spell);
replace_scs_for(do_linter, do_spell);
#endif
}
#endif
@@ -1528,7 +1528,7 @@ int strtomenu(char *input)
return MHELP;
#endif
#ifndef DISABLE_SPELLER
else if (!strcasecmp(input, "spell"))
else if (!strcasecmp(input, "spell") || !strcasecmp(input, "formatter"))
return MSPELL;
#endif
else if (!strcasecmp(input, "linter"))

View File

@@ -360,6 +360,9 @@ void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
*file_bot = openfile->filebot;
}
openfile->fileage->next = NULL;
free_filestruct(openfile->fileage);
/* Renumber starting with the line after the original
* file_bot. */
if (file_bot_save->next != NULL)
@@ -447,6 +450,7 @@ void copy_from_filestruct(filestruct *somebuffer)
/* Put the top and bottom of the current filestruct at the top and
* bottom of a copy of the passed buffer. */
free_filestruct(openfile->fileage);
openfile->fileage = copy_filestruct(somebuffer);
openfile->filebot = openfile->fileage;
while (openfile->filebot->next != NULL)
@@ -958,7 +962,7 @@ void version(void)
{
printf(_(" GNU nano version %s (compiled %s, %s)\n"), VERSION,
__TIME__, __DATE__);
printf(" (C) 1999..2014 Free Software Foundation, Inc.\n");
printf(" (C) 1999..2015 Free Software Foundation, Inc.\n");
printf(
_(" Email: nano@nano-editor.org Web: http://www.nano-editor.org/"));
printf(_("\n Compiled options:"));
@@ -1148,7 +1152,7 @@ void do_exit(void)
#ifndef DISABLE_MULTIBUFFER
/* Exit only if there are no more open file buffers. */
if (!close_buffer())
if (!close_buffer(FALSE))
#endif
finish();
/* If the user canceled, we go on. */

View File

@@ -251,6 +251,8 @@ typedef struct syntaxtype {
/* The colors used in this syntax. */
char *linter;
/* The command to lint this type of file. */
char *formatter;
/* Use this formatter command (for programming lang mainly) */
int nmultis;
/* How many multi-line strings this syntax has. */
struct syntaxtype *next;

View File

@@ -151,15 +151,15 @@ int do_statusbar_input(bool *ran_func, bool *finished,
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currmenu != MWRITEFILE)
do_statusbar_cut_text();
} else if (s->scfunc == do_right)
do_statusbar_right();
else if (s->scfunc == do_left)
} else if (s->scfunc == do_left)
do_statusbar_left();
else if (s->scfunc == do_right)
do_statusbar_right();
#ifndef NANO_TINY
else if (s->scfunc == do_next_word_void)
do_statusbar_next_word(FALSE);
else if (s->scfunc == do_prev_word_void)
do_statusbar_prev_word(FALSE);
else if (s->scfunc == do_next_word_void)
do_statusbar_next_word(FALSE);
#endif
else if (s->scfunc == do_home)
do_statusbar_home();
@@ -340,13 +340,12 @@ void do_statusbar_home(void)
statusbar_x = 0;
statusbar_pww = statusbar_xplustabs();
} else {
} else
#endif
{
statusbar_x = 0;
statusbar_pww = statusbar_xplustabs();
#ifndef NANO_TINY
}
#endif
if (need_statusbar_horizontal_update(pww_save))
update_statusbar_line(answer, statusbar_x);
@@ -431,14 +430,13 @@ void do_statusbar_cut_text(void)
#ifndef NANO_TINY
if (ISSET(CUT_TO_END))
null_at(&answer, statusbar_x);
else {
else
#endif
{
null_at(&answer, 0);
statusbar_x = 0;
statusbar_pww = statusbar_xplustabs();
#ifndef NANO_TINY
}
#endif
update_statusbar_line(answer, statusbar_x);
}
@@ -777,7 +775,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
}
#ifdef DEBUG
fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answer, (unsigned long) statusbar_x);
fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answer, (unsigned long) statusbar_x);
#endif
update_statusbar_line(answer, statusbar_x);
@@ -901,7 +899,6 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe
wnoutrefresh(bottomwin);
}
#ifndef DISABLE_HISTORIES
/* Set the current position in the history list to the bottom,
* and free magichistory if we need to. */
@@ -913,7 +910,6 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe
}
#endif
/* We've finished putting in an answer or run a normal shortcut's
* associated function, so reset statusbar_x and statusbar_pww. If
* we've finished putting in an answer, reset the statusbar cursor
@@ -1045,7 +1041,6 @@ int do_yesno_prompt(bool all, const char *msg)
const char *yesstr; /* String of Yes characters accepted. */
const char *nostr; /* Same for No. */
const char *allstr; /* And All, surprise! */
const sc *s;
int oldmenu = currmenu;
assert(msg != NULL);
@@ -1106,15 +1101,16 @@ int do_yesno_prompt(bool all, const char *msg)
do {
int kbinput;
functionptrtype func;
#ifndef DISABLE_MOUSE
int mouse_x, mouse_y;
#endif
currmenu = MYESNO;
kbinput = get_kbinput(bottomwin);
s = get_shortcut(&kbinput);
func = func_from_key(&kbinput);
if (s && s->scfunc == do_cancel)
if (func == do_cancel)
ok = -1;
#ifndef DISABLE_MOUSE
else if (kbinput == KEY_MOUSE) {
@@ -1146,7 +1142,7 @@ int do_yesno_prompt(bool all, const char *msg)
}
}
#endif /* !DISABLE_MOUSE */
else if (s && s->scfunc == total_refresh) {
else if (func == total_refresh) {
total_redraw();
continue;
} else {

View File

@@ -283,15 +283,15 @@ void replace_buffer(const char *filename);
#endif
void display_buffer(void);
#ifndef DISABLE_MULTIBUFFER
void switch_to_prevnext_buffer(bool next);
void switch_to_prevnext_buffer(bool next, bool quiet);
void switch_to_prev_buffer_void(void);
void switch_to_next_buffer_void(void);
bool close_buffer(void);
bool close_buffer(bool quiet);
#endif
filestruct *read_line(char *buf, filestruct *prevnode, bool
*first_line_ins, size_t buf_len);
void read_file(FILE *f, int fd, const char *filename, bool undoable, bool checkwritable);
int open_file(const char *filename, bool newfie, FILE **f);
int open_file(const char *filename, bool newfie, bool quiet, FILE **f);
char *get_next_filename(const char *name, const char *suffix);
void do_insertfile(
#ifndef NANO_TINY
@@ -359,7 +359,7 @@ void assign_keyinfo(sc *s);
void print_sclist(void);
void shortcut_init(void);
#ifndef DISABLE_COLOR
void set_lint_shortcuts(void);
void set_lint_or_format_shortcuts(void);
void set_spell_shortcuts(void);
#endif
const subnfunc *sctofunc(sc *s);
@@ -688,6 +688,7 @@ void do_spell(void);
#endif
#ifndef DISABLE_COLOR
void do_linter(void);
void do_formatter(void);
#endif
#ifndef NANO_TINY
void do_wordlinechar_count(void);
@@ -780,7 +781,7 @@ void check_statusblank(void);
char *display_string(const char *buf, size_t start_col, size_t len, bool
dollars);
void titlebar(const char *path);
void set_modified(void);
extern void set_modified(void);
void statusbar(const char *msg, ...);
void bottombars(int menu);
void onekey(const char *keystroke, const char *desc, size_t len);

View File

@@ -328,6 +328,7 @@ void parse_syntax(char *ptr)
endsyntax->next = NULL;
endsyntax->nmultis = 0;
endsyntax->linter = NULL;
endsyntax->formatter = NULL;
#ifdef DEBUG
fprintf(stderr, "Starting a new syntax type: \"%s\"\n", nameptr);
@@ -995,6 +996,31 @@ void parse_linter(char *ptr)
else
endsyntax->linter = mallocstrcpy(syntaxes->linter, ptr);
}
void parse_formatter(char *ptr)
{
assert(ptr != NULL);
if (syntaxes == NULL) {
rcfile_error(
N_("Cannot add formatter without a syntax command"));
return;
}
if (*ptr == '\0') {
rcfile_error(N_("Missing formatter command"));
return;
}
if (endsyntax->formatter != NULL)
free(endsyntax->formatter);
/* Let them unset the formatter by using "". */
if (!strcmp(ptr, "\"\""))
endsyntax->formatter = NULL;
else
endsyntax->formatter = mallocstrcpy(syntaxes->formatter, ptr);
}
#endif /* !DISABLE_COLOR */
/* Check whether the user has unmapped every shortcut for a
@@ -1130,6 +1156,8 @@ void parse_rcfile(FILE *rcstream
parse_colors(ptr, TRUE);
else if (strcasecmp(keyword, "linter") == 0)
parse_linter(ptr);
else if (strcasecmp(keyword, "formatter") == 0)
parse_formatter(ptr);
#endif /* !DISABLE_COLOR */
else if (strcasecmp(keyword, "bind") == 0)
parse_binding(ptr, TRUE);

View File

@@ -433,7 +433,7 @@ void do_undo(void)
undo *u = openfile->current_undo;
filestruct *t = 0;
size_t len = 0;
char *undidmsg, *data;
char *data, *undidmsg = NULL;
if (!u) {
statusbar(_("Nothing in undo buffer!"));
@@ -455,8 +455,8 @@ void do_undo(void)
case ADD:
undidmsg = _("text add");
len = strlen(f->data) - strlen(u->strdata) + 1;
data = charalloc(len);
strncpy(data, f->data, u->begin);
data = charalloc(len);
strncpy(data, f->data, u->begin);
strcpy(&data[u->begin], &f->data[u->begin + strlen(u->strdata)]);
free(f->data);
f->data = data;
@@ -476,7 +476,6 @@ void do_undo(void)
break;
#ifndef DISABLE_WRAPPING
case SPLIT_END:
undidmsg = _("line wrap");
goto_line_posx(u->lineno, u->begin);
openfile->current_undo = openfile->current_undo->next;
openfile->last_action = OTHER;
@@ -484,6 +483,8 @@ void do_undo(void)
do_undo();
u = openfile->current_undo;
f = openfile->current;
case SPLIT_BEGIN:
undidmsg = _("text add");
break;
#endif /* !DISABLE_WRAPPING */
case JOIN:
@@ -502,11 +503,13 @@ void do_undo(void)
case CUT_EOF:
case CUT:
undidmsg = _("text cut");
undo_cut(u);
undo_cut(u);
f = fsfromline(u->lineno);
break;
case PASTE:
undidmsg = _("text uncut");
undo_paste(u);
f = fsfromline(u->lineno);
break;
case ENTER:
undidmsg = _("line break");
@@ -554,7 +557,8 @@ void do_undo(void)
break;
}
statusbar(_("Undid action (%s)"), undidmsg);
if (undidmsg)
statusbar(_("Undid action (%s)"), undidmsg);
renumber(f);
openfile->current_undo = openfile->current_undo->next;
@@ -568,7 +572,7 @@ void do_redo(void)
{
undo *u = openfile->undotop;
size_t len = 0;
char *redidmsg, *data;
char *data, *redidmsg = NULL;
for (; u != NULL && u->next != openfile->current_undo; u = u->next)
;
@@ -595,7 +599,7 @@ void do_redo(void)
case ADD:
redidmsg = _("text add");
len = strlen(f->data) + strlen(u->strdata) + 1;
data = charalloc(len);
data = charalloc(len);
strncpy(data, f->data, u->begin);
strcpy(&data[u->begin], u->strdata);
strcpy(&data[u->begin + strlen(u->strdata)], &f->data[u->begin]);
@@ -608,7 +612,7 @@ void do_redo(void)
redidmsg = _("text delete");
len = strlen(f->data) + strlen(u->strdata) + 1;
data = charalloc(len);
strncpy(data, f->data, u->begin);
strncpy(data, f->data, u->begin);
strcpy(&data[u->begin], &f->data[u->begin + strlen(u->strdata)]);
free(f->data);
f->data = data;
@@ -622,7 +626,6 @@ void do_redo(void)
break;
#ifndef DISABLE_WRAPPING
case SPLIT_BEGIN:
redidmsg = _("line wrap");
goto_line_posx(u->lineno, u->begin);
openfile->current_undo = u;
openfile->last_action = OTHER;
@@ -630,6 +633,8 @@ void do_redo(void)
do_redo();
u = openfile->current_undo;
goto_line_posx(u->lineno, u->begin);
case SPLIT_END:
redidmsg = _("text add");
break;
#endif /* !DISABLE_WRAPPING */
case JOIN:
@@ -675,7 +680,8 @@ void do_redo(void)
break;
}
statusbar(_("Redid action (%s)"), redidmsg);
if (redidmsg)
statusbar(_("Redid action (%s)"), redidmsg);
openfile->current_undo = u;
openfile->last_action = OTHER;
@@ -996,7 +1002,7 @@ void update_undo(undo_type action)
openfilestruct *fs = openfile;
#ifdef DEBUG
fprintf(stderr, "action = %d, fs->last_action = %d, openfile->current->lineno = %ld",
fprintf(stderr, "action = %d, fs->last_action = %d, openfile->current->lineno = %ld",
action, fs->last_action, (long)openfile->current->lineno);
if (fs->current_undo)
fprintf(stderr, "fs->current_undo->lineno = %ld\n", (long)fs->current_undo->lineno);
@@ -1009,7 +1015,7 @@ void update_undo(undo_type action)
if (action != fs->last_action
|| (action != ENTER && action != CUT && action != INSERT
&& openfile->current->lineno != fs->current_undo->lineno)) {
add_undo(action);
add_undo(action);
return;
}
@@ -1019,7 +1025,7 @@ void update_undo(undo_type action)
switch (u->type) {
case ADD: {
#ifdef DEBUG
fprintf(stderr, "fs->current->data = \"%s\", current_x = %lu, u->begin = %lu\n",
fprintf(stderr, "fs->current->data = \"%s\", current_x = %lu, u->begin = %lu\n",
fs->current->data, (unsigned long)fs->current_x, (unsigned long)u->begin);
#endif
char *char_buf = charalloc(mb_cur_max());
@@ -1329,10 +1335,10 @@ ssize_t break_line(const char *line, ssize_t goal
#ifndef DISABLE_HELP
if (newln && blank_loc <= 0) {
/* If no blank was found, or was found only as the first
* character, force a line break. */
cur_loc -= char_len;
return cur_loc;
/* If no blank was found, or was found only as the first
* character, force a line break. */
cur_loc -= char_len;
return cur_loc;
}
#endif
@@ -1877,6 +1883,10 @@ void do_justify(bool full_justify)
bool filebot_inpar = FALSE;
/* Whether the text at filebot is part of the current
* paragraph. */
int kbinput;
/* The first keystroke after a justification. */
functionptrtype func;
/* The function associated with that keystroke. */
/* We save these variables to be restored if the user
* unjustifies. */
@@ -1891,9 +1901,6 @@ void do_justify(bool full_justify)
#endif
bool modified_save = openfile->modified;
int kbinput;
const sc *s;
/* Move to the beginning of the current line, so that justifying at
* the end of the last line of the file, if that line isn't blank,
* will work the first time through. */
@@ -2212,9 +2219,9 @@ void do_justify(bool full_justify)
/* Now get a keystroke and see if it's unjustify. If not, put back
* the keystroke and return. */
kbinput = do_input(FALSE);
s = get_shortcut(&kbinput);
func = func_from_key(&kbinput);
if (s && s->scfunc == do_uncut_text) {
if (func == do_uncut_text) {
/* Splice the justify buffer back into the file, but only if we
* actually justified something. */
if (first_par_line != NULL) {
@@ -2856,7 +2863,7 @@ void do_spell(void)
const char *spell_msg;
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
nano_disabled_msg();
return;
}
@@ -2928,7 +2935,6 @@ void do_linter(void)
static char **lintargs = NULL;
char *lintcopy;
char *convendptr = NULL;
const sc *s;
lintstruct *lints = NULL, *tmplint = NULL, *curlint = NULL;
if (!openfile->syntax || !openfile->syntax->linter) {
@@ -2937,13 +2943,12 @@ void do_linter(void)
}
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
nano_disabled_msg();
return;
}
if (openfile->modified) {
int i = do_yesno_prompt(FALSE,
_("Save modified buffer before linting?"));
int i = do_yesno_prompt(FALSE, _("Save modified buffer before linting?"));
if (i == -1) {
statusbar(_("Cancelled"));
lint_cleanup();
@@ -2989,13 +2994,13 @@ void do_linter(void)
/* Child continues (i.e. future spell process). */
close(lint_fd[0]);
/* Send spell's standard output/err to the pipe. */
if (dup2(lint_fd[1], STDOUT_FILENO) != STDOUT_FILENO)
exit(1);
if (dup2(lint_fd[1], STDERR_FILENO) != STDERR_FILENO)
exit(1);
/* Send spell's standard output/err to the pipe. */
if (dup2(lint_fd[1], STDOUT_FILENO) != STDOUT_FILENO)
exit(1);
if (dup2(lint_fd[1], STDERR_FILENO) != STDERR_FILENO)
exit(1);
close(lint_fd[1]);
close(lint_fd[1]);
/* Start the linter program; we are using $PATH. */
execvp(lintargs[0], lintargs);
@@ -3130,9 +3135,10 @@ void do_linter(void)
bottombars(MLINTER);
tmplint = NULL;
curlint = lints;
while (1) {
while (TRUE) {
ssize_t tmpcol = 1;
int kbinput;
functionptrtype func;
if (curlint->colno > 0)
tmpcol = curlint->colno;
@@ -3188,30 +3194,24 @@ void do_linter(void)
}
kbinput = get_kbinput(bottomwin);
s = get_shortcut(&kbinput);
func = func_from_key(&kbinput);
tmplint = curlint;
if (!s)
continue;
else if (s->scfunc == do_cancel)
if (func == do_cancel)
break;
else if (s->scfunc == do_help_void) {
else if (func == do_help_void) {
tmplint = NULL;
do_help_void();
} else if (s->scfunc == do_page_down) {
} else if (func == do_page_down) {
if (curlint->next != NULL)
curlint = curlint->next;
else {
statusbar(_("At last message"));
continue;
}
} else if (s->scfunc == do_page_up) {
curlint = curlint->next;
else
statusbar(_("At last message"));
} else if (func == do_page_up) {
if (curlint->prev != NULL)
curlint = curlint->prev;
else {
statusbar(_("At first message"));
continue;
}
else
statusbar(_("At first message"));
}
}
blank_statusbar();
@@ -3225,6 +3225,160 @@ free_lints_and_return:
}
lint_cleanup();
}
/* Run a formatter for the given syntax.
* Expects the formatter to be non-interactive and
* operate on a file in-place, which we'll pass it
* on the command line. Another mashuhp of the speller
* and alt_speller routines.
*/
void do_formatter(void)
{
bool status;
FILE *temp_file;
char *temp = safe_tempfile(&temp_file);
int format_status;
size_t current_x_save = openfile->current_x;
size_t pww_save = openfile->placewewant;
ssize_t current_y_save = openfile->current_y;
ssize_t lineno_save = openfile->current->lineno;
pid_t pid_format;
char *ptr;
static int arglen = 3;
static char **formatargs = NULL;
char *finalstatus = NULL;
/* Check whether we're using syntax highlighting
* and formatter option it set
*/
if (openfile->syntax == NULL || openfile->syntax->formatter == NULL) {
statusbar(_("Error: no linter defined"));
return;
}
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
if (temp == NULL) {
statusbar(_("Error writing temp file: %s"), strerror(errno));
return;
}
/* we're not supporting partial formatting, oi vey */
openfile->mark_set = FALSE;
status = write_file(temp, temp_file, TRUE, OVERWRITE, FALSE);
if (!status) {
statusbar(_("Error writing temp file: %s"), strerror(errno));
free(temp);
return;
}
if (openfile->totsize == 0) {
statusbar(_("Finished"));
return;
}
blank_bottombars();
statusbar(_("Invoking formatter, please wait"));
doupdate();
endwin();
/* Set up an argument list to pass execvp(). */
if (formatargs == NULL) {
formatargs = (char **)nmalloc(arglen * sizeof(char *));
formatargs[0] = strtok(openfile->syntax->formatter, " ");
while ((ptr = strtok(NULL, " ")) != NULL) {
arglen++;
formatargs = (char **)nrealloc(formatargs, arglen *
sizeof(char *));
formatargs[arglen - 3] = ptr;
}
formatargs[arglen - 1] = NULL;
}
formatargs[arglen - 2] = temp;
/* Start a new process for the formatter. */
if ((pid_format = fork()) == 0) {
/* Start alternate format program; we are using $PATH. */
execvp(formatargs[0], formatargs);
/* Should not be reached, if alternate formatter is found!!! */
exit(1);
}
/* If we couldn't fork, get out. */
if (pid_format < 0) {
statusbar(_("Could not fork"));
return;
}
#ifndef NANO_TINY
/* Don't handle a pending SIGWINCH until the alternate format checker
* is finished and we've loaded the format-checked file back in. */
allow_pending_sigwinch(FALSE);
#endif
/* Wait for the formatter to finish. */
wait(&format_status);
/* Reenter curses mode. */
doupdate();
/* Restore the terminal to its previous state. */
terminal_init();
/* Turn the cursor back on for sure. */
curs_set(1);
/* The screen might have been resized. If it has, reinitialize all
* the windows based on the new screen dimensions. */
window_init();
if (!WIFEXITED(format_status) ||
WEXITSTATUS(format_status) != 0) {
char *format_error;
char *invoke_error = _("Error invoking \"%s\"");
format_error =
charalloc(strlen(invoke_error) +
strlen(openfile->syntax->formatter) + 1);
sprintf(format_error, invoke_error, openfile->syntax->formatter);
finalstatus = format_error;
} else {
/* Replace the text of the current buffer with the format-checked
* text. */
replace_buffer(temp);
/* Go back to the old position, and mark the file as modified. */
do_gotopos(lineno_save, current_x_save, current_y_save, pww_save);
set_modified();
#ifndef NANO_TINY
/* Handle a pending SIGWINCH again. */
allow_pending_sigwinch(TRUE);
#endif
finalstatus = _("Finished formatting");
}
unlink(temp);
free(temp);
currmenu = MMAIN;
/* If the spell-checker printed any error messages onscreen, make
* sure that they're cleared off. */
total_refresh();
statusbar(finalstatus);
}
#endif /* !DISABLE_COLOR */
#ifndef NANO_TINY

View File

@@ -3323,8 +3323,9 @@ void total_refresh(void)
void display_main_list(void)
{
#ifndef DISABLE_COLOR
if (openfile->syntax && openfile->syntax->linter)
set_lint_shortcuts();
if (openfile->syntax
&& (openfile->syntax->formatter || openfile->syntax->linter))
set_lint_or_format_shortcuts();
else
set_spell_shortcuts();
#endif
@@ -3435,8 +3436,8 @@ void do_replace_highlight(bool highlight, const char *word)
}
#ifndef DISABLE_EXTRA
#define CREDIT_LEN 57
#define XLCREDIT_LEN 8
#define CREDIT_LEN 54
#define XLCREDIT_LEN 9
/* Easter egg: Display credits. Assume nodelay(edit) and scrollok(edit)
* are FALSE. */
@@ -3458,15 +3459,11 @@ void do_credits(void)
"Rocco Corsi",
"David Lawrence Ramsey",
"David Benbennick",
"Mark Majeres",
"Mike Frysinger",
"Benno Schulenberg",
"Ken Tyler",
"Sven Guckes",
NULL, /* credits[16], handled below. */
"Pauli Virtanen",
"Daniele Medri",
"Clement Laforet",
"Tedi Heriyanto",
"Bill Soudan",
"Christian Weisgerber",
"Erik Andersen",
@@ -3485,6 +3482,7 @@ void do_credits(void)
"Richard Kolb II",
NULL, /* "The Free Software Foundation" */
"Linus Torvalds",
NULL, /* "the many translators and the TP" */
NULL, /* "For ncurses:" */
"Thomas Dickey",
"Pavel Curtis",
@@ -3496,7 +3494,7 @@ void do_credits(void)
"",
"",
"",
"(C) 1999 - 2014",
"(C) 1999 - 2015",
"Free Software Foundation, Inc.",
"",
"",
@@ -3511,20 +3509,12 @@ void do_credits(void)
N_("Brought to you by:"),
N_("Special thanks to:"),
N_("The Free Software Foundation"),
N_("the many translators and the TP"),
N_("For ncurses:"),
N_("and anyone else we forgot..."),
N_("Thank you for using nano!")
};
/* credits[16]: Make sure this name is displayed properly, since we
* can't dynamically assign it above, using Unicode 00F6 (Latin
* Small Letter O with Diaresis) if applicable. */
credits[16] =
#ifdef ENABLE_UTF8
using_utf8() ? "Florian K\xC3\xB6nig" :
#endif
"Florian K\xF6nig";
if (!old_more_space || !old_no_help) {
SET(MORE_SPACE);
SET(NO_HELP);