]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - readline/examples/rlkeymaps.c
6 #if defined (READLINE_LIBRARY)
10 # include <readline/readline.h>
11 # include <readline/history.h>
15 main (int c
, char **v
)
17 Keymap nmap
, emacsmap
, newemacs
;
21 nmap
= rl_make_keymap ();
23 r
= rl_set_keymap_name ("emacs", nmap
);
26 fprintf (stderr
, "rlkeymaps: error: able to rename `emacs' keymap\n");
30 emacsmap
= rl_get_keymap_by_name ("emacs");
31 r
= rl_set_keymap_name ("newemacs", emacsmap
);
34 fprintf (stderr
, "rlkeymaps: error: able to set new name for emacs keymap\n");
38 r
= rl_set_keymap_name ("newemacs", nmap
);
41 fprintf (stderr
, "rlkeymaps: error: newemacs: could not set keymap name\n");
45 newemacs
= rl_copy_keymap (emacsmap
);
46 r
= rl_set_keymap_name ("newemacs", newemacs
);
49 fprintf (stderr
, "rlkeymaps: error: newemacs: could not set `newemacs' keymap to new map\n");
53 r
= rl_set_keymap_name ("emacscopy", newemacs
);
56 fprintf (stderr
, "rlkeymaps: error: emacscopy: could not rename created keymap\n");