File 0102-Uniform-spelling-and-casing-of-key-shortcuts.patch of Package erlang
From 2ccb47453301a025a76dba0933869232dd4006c5 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Thu, 13 Jun 2024 14:27:19 +0200
Subject: [PATCH 1/2] Uniform spelling and casing of key shortcuts
Control always written as Ctrl. Letter keys always uppercase.
Modifiers (Shift, Alt, Ctrl) always titlecase.
---
HOWTO/INSTALL-RASPBERRYPI3.md | 2 +-
erts/emulator/nifs/common/prim_tty_nif.c | 10 +++++-----
erts/emulator/sys/unix/sys.c | 6 +++---
erts/emulator/sys/win32/sys_interrupt.c | 2 +-
lib/debugger/test/dbg_ui_SUITE.erl | 8 ++++----
lib/reltool/test/reltool_manual_gui_SUITE.erl | 2 +-
lib/ssh/src/ssh_connect.hrl | 4 ++--
lib/stdlib/doc/stdlib_app.md | 2 +-
lib/stdlib/src/edlin_key.erl | 2 +-
lib/stdlib/src/erl_scan.erl | 2 +-
lib/stdlib/src/shell.erl | 2 +-
11 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/HOWTO/INSTALL-RASPBERRYPI3.md b/HOWTO/INSTALL-RASPBERRYPI3.md
index 77fdc67f55..1f4ac108bb 100644
--- a/HOWTO/INSTALL-RASPBERRYPI3.md
+++ b/HOWTO/INSTALL-RASPBERRYPI3.md
@@ -241,7 +241,7 @@ Uncheck option:
$ cat > test.c
$ int main() { printf("Hello, world!\n"); return 0; }
- <CTRL+D>
+ <Ctrl+D>
$ armv8-rpi3-linux-gnueabihf-gcc -o test test.c
diff --git a/erts/emulator/nifs/common/prim_tty_nif.c b/erts/emulator/nifs/common/prim_tty_nif.c
index ee69241862..1eee3dbccf 100644
--- a/erts/emulator/nifs/common/prim_tty_nif.c
+++ b/erts/emulator/nifs/common/prim_tty_nif.c
@@ -467,7 +467,7 @@ static ERL_NIF_TERM tty_read_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
* - Normal key presses
* - Microsoft IME
* - Pasting into console
- * - Using ALT+ modifiers
+ * - Using Alt+ modifiers
*
* ### Normal key presses
*
@@ -493,11 +493,11 @@ static ERL_NIF_TERM tty_read_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
* a keydown event with UnicodeChar set to 0 and then immediately followed by a
* keyup event with the non-ascii text.
*
- * ### Using ALT+ modifiers
+ * ### Using Alt+ modifiers
*
* A very old way of inputting Unicode characters on Windows is to press
* the left alt key and then some numbers on the number pad. For instance
- * you can type ALT+1 to write a ☺. When doing this first a keydown
+ * you can type Alt+1 to write a ☺. When doing this first a keydown
* with 0 is sent and then some events later a keyup with the character
* is sent. This behavior seems to only work on cmd.exe and powershell.
*
@@ -506,11 +506,11 @@ static ERL_NIF_TERM tty_read_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
* - Normal presses -- Always keydown and keyup events
* - IME -- Always keydown, sometimes keyup
* - Pasting -- Always keydown=0 directly followed by keyup=value
- * - ALT+ -- Sometimes keydown=0 followed eventually by keyup=value
+ * - Alt+ -- Sometimes keydown=0 followed eventually by keyup=value
*
* So in order to read characters we should always read the keydown event,
* except when it is 0, then we should read the adjacent keyup event.
- * This covers all modes and consoles except ALT+. If we want ALT+ to work
+ * This covers all modes and consoles except Alt+. If we want Alt+ to work
* we probably have to use PeekConsoleInput to make sure the correct events
* are available and inspect the state of the key event somehow.
**/
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index ba5ba255d4..19608ef5c9 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -764,7 +764,7 @@ void erts_set_ignore_break(void) {
sys_signal(SIGTSTP, SIG_IGN); /* Ctrl-Z */
}
-/* Don't use ctrl-c for break handler but let it be
+/* Don't use Ctrl-C for break handler but let it be
used by the shell instead (see user_drv.erl) */
void erts_replace_intr(void) {
struct termios mode;
@@ -772,11 +772,11 @@ void erts_replace_intr(void) {
if (isatty(0)) {
tcgetattr(0, &mode);
- /* here's an example of how to replace ctrl-c with ctrl-u */
+ /* here's an example of how to replace Ctrl-C with Ctrl-U */
/* mode.c_cc[VKILL] = 0;
mode.c_cc[VINTR] = CKILL; */
- mode.c_cc[VINTR] = 0; /* disable ctrl-c */
+ mode.c_cc[VINTR] = 0; /* disable Ctrl-C */
tcsetattr(0, TCSANOW, &mode);
replace_intr = 1;
}
diff --git a/erts/emulator/sys/win32/sys_interrupt.c b/erts/emulator/sys/win32/sys_interrupt.c
index fc4f63d4bf..fbbd7a1b76 100644
--- a/erts/emulator/sys/win32/sys_interrupt.c
+++ b/erts/emulator/sys/win32/sys_interrupt.c
@@ -111,7 +111,7 @@ BOOL WINAPI ctrl_handler_replace_intr(DWORD dwCtrlType)
}
-/* Don't use ctrl-c for break handler but let it be
+/* Don't use Ctrl-C for break handler but let it be
used by the shell instead (see user_drv.erl) */
void erts_replace_intr(void) {
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl
index ca66f49f0a..0b519e6a32 100644
--- a/lib/debugger/test/dbg_ui_SUITE.erl
+++ b/lib/debugger/test/dbg_ui_SUITE.erl
@@ -192,10 +192,10 @@ Interpret one module").
"Start the debugger and interpret the modules [test, lists1, ordsets1]. Close the Interpret dialog. Set Attach on First Call and Attach on Break.").
?MAN_CASE(all_step3, "Click Step through all evaluation",
- "In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the Ctrl-S shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(all_next3,"Click Next through all evaluation",
- "Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the Ctrl-N shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(save3, "Save the debugger state",
"Use File->Save Settings to save the debugger state with the name 'three.state'").
@@ -256,7 +256,7 @@ Interpret one module").
?MAN_CASE(all_step6, "Click Step through all evaluation",
- "In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the Ctrl-S shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(all_next6,"Click Next through all evaluation",
- "Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the Ctrl-N shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE.erl b/lib/reltool/test/reltool_manual_gui_SUITE.erl
index 3a4b012d2e..659c51f23b 100644
--- a/lib/reltool/test/reltool_manual_gui_SUITE.erl
+++ b/lib/reltool/test/reltool_manual_gui_SUITE.erl
@@ -172,7 +172,7 @@ config(Config) ->
{ok,ServerPid} = reltool:get_server(SysPid),
unlink(SysPid),
break("the system window is still alive",
- "terminate reltool by hitting 'Ctrl-q' (linux) or clicking the "
+ "terminate reltool by hitting 'Ctrl-Q' (linux) or clicking the "
"close box on the top fram when system window is active"),
false = erlang:is_process_alive(SysPid),
false = erlang:is_process_alive(ServerPid),
diff --git a/lib/ssh/src/ssh_connect.hrl b/lib/ssh/src/ssh_connect.hrl
index 3bd53d5912..7b985451f8 100644
--- a/lib/ssh/src/ssh_connect.hrl
+++ b/lib/ssh/src/ssh_connect.hrl
@@ -180,8 +180,8 @@
-define(VEOL,6). %% End-of-line character in addition to carriage return
%% or,and). linefeed.
-define(VEOL2,7). %% Additional end-of-line character.
--define(VSTART,8). %% Continues paused output (normally control-Q).
--define(VSTOP,9). %% Pauses output (normally control-S).
+-define(VSTART,8). %% Continues paused output (normally Ctrl-Q).
+-define(VSTOP,9). %% Pauses output (normally Ctrl-S).
-define(VSUSP,10). %% Suspends the current program.
-define(VDSUSP,11). %% Another suspend character.
-define(VREPRINT,12). %% Reprints the current input line.
diff --git a/lib/stdlib/doc/stdlib_app.md b/lib/stdlib/doc/stdlib_app.md
index 5b7e2cc4d8..257159c93a 100644
--- a/lib/stdlib/doc/stdlib_app.md
+++ b/lib/stdlib/doc/stdlib_app.md
@@ -55,7 +55,7 @@ For more information about configuration parameters, see the
- **`format_shell_func = {Mod, Func} | string() | default`{: #format_shell_func
}** - Can be used to set the formatting of the Erlang shell output. This has
an effect on commands that have been submitted and how it is saved in history
- or if the formatting hotkey is pressed while editing an expression (Alt-f by
+ or if the formatting hotkey is pressed while editing an expression (Alt-F by
default). You can specify a Mod:Func/1 that expects the whole expression as a
string and returns a formatted expressions as a string. See
`shell:format_shell_func/1` for how to set it from inside the shell.
diff --git a/lib/stdlib/src/edlin_key.erl b/lib/stdlib/src/edlin_key.erl
index eecf44ab2e..d14c443be4 100644
--- a/lib/stdlib/src/edlin_key.erl
+++ b/lib/stdlib/src/edlin_key.erl
@@ -227,7 +227,7 @@ normal_map() ->
%%"\^X" => ,
"\^Y" => yank,
%%"\^Z" => sig_stop, currently not handled by edlin.erl
- "\^]" => auto_blink, % ctrl+5 seems to do the same thing,
+ "\^]" => auto_blink, % Ctrl+5 seems to do the same thing,
%%# Alt-alpha_key or Esc + alpha_key, can distinguish case,
"\^[B" => backward_word,
diff --git a/lib/stdlib/src/erl_scan.erl b/lib/stdlib/src/erl_scan.erl
index 899785ae3d..9215e2df01 100644
--- a/lib/stdlib/src/erl_scan.erl
+++ b/lib/stdlib/src/erl_scan.erl
@@ -1718,7 +1718,7 @@ scan_escape([$x,H1], _Col) when ?HEX(H1) ->
more;
scan_escape([$x|Cs], Col) ->
{error,Cs,{illegal,character},incr_column(Col, 1)};
-%% \^X -> Control-X
+%% \^X -> Ctrl-X
scan_escape([$^=C0,C|Cs], Col) when ?CHAR(C) ->
case caret_char_code(C) of
error ->
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl
index 45d04eddc5..da605d522c 100644
--- a/lib/stdlib/src/shell.erl
+++ b/lib/stdlib/src/shell.erl
@@ -1981,7 +1981,7 @@ multiline_prompt_func(PromptFunc) ->
Can be used to set the formatting of the Erlang shell output.
This has an effect on commands that have been submitted, and how it is saved in history.
-Or if the formatting hotkey is pressed while editing an expression (Alt-r by default). You
+Or if the formatting hotkey is pressed while editing an expression (Alt-R by default). You
can specify a `Mod:Func/1` that expects the whole expression as a string and
returns a formatted expressions as a string. See
[`stdlib app config`](stdlib_app.md#format_shell_func) for how to set it before
--
2.43.0