[w3m-dev 03521] sync option

* display.c (redrawNLine): calcTabPos()
* func.c (initKeymap): return if keymap_initialized
* main.c (calcTabPos): no more static
	(main): move sync_with_option, initCookie, setLocalCookie
		move backend
		move initKeymap, initMouseAction, initMenu
		remove calcTabPos
		add displayBuffer
	(numTab): static
	(deleteTab): delete calcTabPos
	(moveTab): delete calcTabPos
* proto.h (calcTabPos): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-12-04 16:45:40 +00:00
parent fcc7d09085
commit f8e094d717
5 changed files with 39 additions and 37 deletions
+17 -1
View File
@@ -1,3 +1,19 @@
2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03521] sync option
* display.c (redrawNLine): calcTabPos()
* func.c (initKeymap): return if keymap_initialized
* main.c (calcTabPos): no more static
(main): move sync_with_option, initCookie, setLocalCookie
move backend
move initKeymap, initMouseAction, initMenu
remove calcTabPos
add displayBuffer
(numTab): static
(deleteTab): delete calcTabPos
(moveTab): delete calcTabPos
* proto.h (calcTabPos): added
2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> 2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev-en 00841] Re: w3m segfaults if the terminal is not writable * [w3m-dev-en 00841] Re: w3m segfaults if the terminal is not writable
@@ -5399,4 +5415,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.583 2002/12/04 16:38:53 ukai Exp $ $Id: ChangeLog,v 1.584 2002/12/04 16:45:40 ukai Exp $
+2 -1
View File
@@ -1,4 +1,4 @@
/* $Id: display.c,v 1.42 2002/12/03 15:52:38 ukai Exp $ */ /* $Id: display.c,v 1.43 2002/12/04 16:45:41 ukai Exp $ */
#include <signal.h> #include <signal.h>
#include "fm.h" #include "fm.h"
@@ -453,6 +453,7 @@ redrawNLine(Buffer *buf, int n)
TabBuffer *t; TabBuffer *t;
int l; int l;
calcTabPos();
move(0, 0); move(0, 0);
#ifdef USE_MOUSE #ifdef USE_MOUSE
if (mouse_action.menu_str) if (mouse_action.menu_str)
+2 -2
View File
@@ -1,4 +1,4 @@
/* $Id: func.c,v 1.20 2002/12/03 16:09:41 ukai Exp $ */ /* $Id: func.c,v 1.21 2002/12/04 16:45:41 ukai Exp $ */
/* /*
* w3m func.c * w3m func.c
*/ */
@@ -120,7 +120,7 @@ initKeymap(int force)
struct stat kstat; struct stat kstat;
extern int str_to_bool(char *value, int old); extern int str_to_bool(char *value, int old);
if (!force && !keymap_initialized) if (!force && keymap_initialized)
return; return;
if ((kf = fopen(rcFile(keymap_file), "rt")) == NULL || if ((kf = fopen(rcFile(keymap_file), "rt")) == NULL ||
+16 -32
View File
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.158 2002/12/03 16:09:43 ukai Exp $ */ /* $Id: main.c,v 1.159 2002/12/04 16:45:41 ukai Exp $ */
#define MAINPROGRAM #define MAINPROGRAM
#include "fm.h" #include "fm.h"
#include <signal.h> #include <signal.h>
@@ -102,7 +102,6 @@ void set_buffer_environ(Buffer *);
static void _followForm(int); static void _followForm(int);
static void _goLine(char *); static void _goLine(char *);
static void _newT(void); static void _newT(void);
static void calcTabPos(void);
static void followTab(TabBuffer * tab); static void followTab(TabBuffer * tab);
static void moveTab(TabBuffer * t, TabBuffer * t2, int right); static void moveTab(TabBuffer * t, TabBuffer * t2, int right);
static int check_target = TRUE; static int check_target = TRUE;
@@ -710,12 +709,6 @@ main(int argc, char **argv, char **envp)
i++; i++;
} }
sync_with_option();
#ifdef USE_COOKIE
initCookie();
#endif /* USE_COOKIE */
setLocalCookie(); /* setup cookie for local CGI */
#ifdef __WATT32__ #ifdef __WATT32__
if (w3m_debug) if (w3m_debug)
dbug_init(); dbug_init();
@@ -742,9 +735,7 @@ main(int argc, char **argv, char **envp)
#ifdef USE_BINMODE_STREAM #ifdef USE_BINMODE_STREAM
setmode(fileno(stdout), O_BINARY); setmode(fileno(stdout), O_BINARY);
#endif #endif
if (w3m_backend) if (!w3m_dump && !w3m_backend) {
backend();
if (!w3m_dump) {
fmInit(); fmInit();
#ifdef SIGWINCH #ifdef SIGWINCH
signal(SIGWINCH, resize_hook); signal(SIGWINCH, resize_hook);
@@ -752,18 +743,21 @@ main(int argc, char **argv, char **envp)
setlinescols(); setlinescols();
setupscreen(); setupscreen();
#endif /* not SIGWINCH */ #endif /* not SIGWINCH */
initKeymap(TRUE);
#ifdef USE_MOUSE
initMouseAction();
#endif /* MOUSE */
#ifdef USE_MENU
initMenu();
#endif /* MENU */
} }
#ifdef USE_IMAGE #ifdef USE_IMAGE
else if (w3m_halfdump && displayImage) else if (w3m_halfdump && displayImage)
activeImage = TRUE; activeImage = TRUE;
#endif #endif
sync_with_option();
#ifdef USE_COOKIE
initCookie();
#endif /* USE_COOKIE */
setLocalCookie(); /* setup cookie for local CGI */
if (w3m_backend)
backend();
#ifdef SIGCHLD #ifdef SIGCHLD
signal(SIGCHLD, sig_chld); signal(SIGCHLD, sig_chld);
#endif #endif
@@ -902,7 +896,6 @@ main(int argc, char **argv, char **envp)
if (CurrentTab == NULL) { if (CurrentTab == NULL) {
FirstTab = LastTab = CurrentTab = newTab(); FirstTab = LastTab = CurrentTab = newTab();
nTab = 1; nTab = 1;
calcTabPos();
Firstbuf = Currentbuf = newbuf; Firstbuf = Currentbuf = newbuf;
} }
else if (open_new_tab) { else if (open_new_tab) {
@@ -949,7 +942,6 @@ main(int argc, char **argv, char **envp)
if (!FirstTab) { if (!FirstTab) {
FirstTab = LastTab = CurrentTab = newTab(); FirstTab = LastTab = CurrentTab = newTab();
nTab = 1; nTab = 1;
calcTabPos();
} }
if (!Firstbuf || Firstbuf == NO_BUFFER) { if (!Firstbuf || Firstbuf == NO_BUFFER) {
Firstbuf = Currentbuf = newBuffer(INIT_BUFFER_WIDTH); Firstbuf = Currentbuf = newBuffer(INIT_BUFFER_WIDTH);
@@ -5590,19 +5582,14 @@ reinit()
#ifdef USE_COOKIE #ifdef USE_COOKIE
initCookie(); initCookie();
#endif #endif
initKeymap(TRUE); displayBuffer(Currentbuf, B_REDRAW_IMAGE);
#ifdef USE_MOUSE
initMouseAction();
#endif
#ifdef USE_MENU
initMenu();
#endif
return; return;
} }
if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) { if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) {
init_rc(config_filename); init_rc(config_filename);
sync_with_option(); sync_with_option();
displayBuffer(Currentbuf, B_REDRAW_IMAGE);
return; return;
} }
@@ -5713,7 +5700,6 @@ _newT(void)
CurrentTab->nextTab = tag; CurrentTab->nextTab = tag;
CurrentTab = tag; CurrentTab = tag;
nTab++; nTab++;
calcTabPos();
} }
void void
@@ -5723,7 +5709,7 @@ newT(void)
displayBuffer(Currentbuf, B_REDRAW_IMAGE); displayBuffer(Currentbuf, B_REDRAW_IMAGE);
} }
TabBuffer * static TabBuffer *
numTab(int n) numTab(int n)
{ {
TabBuffer *tab; TabBuffer *tab;
@@ -5739,7 +5725,7 @@ numTab(int n)
return tab; return tab;
} }
static void void
calcTabPos(void) calcTabPos(void)
{ {
TabBuffer *tab; TabBuffer *tab;
@@ -5819,7 +5805,6 @@ deleteTab(TabBuffer * tab)
CurrentTab = tab->nextTab; CurrentTab = tab->nextTab;
} }
nTab--; nTab--;
calcTabPos();
buf = tab->firstBuffer; buf = tab->firstBuffer;
while (buf && buf != NO_BUFFER) { while (buf && buf != NO_BUFFER) {
next = buf->nextBuffer; next = buf->nextBuffer;
@@ -6018,7 +6003,6 @@ moveTab(TabBuffer * t, TabBuffer * t2, int right)
FirstTab = t; FirstTab = t;
t2->prevTab = t; t2->prevTab = t;
} }
calcTabPos();
displayBuffer(Currentbuf, B_FORCE_REDRAW); displayBuffer(Currentbuf, B_FORCE_REDRAW);
} }
+2 -1
View File
@@ -1,4 +1,4 @@
/* $Id: proto.h,v 1.64 2002/12/03 16:01:44 ukai Exp $ */ /* $Id: proto.h,v 1.65 2002/12/04 16:45:41 ukai Exp $ */
/* /*
* This file was automatically generated by version 1.7 of cextract. * This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended. * Manual editing not recommended.
@@ -227,6 +227,7 @@ extern int matchattr(char *p, char *attr, int len, Str *value);
extern void readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu); extern void readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu);
extern char *checkHeader(Buffer *buf, char *field); extern char *checkHeader(Buffer *buf, char *field);
extern TabBuffer *newTab(void); extern TabBuffer *newTab(void);
extern void calcTabPos(void);
extern TabBuffer *deleteTab(TabBuffer *tab); extern TabBuffer *deleteTab(TabBuffer *tab);
extern void addDownloadList(pid_t pid, char *url, char *save, char *lock, extern void addDownloadList(pid_t pid, char *url, char *save, char *lock,
clen_t size); clen_t size);