summaryrefslogtreecommitdiff
path: root/emacs.c
diff options
context:
space:
mode:
Diffstat (limited to 'emacs.c')
-rw-r--r--emacs.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/emacs.c b/emacs.c
index ab1e2dfe1912..c96816ef2d9c 100644
--- a/emacs.c
+++ b/emacs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */
+/* $NetBSD: emacs.c,v 1.32 2016/02/16 22:53:14 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,14 +37,17 @@
#if 0
static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.32 2016/02/16 22:53:14 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
/*
* emacs.c: Emacs functions
*/
+#include <ctype.h>
+
#include "el.h"
+#include "emacs.h"
/* em_delete_or_list():
* Delete character under cursor or list completions if at end of line
@@ -52,7 +55,7 @@ __RCSID("$NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $");
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_or_list(EditLine *el, Int c)
+em_delete_or_list(EditLine *el, wint_t c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
@@ -88,7 +91,7 @@ em_delete_or_list(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
+em_delete_next_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *p, *kp;
@@ -117,7 +120,7 @@ em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_yank(EditLine *el, Int c __attribute__((__unused__)))
+em_yank(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -153,7 +156,7 @@ em_yank(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
+em_kill_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -175,7 +178,7 @@ em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
+em_kill_region(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -208,7 +211,7 @@ em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
+em_copy_region(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -237,14 +240,14 @@ em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
* Gosling emacs transpose chars [^T]
*/
protected el_action_t
-em_gosmacs_transpose(EditLine *el, Int c)
+em_gosmacs_transpose(EditLine *el, wint_t c)
{
if (el->el_line.cursor > &el->el_line.buffer[1]) {
/* must have at least two chars entered */
c = el->el_line.cursor[-2];
el->el_line.cursor[-2] = el->el_line.cursor[-1];
- el->el_line.cursor[-1] = c;
+ el->el_line.cursor[-1] = (Char)c;
return CC_REFRESH;
} else
return CC_ERROR;
@@ -257,7 +260,7 @@ em_gosmacs_transpose(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-em_next_word(EditLine *el, Int c __attribute__((__unused__)))
+em_next_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
return CC_ERROR;
@@ -282,7 +285,7 @@ em_next_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_upper_case(EditLine *el, Int c __attribute__((__unused__)))
+em_upper_case(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *ep;
@@ -306,7 +309,7 @@ em_upper_case(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_capitol_case(EditLine *el, Int c __attribute__((__unused__)))
+em_capitol_case(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *ep;
@@ -338,7 +341,7 @@ em_capitol_case(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_lower_case(EditLine *el, Int c __attribute__((__unused__)))
+em_lower_case(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *ep;
@@ -362,7 +365,7 @@ em_lower_case(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_set_mark(EditLine *el, Int c __attribute__((__unused__)))
+em_set_mark(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_chared.c_kill.mark = el->el_line.cursor;
@@ -376,7 +379,7 @@ em_set_mark(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_exchange_mark(EditLine *el, Int c __attribute__((__unused__)))
+em_exchange_mark(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp;
@@ -393,7 +396,7 @@ em_exchange_mark(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_universal_argument(EditLine *el, Int c __attribute__((__unused__)))
+em_universal_argument(EditLine *el, wint_t c __attribute__((__unused__)))
{ /* multiply current argument by 4 */
if (el->el_state.argument > 1000000)
@@ -410,7 +413,7 @@ em_universal_argument(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_meta_next(EditLine *el, Int c __attribute__((__unused__)))
+em_meta_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_state.metanext = 1;
@@ -423,7 +426,7 @@ em_meta_next(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_toggle_overwrite(EditLine *el, Int c __attribute__((__unused__)))
+em_toggle_overwrite(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_state.inputmode = (el->el_state.inputmode == MODE_INSERT) ?
@@ -437,7 +440,7 @@ em_toggle_overwrite(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+em_copy_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *oldc, *dp;
@@ -464,7 +467,7 @@ em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_inc_search_next(EditLine *el, Int c __attribute__((__unused__)))
+em_inc_search_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_search.patlen = 0;
@@ -477,7 +480,7 @@ em_inc_search_next(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_inc_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+em_inc_search_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_search.patlen = 0;
@@ -491,7 +494,7 @@ em_inc_search_prev(EditLine *el, Int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+em_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor <= el->el_line.buffer)