+2015-08-04 Benno Schulenberg <bensberg@justemail.net>
+ * src/nano.c (main), src/files.c (read_file), src/rcfile.c,
+ doc/man/nano.1, doc/man/nanorc.5, doc/texinfo/nano.texi: Add
+ the option --unix, to save a file by default in Unix format.
+
2015-08-03 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c (parse_binding): Check the value of shortcut->toggle
only if it actually is a toggle. Found with valgrind.
Always save a changed buffer without prompting. Same as Pico's \fB\-t\fP
option.
.TP
+.BR \-u ", " \-\-unix
+Save a file by default in Unix format. This overrides nano's
+default behavior of saving a file in the format that it had.
+(This option has no effect when you also use \fB\-\-noconvert\fR.)
+.TP
.BR \-v ", " \-\-view
View-file (read-only) mode.
.TP
.BR white , \ black , \ red , \ blue , \ green , \ yellow , \ magenta ", and " cyan .
And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
.TP
+.B set unix
+Save a file by default in Unix format. This overrides nano's
+default behavior of saving a file in the format that it had.
+(This option has no effect when you also use \fBset noconvert\fR.)
+.TP
.B set view
Disallow file modification.
.TP
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(antshow)?|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|pos(ition)?log|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|view|wordbounds)\>"
+icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const(antshow)?|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|pos(ition)?log|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|unix|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:]]+(all|main|search|replace(2|with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)+[[:space:]]*$"
exiting, assume yes. This is most useful when using @command{nano} as the
composer of a mailer program.
+@item -u
+@item --unix
+Save a file by default in Unix format. This overrides nano's
++default behavior of saving a file in the format that it had.
+(This option has no effect when you also use @code{--noconvert}.)
+
@item -v
@itemx --view
Don't allow the contents of the file to be altered. Note that this
white, black, red, blue, green, yellow, magenta, and cyan.
And either @var{fgcolor} or @var{,bgcolor} may be left out.
+@item set unix
+Save a file by default in Unix format. This overrides nano's
+default behavior of saving a file in the format that it had.
+(This option has no effect when you also use @code{set noconvert}.)
+
@item set view
Disallow file modification.
statusbar(P_("Read %lu line (Warning: No write permission)",
"Read %lu lines (Warning: No write permission)",
(unsigned long)num_lines), (unsigned long)num_lines);
+
+ if (ISSET(MAKE_IT_UNIX))
+ openfile->fmt = NIX_FILE;
}
/* Open the file (and decide if it exists). If newfie is TRUE, display
{"speller", 1, NULL, 's'},
#endif
{"tempfile", 0, NULL, 't'},
+ {"unix", 0, NULL, 'u'},
{"view", 0, NULL, 'v'},
#ifndef DISABLE_WRAPPING
{"nowrap", 0, NULL, 'w'},
while ((optchr =
#ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv,
- "ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefghijklmno:pqr:s:tvwxz$",
+ "ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefghijklmno:pqr:s:tuvwxz$",
long_options, NULL)
#else
getopt(argc, argv,
- "ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefghijklmno:pqr:s:tvwxz$")
+ "ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefghijklmno:pqr:s:tuvwxz$")
#endif
) != -1) {
switch (optchr) {
case 't':
SET(TEMP_FILE);
break;
+ case 'u':
+ SET(MAKE_IT_UNIX);
+ break;
case 'v':
SET(VIEW_MODE);
break;
SOFTWRAP,
POS_HISTORY,
LOCKING,
- NOREAD_MODE
+ NOREAD_MODE,
+ MAKE_IT_UNIX
};
/* Flags for the menus in which a given function should be present. */
{"suspend", SUSPEND},
{"tabsize", 0},
{"tempfile", TEMP_FILE},
+ {"unix", MAKE_IT_UNIX},
{"view", VIEW_MODE},
#ifndef NANO_TINY
{"allow_insecure_backup", INSECURE_BACKUP},