add emacs_like_lineedit
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
2001-11-24 Fumitoshi UKAI <ukai@debian.or.jp
|
2001-11-24 Fumitoshi UKAI <ukai@debian.or.jp
|
||||||
|
|
||||||
|
* fm.h (emacs_like_lineedit): runtime option emacs_like_lineedit
|
||||||
|
* linein.c (inputLineHist): ditto
|
||||||
|
* linein.c (_esc): ditto
|
||||||
|
* linein.c (next_dcompl): ditto
|
||||||
|
* rc.c (CMT_EMACS_LIKE_LINEEDIT): ditto
|
||||||
|
* rc.c (params3): ditto
|
||||||
|
|
||||||
* fm.h (ftppass_hostnamegen): runtime option ftppass_hostnamegen
|
* fm.h (ftppass_hostnamegen): runtime option ftppass_hostnamegen
|
||||||
* ftp.c (FtpLogin): ditto
|
* ftp.c (FtpLogin): ditto
|
||||||
* rc.c (CMT_FTPPASS_HOSTNAMEGEN): ditto
|
* rc.c (CMT_FTPPASS_HOSTNAMEGEN): ditto
|
||||||
|
|||||||
5
fm.h
5
fm.h
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: fm.h,v 1.13 2001/11/23 20:23:41 ukai Exp $ */
|
/* $Id: fm.h,v 1.14 2001/11/23 20:50:59 ukai Exp $ */
|
||||||
/*
|
/*
|
||||||
* w3m: WWW wo Miru utility
|
* w3m: WWW wo Miru utility
|
||||||
*
|
*
|
||||||
@@ -703,6 +703,9 @@ global int useVisitedColor init(FALSE);
|
|||||||
global int visited_color init(5); /* magenta */
|
global int visited_color init(5); /* magenta */
|
||||||
#endif /* USE_COLOR */
|
#endif /* USE_COLOR */
|
||||||
global int confirm_on_quit init(TRUE);
|
global int confirm_on_quit init(TRUE);
|
||||||
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
|
global int emacs_like_lineedit init(FALSE);
|
||||||
|
#endif
|
||||||
global int displayLink init(FALSE);
|
global int displayLink init(FALSE);
|
||||||
global int retryAsHttp init(TRUE);
|
global int retryAsHttp init(TRUE);
|
||||||
global int showLineNum init(FALSE);
|
global int showLineNum init(FALSE);
|
||||||
|
|||||||
70
linein.c
70
linein.c
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: linein.c,v 1.6 2001/11/22 15:02:17 ukai Exp $ */
|
/* $Id: linein.c,v 1.7 2001/11/23 20:50:59 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "myctype.h"
|
#include "myctype.h"
|
||||||
@@ -37,10 +37,7 @@ static void insertself(char c),
|
|||||||
_mvB(void), _mvE(void), _enter(void), _quo(void), _bs(void), _bsw(void),
|
_mvB(void), _mvE(void), _enter(void), _quo(void), _bs(void), _bsw(void),
|
||||||
killn(void), killb(void), _inbrk(void), _esc(void),
|
killn(void), killb(void), _inbrk(void), _esc(void),
|
||||||
_prev(void), _next(void), _compl(void), _tcompl(void),
|
_prev(void), _next(void), _compl(void), _tcompl(void),
|
||||||
_dcompl(void), _rdcompl(void);
|
_dcompl(void), _rdcompl(void), _rcompl(void);
|
||||||
#ifndef EMACS_LIKE_LINEEDIT
|
|
||||||
static void _rcompl(void);
|
|
||||||
#endif
|
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
static int getcntrl(void);
|
static int getcntrl(void);
|
||||||
#endif
|
#endif
|
||||||
@@ -191,22 +188,27 @@ inputLineHist(char *prompt, char *def_str, int flag, Hist * hist)
|
|||||||
(((cm_mode & CPL_ALWAYS) && (c == CTRL_I || c == ' ')) ||
|
(((cm_mode & CPL_ALWAYS) && (c == CTRL_I || c == ' ')) ||
|
||||||
((cm_mode & CPL_ON) && (c == CTRL_I)))) {
|
((cm_mode & CPL_ON) && (c == CTRL_I)))) {
|
||||||
#ifdef EMACS_LIKE_LINEEDIT
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
if (cm_next) {
|
if (emacs_like_lineedit && cm_next) {
|
||||||
_dcompl();
|
_dcompl();
|
||||||
need_redraw = TRUE;
|
need_redraw = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_compl();
|
#endif
|
||||||
cm_disp_next = -1;
|
_compl();
|
||||||
}
|
cm_disp_next = -1;
|
||||||
#else
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
_compl();
|
}
|
||||||
cm_disp_next = -1;
|
#endif
|
||||||
}
|
}
|
||||||
else if (!i_quote && CLen == CPos &&
|
else if (!i_quote && CLen == CPos &&
|
||||||
(cm_mode & CPL_ALWAYS || cm_mode & CPL_ON) && c == CTRL_D) {
|
(cm_mode & CPL_ALWAYS || cm_mode & CPL_ON) && c == CTRL_D) {
|
||||||
_dcompl();
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
need_redraw = TRUE;
|
if (! emacs_like_lineedit) {
|
||||||
|
#endif
|
||||||
|
_dcompl();
|
||||||
|
need_redraw = TRUE;
|
||||||
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (!i_quote && c == DEL_CODE) {
|
else if (!i_quote && c == DEL_CODE) {
|
||||||
@@ -421,25 +423,35 @@ _esc(void)
|
|||||||
case CTRL_I:
|
case CTRL_I:
|
||||||
case ' ':
|
case ' ':
|
||||||
#ifdef EMACS_LIKE_LINEEDIT
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
_rdcompl();
|
if (emacs_like_lineedit) {
|
||||||
cm_clear = FALSE;
|
_rdcompl();
|
||||||
|
cm_clear = FALSE;
|
||||||
|
need_redraw = TRUE;
|
||||||
|
} else
|
||||||
#else
|
#else
|
||||||
_rcompl();
|
_rcompl();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case CTRL_D:
|
case CTRL_D:
|
||||||
_rdcompl();
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
|
if (!emacs_like_lineedit)
|
||||||
|
#else
|
||||||
|
_rdcompl();
|
||||||
#endif
|
#endif
|
||||||
need_redraw = TRUE;
|
need_redraw = TRUE;
|
||||||
break;
|
break;
|
||||||
#ifdef EMACS_LIKE_LINEEDIT
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
case 'f':
|
case 'f':
|
||||||
_mvRw();
|
if (emacs_like_lineedit)
|
||||||
|
_mvRw();
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
_mvLw();
|
if (emacs_like_lineedit)
|
||||||
|
_mvLw();
|
||||||
break;
|
break;
|
||||||
case CTRL_H:
|
case CTRL_H:
|
||||||
_bsw();
|
if (emacs_like_lineedit)
|
||||||
|
_bsw();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef JP_CHARSET
|
#ifdef JP_CHARSET
|
||||||
@@ -628,13 +640,11 @@ _compl(void)
|
|||||||
next_compl(1);
|
next_compl(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef EMACS_LIKE_LINEEDIT
|
|
||||||
static void
|
static void
|
||||||
_rcompl(void)
|
_rcompl(void)
|
||||||
{
|
{
|
||||||
next_compl(-1);
|
next_compl(-1);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_tcompl(void)
|
_tcompl(void)
|
||||||
@@ -815,9 +825,11 @@ disp_next:
|
|||||||
clrtoeolx();
|
clrtoeolx();
|
||||||
bold();
|
bold();
|
||||||
#ifdef EMACS_LIKE_LINEEDIT
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
addstr("----- Press TAB to continue -----");
|
if (emacs_like_lineedit)
|
||||||
|
addstr("----- Press TAB to continue -----");
|
||||||
|
else
|
||||||
#else
|
#else
|
||||||
addstr("----- Press CTRL-D to continue -----");
|
addstr("----- Press CTRL-D to continue -----");
|
||||||
#endif
|
#endif
|
||||||
boldend();
|
boldend();
|
||||||
}
|
}
|
||||||
|
|||||||
11
rc.c
11
rc.c
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: rc.c,v 1.8 2001/11/23 20:23:41 ukai Exp $ */
|
/* $Id: rc.c,v 1.9 2001/11/23 20:50:59 ukai Exp $ */
|
||||||
/*
|
/*
|
||||||
* Initialization file etc.
|
* Initialization file etc.
|
||||||
*/
|
*/
|
||||||
@@ -89,6 +89,9 @@ static int rc_initialized = 0;
|
|||||||
#define CMT_PDROOT "/~user で表されるディレクトリ"
|
#define CMT_PDROOT "/~user で表されるディレクトリ"
|
||||||
#define CMT_CGIBIN "/cgi-bin で表されるディレクトリ"
|
#define CMT_CGIBIN "/cgi-bin で表されるディレクトリ"
|
||||||
#define CMT_CONFIRM_QQ "q での終了時に確認する"
|
#define CMT_CONFIRM_QQ "q での終了時に確認する"
|
||||||
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
|
#define CMT_EMACS_LIKE_LINEEDIT "Emacs風の行編集にする"
|
||||||
|
#endif
|
||||||
#define CMT_SHOW_NUM "行番号を表示する"
|
#define CMT_SHOW_NUM "行番号を表示する"
|
||||||
#define CMT_MIMETYPES "利用するmime.types"
|
#define CMT_MIMETYPES "利用するmime.types"
|
||||||
#define CMT_MAILCAP "利用するmailcap"
|
#define CMT_MAILCAP "利用するmailcap"
|
||||||
@@ -187,6 +190,9 @@ static int rc_initialized = 0;
|
|||||||
#define CMT_PDROOT "Directory corresponds to /~user"
|
#define CMT_PDROOT "Directory corresponds to /~user"
|
||||||
#define CMT_CGIBIN "Directory corresponds to /cgi-bin"
|
#define CMT_CGIBIN "Directory corresponds to /cgi-bin"
|
||||||
#define CMT_CONFIRM_QQ "Confirm when quitting with q"
|
#define CMT_CONFIRM_QQ "Confirm when quitting with q"
|
||||||
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
|
#define CMT_EMACS_LIKE_LINEEDIT "Emacs-style line editing"
|
||||||
|
#endif
|
||||||
#define CMT_SHOW_NUM "Show line number"
|
#define CMT_SHOW_NUM "Show line number"
|
||||||
#define CMT_MIMETYPES "mime.types files"
|
#define CMT_MIMETYPES "mime.types files"
|
||||||
#define CMT_MAILCAP "mailcap files"
|
#define CMT_MAILCAP "mailcap files"
|
||||||
@@ -387,6 +393,9 @@ struct param_ptr params3[] =
|
|||||||
{"save_hist", P_INT, PI_ONOFF, (void *) &SaveURLHist, CMT_SAVEHIST, NULL},
|
{"save_hist", P_INT, PI_ONOFF, (void *) &SaveURLHist, CMT_SAVEHIST, NULL},
|
||||||
#endif /* USE_HISTORY */
|
#endif /* USE_HISTORY */
|
||||||
{"confirm_qq", P_INT, PI_ONOFF, (void *) &confirm_on_quit, CMT_CONFIRM_QQ, NULL},
|
{"confirm_qq", P_INT, PI_ONOFF, (void *) &confirm_on_quit, CMT_CONFIRM_QQ, NULL},
|
||||||
|
#ifdef EMACS_LIKE_LINEEDIT
|
||||||
|
{"emacs_like_lineedit", P_INT, PI_ONOFF, (void *) &emacs_like_lineedit, CMT_EMACS_LIKE_LINEEDIT, NULL },
|
||||||
|
#endif
|
||||||
{"wrap_search", P_INT, PI_ONOFF, (void *) &WrapDefault, CMT_WRAP, NULL},
|
{"wrap_search", P_INT, PI_ONOFF, (void *) &WrapDefault, CMT_WRAP, NULL},
|
||||||
{"ignorecase_search", P_INT, PI_ONOFF, (void *) &IgnoreCase, CMT_IGNORE_CASE, NULL},
|
{"ignorecase_search", P_INT, PI_ONOFF, (void *) &IgnoreCase, CMT_IGNORE_CASE, NULL},
|
||||||
#ifdef USE_MOUSE
|
#ifdef USE_MOUSE
|
||||||
|
|||||||
Reference in New Issue
Block a user