diff -uNr a/yrc/manifest b/yrc/manifest --- a/yrc/manifest cb588cedfb5c3350df728e539d79692b933cef15f3ff4670b4a1253cf9b38b35b9acfbfc9fb4b3ae5ec18a3126062b77e7d3083adf5925ec480b3356871bd934 +++ b/yrc/manifest 688a80fbeae2c1065d9416d59bf3a0109f7a17c1ee3d2a0672769cb8e06844eaf291d067dcbc80208c8fa1b54c2b0bf3793c9e3b4bd15f4e372197df62acf8a6 @@ -5,3 +5,4 @@ 768773 yrc_input_history jfw Implement input history, by use of a new data structure for rings (cyclic lists). 768775 yrc_kill_yank jfw Implement the basic kill and yank commands. Also: rename prompt-backward command to prompt-back, to avert confusion with the anticipated prompt-back-word; update manual for the new commands plus clarifications & updated priorities. 768776 yrc_prompt_redraw_optimization jfw Optimize and clarify prompt drawing code; remove unneeded prompt_set_hscroll for consistency (this turned out to be needed after all; see an upcoming patch for fix and explanation). +768777 yrc_minor_command_reorder_2 jfw Reverse presentation order of back/forward prompt commands for consistency; also comment on possibly confusing differences between ctrl/meta functions. diff -uNr a/yrc/manual.txt b/yrc/manual.txt --- a/yrc/manual.txt 208ab21d9080f17919659ac71137084c4cbb8ff013fc4efac4dbfcbf713ea94d55ecbe864d3e2d194ce83b1074abe2eb8db2c97909dd1748db36f375eb1d5595 +++ b/yrc/manual.txt 19368f1ab78bfbabd8a76ba4479d19b367086a5110f3f556f856f8da97f437d381a0036317f57c04cce4374ab45eefa8b6c41be2464af2372a422342437cf5f6 @@ -243,13 +243,13 @@ Moves focus to the scrollback window (see 3.2.4). - C-f, Right: prompt-forward + C-b, Left: prompt-back -Moves the cursor forward by one character. +Moves the cursor backward by one character. - C-b, Left: prompt-back + C-f, Right: prompt-forward -Moves the cursor backward by one character. +Moves the cursor forward by one character. C-a, Home: prompt-start diff -uNr a/yrc/yrc.py b/yrc/yrc.py --- a/yrc/yrc.py 431ad816f70f17cbc8eb50be23683af4c97a38e9bb5597d2dd6bc7b47ad5f087fe09a75682c0d92846145afb776083de91ed38e7088ce0ba244cbd4b398d576a +++ b/yrc/yrc.py 23e6700f25e00763e1c9b9db0d1586a617b3faf564ed83ba5450c58f5a6e3ad2bb8a2dbda6ad59f7ad959de983acb29e7f34294bad0a5615fc8011ed22749555 @@ -38,8 +38,10 @@ self_pipe_rd, self_pipe_wr = pipe() is_ctrl = lambda c: c < '\x20' or c == '\x7f' +# Toggle the control status of a character. As "control" isn't a dedicated bit, per ASCII table this is meaningful only for: @ A-Z [ \ ] ^ _ ? ctrl = lambda c: chr(ord(c) ^ 0x40) +# Meta or Alt weren't even so lucky as to get a fractional bit, so an escape sequence represents them. In principle this means case can be distinguished, and on xterm this even works, but on the Linux console Alt-Shift-x sends nothing at all, so best stick to lowercase. meta = lambda c: ESC + c BEL = chr(7) @@ -76,12 +78,12 @@ INS: 'prompt-exit', - ctrl('F'): 'prompt-forward', - RIGHT: 'prompt-forward', - ctrl('B'): 'prompt-back', LEFT: 'prompt-back', + ctrl('F'): 'prompt-forward', + RIGHT: 'prompt-forward', + ctrl('A'): 'prompt-start', HOME: 'prompt-start', LNX_HOME: 'prompt-start', @@ -917,8 +919,8 @@ except CommandError, e: error(e, cur_buf) -command('prompt-forward')(lambda: prompt_set_cursor(prompt_cursor() + 1)) command('prompt-back')(lambda: prompt_set_cursor(prompt_cursor() - 1)) +command('prompt-forward')(lambda: prompt_set_cursor(prompt_cursor() + 1)) command('prompt-start')(lambda: prompt_set_cursor(0)) @command('prompt-end')