diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-06-01 16:50:16 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-06-01 16:50:16 +0000 |
commit | fc4b6e4a93dc91fea7b64e9230d8aea9bcfe99ee (patch) | |
tree | 3aeb231080b2ce828adb5d294045ce00b06501f3 /main.c | |
parent | [w3m-dev 03196] C-w (diff) | |
download | w3m-fc4b6e4a93dc91fea7b64e9230d8aea9bcfe99ee.tar.gz w3m-fc4b6e4a93dc91fea7b64e9230d8aea9bcfe99ee.zip |
[w3m-dev 03200] Re: New configuration option ``keymap_file'' and new command ``DEFINE_KEY''
* fm.h: add <sts/stat.h>, unistd.h>
* fm.h (keymap_file): added
* func.c (keymap_initialized): added
(current_keymap_file): added
(setKeymap): added
(initKeymap): rewrite to use setKeymap()
* funcname.tab (DEFINE_KEY): added
* main.c (MAIN): initKeymap(TRUE)
(defKey): added
* proto.h (defKey): added
(setKeymap): added
(initKeymap): add force param
* rc.c (CMT_KEYMAP_FILE): added
(params3): add keymap_file
(sync_with_option): add initKeymap(FALSE)
* doc/README.func (DEFINE_KEY): added
* doc-jp/README.func: (DEFINE_KEY): added
* scripts/w3mhelp.cgi.in: add defKey
* NEWS:
func: DEFINE_KEY
rc: keymap_file
From: Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.99 2002/04/26 16:06:34 ukai Exp $ */ +/* $Id: main.c,v 1.100 2002/06/01 16:50:16 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -724,7 +724,7 @@ MAIN(int argc, char **argv, char **envp) if (w3m_backend) backend(); if (!w3m_dump) { - initKeymap(); + initKeymap(TRUE); #ifdef USE_MENU initMenu(); #endif /* MENU */ @@ -5091,3 +5091,21 @@ setAlarmEvent(int sec, short status, int cmd, void *data) } } #endif + +void +defKey(void) +{ + char *data; + + CurrentKeyData = NULL; /* not allowed in w3m-control: */ + data = searchKeyData(); + if (data == NULL || *data == '\0') { + data = inputStrHist("Key definition: ", "", TextHist); + if (data == NULL || *data == '\0') { + displayBuffer(Currentbuf, B_NORMAL); + return; + } + } + setKeymap(allocStr(data, -1), -1, TRUE); + displayBuffer(Currentbuf, B_NORMAL); +} |