[PATCH] change name of eol configuration during saving files

Vincen Yang <[email protected]> Tue, 14 Apr 2026 21:25:58 +0800
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
Hello all,

When I am trying to save a file inside Nano using C-s. I will see a 
time where when I am specify the name of the file, I could also 
chose which EOL type do I want, like MSDOS or Classic Mac. But the 
option for “Classic Mac” is called  “Mac Format” which I think is a 
very unclear name, as modern Macs also use the Unix EOL of “\n” 
instead of “\r”.

So I was thinking of changing the name to something like “Classic 
Mac Format”, or we just specify the EOL type instead of the OS using 
it. Like “CRLF”, “LF” or “CR”. Which I think is much more easy to 
understand and clear. I want to know everyone’s opinions about this. 
Thank you very much.

And the code will be something like this (I did not change all the 
parts):

diff --git a/src/files.c b/src/files.c
index a8a37cc9..e80102e4 100644
--- a/src/files.c
+++ b/src/files.c
@@ -544,7 +544,7 @@ void mention_name_and_linecount(void)
statusline(HUSH, P_("%s -- %zu line (%s)", "%s -- %zu lines (%s)", count),
openfile->filename[0] == '\0' ?
_("New Buffer") : tail(openfile->filename), count,
- openfile->fmt == DOS_FILE ? _("DOS") : _("Mac"));
+ openfile->fmt == DOS_FILE ? _("CRLF") : _("CR"));
else
#endif
statusline(HUSH, P_("%s -- %zu line", "%s -- %zu lines", count),
@@ -836,12 +836,12 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable)
#ifndef NANO_TINY
else if (format == MAC_FILE)
/* TRANSLATORS: Keep the next three messages at most 78 characters. */
- statusline(REMARK, P_("Read %zu line (converted from Mac format)",
- "Read %zu lines (converted from Mac format)",
+ statusline(REMARK, P_("Read %zu line (converted from CR format)",
+ "Read %zu lines (converted from CR format)",
num_lines), num_lines);
else if (format == DOS_FILE)
- statusline(REMARK, P_("Read %zu line (converted from DOS format)",
- "Read %zu lines (converted from DOS format)",
+ statusline(REMARK, P_("Read %zu line (converted from CRLF format)",
+ "Read %zu lines (converted from CRLF format)",
num_lines), num_lines);
#endif
else
@@ -2155,8 +2155,8 @@ int write_it_out(bool exiting, bool withprompt)
int response = 0;
int choice = NO;
#ifndef NANO_TINY
- const char *formatstr = (openfile->fmt == DOS_FILE) ? _(" [DOS Format]") :
- (openfile->fmt == MAC_FILE) ? _(" [Mac Format]") : "";
+ const char *formatstr = (openfile->fmt == DOS_FILE) ? _(" [CRLF]") :
+ (openfile->fmt == MAC_FILE) ? _(" [CR]") : "";
const char *backupstr = ISSET(MAKE_BACKUP) ? _(" [Backup]") : "";
/* When the mark is on, offer to write the selection to disk, but
diff --git a/src/global.c b/src/global.c
index b93f035e..d3c06a25 100644
--- a/src/global.c
+++ b/src/global.c
@@ -700,8 +700,8 @@ void shortcut_init(void)
const char *newer_gist = N_("Recall the next search/replace string");
#endif
#ifndef NANO_TINY
- const char *dos_gist = N_("Toggle the use of DOS format");
- const char *mac_gist = N_("Toggle the use of Mac format");
+ const char *dos_gist = N_("Toggle the use of CRLF format");
+ const char *mac_gist = N_("Toggle the use of CR format");
const char *append_gist = N_("Toggle appending");
const char *prepend_gist = N_("Toggle prepending");
const char *backup_gist = N_("Toggle backing up of the original file");
@@ -712,7 +712,7 @@ void shortcut_init(void)
const char *older_command_gist = N_("Recall the previous command");
const char *newer_command_gist = N_("Recall the next command");
#endif
- const char *convert_gist = N_("Do not convert from DOS/Mac format");
+ const char *convert_gist = N_("Do not convert from CRLF/CR format");
#endif
#ifdef ENABLE_MULTIBUFFER
const char *newbuffer_gist = N_("Toggle the use of a new buffer");
@@ -1162,9 +1162,9 @@ void shortcut_init(void)
#ifndef NANO_TINY
add_to_funcs(dos_format, MWRITEFILE,
- N_("DOS Format"), WHENHELP(dos_gist), TOGETHER);
+ N_("CRLF Format"), WHENHELP(dos_gist), TOGETHER);
add_to_funcs(mac_format, MWRITEFILE,
- N_("Mac Format"), WHENHELP(mac_gist), TOGETHER);
+ N_("CR Format"), WHENHELP(mac_gist), TOGETHER);
/* If we're using restricted mode, the Append, Prepend, and Backup toggles
* are disabled. The first and second are not useful as they only allow
diff --git a/src/nano.c b/src/nano.c
index 55feb924..88eaf949 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -543,7 +543,7 @@ void usage(void)
#endif
#ifndef NANO_TINY
print_opt("-N", "--noconvert",
- N_("Don't convert files from DOS/Mac format"));
+ N_("Don't convert files from CRLF/CR format"));
print_opt("-O", "--bookstyle",
N_("Leading whitespace means new paragraph"));
#endif

Vincent Yang