w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 08468153a72b838b526b46c8caf0fbf36d7bd9cc
parent c8dda29157ef03b4e8466f832f142a585f9b1550
Author: ukai <ukai>
Date:   Wed,  4 Dec 2002 16:45:40 +0000

[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>

Diffstat:
MChangeLog | 16++++++++++++++++
Mdisplay.c | 1+
Mfunc.c | 2+-
Mmain.c | 46+++++++++++++++-------------------------------
Mproto.h | 1+
5 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,21 @@ 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> + * [w3m-dev-en 00841] Re: w3m segfaults if the terminal is not writable * terms.c (reset_tty): don't close stderr diff --git a/display.c b/display.c @@ -453,6 +453,7 @@ redrawNLine(Buffer *buf, int n) TabBuffer *t; int l; + calcTabPos(); move(0, 0); #ifdef USE_MOUSE if (mouse_action.menu_str) diff --git a/func.c b/func.c @@ -120,7 +120,7 @@ initKeymap(int force) struct stat kstat; extern int str_to_bool(char *value, int old); - if (!force && !keymap_initialized) + if (!force && keymap_initialized) return; if ((kf = fopen(rcFile(keymap_file), "rt")) == NULL || diff --git a/main.c b/main.c @@ -102,7 +102,6 @@ void set_buffer_environ(Buffer *); static void _followForm(int); static void _goLine(char *); static void _newT(void); -static void calcTabPos(void); static void followTab(TabBuffer * tab); static void moveTab(TabBuffer * t, TabBuffer * t2, int right); static int check_target = TRUE; @@ -710,12 +709,6 @@ main(int argc, char **argv, char **envp) i++; } - sync_with_option(); -#ifdef USE_COOKIE - initCookie(); -#endif /* USE_COOKIE */ - setLocalCookie(); /* setup cookie for local CGI */ - #ifdef __WATT32__ if (w3m_debug) dbug_init(); @@ -742,9 +735,7 @@ main(int argc, char **argv, char **envp) #ifdef USE_BINMODE_STREAM setmode(fileno(stdout), O_BINARY); #endif - if (w3m_backend) - backend(); - if (!w3m_dump) { + if (!w3m_dump && !w3m_backend) { fmInit(); #ifdef SIGWINCH signal(SIGWINCH, resize_hook); @@ -752,18 +743,21 @@ main(int argc, char **argv, char **envp) setlinescols(); setupscreen(); #endif /* not SIGWINCH */ - initKeymap(TRUE); -#ifdef USE_MOUSE - initMouseAction(); -#endif /* MOUSE */ -#ifdef USE_MENU - initMenu(); -#endif /* MENU */ } #ifdef USE_IMAGE else if (w3m_halfdump && displayImage) activeImage = TRUE; #endif + + sync_with_option(); +#ifdef USE_COOKIE + initCookie(); +#endif /* USE_COOKIE */ + setLocalCookie(); /* setup cookie for local CGI */ + + if (w3m_backend) + backend(); + #ifdef SIGCHLD signal(SIGCHLD, sig_chld); #endif @@ -902,7 +896,6 @@ main(int argc, char **argv, char **envp) if (CurrentTab == NULL) { FirstTab = LastTab = CurrentTab = newTab(); nTab = 1; - calcTabPos(); Firstbuf = Currentbuf = newbuf; } else if (open_new_tab) { @@ -949,7 +942,6 @@ main(int argc, char **argv, char **envp) if (!FirstTab) { FirstTab = LastTab = CurrentTab = newTab(); nTab = 1; - calcTabPos(); } if (!Firstbuf || Firstbuf == NO_BUFFER) { Firstbuf = Currentbuf = newBuffer(INIT_BUFFER_WIDTH); @@ -5590,19 +5582,14 @@ reinit() #ifdef USE_COOKIE initCookie(); #endif - initKeymap(TRUE); -#ifdef USE_MOUSE - initMouseAction(); -#endif -#ifdef USE_MENU - initMenu(); -#endif + displayBuffer(Currentbuf, B_REDRAW_IMAGE); return; } if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) { init_rc(config_filename); sync_with_option(); + displayBuffer(Currentbuf, B_REDRAW_IMAGE); return; } @@ -5713,7 +5700,6 @@ _newT(void) CurrentTab->nextTab = tag; CurrentTab = tag; nTab++; - calcTabPos(); } void @@ -5723,7 +5709,7 @@ newT(void) displayBuffer(Currentbuf, B_REDRAW_IMAGE); } -TabBuffer * +static TabBuffer * numTab(int n) { TabBuffer *tab; @@ -5739,7 +5725,7 @@ numTab(int n) return tab; } -static void +void calcTabPos(void) { TabBuffer *tab; @@ -5819,7 +5805,6 @@ deleteTab(TabBuffer * tab) CurrentTab = tab->nextTab; } nTab--; - calcTabPos(); buf = tab->firstBuffer; while (buf && buf != NO_BUFFER) { next = buf->nextBuffer; @@ -6018,7 +6003,6 @@ moveTab(TabBuffer * t, TabBuffer * t2, int right) FirstTab = t; t2->prevTab = t; } - calcTabPos(); displayBuffer(Currentbuf, B_FORCE_REDRAW); } diff --git a/proto.h b/proto.h @@ -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 char *checkHeader(Buffer *buf, char *field); extern TabBuffer *newTab(void); +extern void calcTabPos(void); extern TabBuffer *deleteTab(TabBuffer *tab); extern void addDownloadList(pid_t pid, char *url, char *save, char *lock, clen_t size);