aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-06-01 17:09:04 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-06-01 17:09:04 +0000
commit900682ebd541cad4fceb918c0ec37c3b1f98c78b (patch)
tree494cc6e76a948f9da7ed9dfc1d22e2c3b1b1a11f
parent[w3m-dev 03200] Re: New configuration option ``keymap_file'' and new command ... (diff)
downloadw3m-900682ebd541cad4fceb918c0ec37c3b1f98c78b.tar.gz
w3m-900682ebd541cad4fceb918c0ec37c3b1f98c78b.zip
[w3m-dev-en 00748] PATCH: Reinitialize w3m while running
* funcname.tab (INIT_MAILCAP): deleted (REINIT): added * main.c (config_filename): added (reinit): added * proto.h (reinit): added * rc.c (rc_initialized): deleted * w3mhelperpanel.c (editMailcap): use REINIT MAILCAP From: Tushar Samant <scribble@pobox.com>
Diffstat (limited to '')
-rw-r--r--ChangeLog13
-rw-r--r--NEWS2
-rw-r--r--funcname.tab4
-rw-r--r--main.c69
-rw-r--r--proto.h3
-rw-r--r--rc.c7
-rw-r--r--w3mhelperpanel.c4
7 files changed, 88 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index acb84c2..1e3f58e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-06-02 Tushar Samant <scribble@pobox.com>
+
+ * [w3m-dev-en 00748] PATCH: Reinitialize w3m while running
+ * funcname.tab (INIT_MAILCAP): deleted
+ (REINIT): added
+ * main.c (config_filename): added
+ (reinit): added
+ * proto.h (reinit): added
+ * rc.c (rc_initialized): deleted
+ * w3mhelperpanel.c (editMailcap): use REINIT MAILCAP
+
2002-06-02 Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
* [w3m-dev 03200] Re: New configuration option ``keymap_file'' and new command ``DEFINE_KEY''
@@ -3443,4 +3454,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.381 2002/06/01 16:50:16 ukai Exp $
+$Id: ChangeLog,v 1.382 2002/06/01 17:09:04 ukai Exp $
diff --git a/NEWS b/NEWS
index a267661..31143bd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
w3m 0.4?
+* func: REINIT
+ INIT_MAILCAP deleted, use REINIT MAILCAP instead
* func: DEFINE_KEY
* rc: keymap_file
* rc: use_dictcommand, dictcommand
diff --git a/funcname.tab b/funcname.tab
index a56f98e..e0f21b8 100644
--- a/funcname.tab
+++ b/funcname.tab
@@ -1,4 +1,4 @@
-# $Id: funcname.tab,v 1.9 2002/06/01 16:50:16 ukai Exp $
+# $Id: funcname.tab,v 1.10 2002/06/01 17:09:05 ukai Exp $
# macro name function name
#----------------------------
@@@ nulcmd
@@ -36,7 +36,6 @@ GOTO_RELATIVE gorURL
HELP ldhelp
HISTORY ldHist
INFO pginfo
-INIT_MAILCAP initMailcap
INTERRUPT susp
ISEARCH isrchfor
ISEARCH_BACK isrchbak
@@ -91,6 +90,7 @@ QUIT qquitfm
READ_SHELL readsh
REDRAW rdrwSc
REG_MARK reMark
+REINIT reinit
RELOAD reload
RIGHT col1R
SAVE svSrc
diff --git a/main.c b/main.c
index 5a48704..3d38d71 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.100 2002/06/01 16:50:16 ukai Exp $ */
+/* $Id: main.c,v 1.101 2002/06/01 17:09:05 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -25,6 +25,8 @@ extern int do_getch();
#define DSTR_LEN 256
+static char *config_filename = NULL;
+
Hist *LoadHist;
Hist *SaveHist;
Hist *URLHist;
@@ -354,7 +356,6 @@ MAIN(int argc, char **argv, char **envp)
char search_header = FALSE;
char *default_type = NULL;
char *post_file = NULL;
- char *config_filename = NULL;
Str err_msg;
#ifndef HAVE_SYS_ERRLIST
@@ -5093,6 +5094,70 @@ setAlarmEvent(int sec, short status, int cmd, void *data)
#endif
void
+reinit()
+{
+ char *resource = searchKeyData();
+
+ if (resource == NULL) {
+ init_rc(config_filename);
+#ifdef USE_COOKIE
+ initCookie();
+#endif
+ initKeymap();
+#ifdef USE_MENU
+ initMenu();
+#endif
+ return;
+ }
+
+ if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) {
+ init_rc(config_filename);
+ return;
+ }
+
+#ifdef USE_COOKIE
+ if (!strcasecmp(resource, "COOKIE")) {
+ initCookie();
+ return;
+ }
+#endif
+
+ if (!strcasecmp(resource, "KEYMAP")) {
+ initKeymap();
+ return;
+ }
+
+ if (!strcasecmp(resource, "MAILCAP")) {
+ initMailcap();
+ return;
+ }
+
+#ifdef USE_MENU
+ if (!strcasecmp(resource, "MENU")) {
+ initMenu();
+ return;
+ }
+#endif
+
+ if (!strcasecmp(resource, "MIMETYPES")) {
+ initMimeTypes();
+ return;
+ }
+
+#ifdef USE_EXTERNAL_URI_LOADER
+ if (!strcasecmp(resource, "URIMETHODS")) {
+ initURIMethods();
+ return;
+ }
+#endif
+
+ disp_err_message(
+ Sprintf("Don't know how to reinitialize '%s'", resource)->ptr,
+ FALSE
+ );
+}
+
+void
defKey(void)
{
char *data;
diff --git a/proto.h b/proto.h
index 7b30a43..7a7e82d 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.42 2002/06/01 16:50:16 ukai Exp $ */
+/* $Id: proto.h,v 1.43 2002/06/01 17:09:05 ukai Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
@@ -116,6 +116,7 @@ extern void setAlarmEvent(int sec, short status, int cmd, void *data);
#else
#define setAlarm nulcmd
#endif
+extern void reinit(void);
extern void defKey(void);
extern int currentLn(Buffer *buf);
extern void tmpClearBuffer(Buffer *buf);
diff --git a/rc.c b/rc.c
index 112f53e..a4b18e7 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.44 2002/06/01 16:50:16 ukai Exp $ */
+/* $Id: rc.c,v 1.45 2002/06/01 17:09:05 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -33,7 +33,6 @@ struct rc_search_table {
static struct rc_search_table *RC_search_table;
static int RC_table_size;
-static int rc_initialized = 0;
static char *config_file = NULL;
#define P_INT 0
@@ -1259,10 +1258,6 @@ init_rc(char *config_filename)
&& ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0'))
tmpdir = "/tmp";
- if (rc_initialized)
- return;
- rc_initialized = 1;
-
if (stat(rc_dir, &st) < 0) {
if (errno == ENOENT) { /* no directory */
if (do_mkdir(rc_dir, 0700) < 0) {
diff --git a/w3mhelperpanel.c b/w3mhelperpanel.c
index 87c602f..8de5348 100644
--- a/w3mhelperpanel.c
+++ b/w3mhelperpanel.c
@@ -1,4 +1,4 @@
-/* $Id: w3mhelperpanel.c,v 1.7 2001/12/02 16:26:08 ukai Exp $ */
+/* $Id: w3mhelperpanel.c,v 1.8 2002/06/01 17:09:05 ukai Exp $ */
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@@ -153,7 +153,7 @@ editMailcap(char *mailcap, struct parsed_tagarg *args)
fclose(f);
printf("Content-Type: text/plain\n");
printf("w3m-control: BACK\nw3m-control: BACK\n");
- printf("w3m-control: INIT_MAILCAP\n");
+ printf("w3m-control: REINIT MAILCAP\n");
}
int