w3m

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

commit 301719b78a2693b7d1ec533c36ed94d3c7a24b18
parent 5af215ef85394e6b1d3e2bd243b87943e249ae75
Author: ukai <ukai>
Date:   Tue, 22 Jan 2002 16:59:11 +0000

[w3m-dev 02885] Re: goURL
* funcname.tab (GOTO_RELATIVE): added
* main.c (goURL0): renamed from goURL
  don't add http:// here, if base URL is NULL, cmd_loadURL() will add http:// when necessary
* main.c (goURL): go to URL with current URL
* main.c (gorURL): go to relative URL
* proto.h (gorURL): added
* doc/README.func (GOTO_RELATIVE): added
* doc-jp/README.func (GOTO_RELATIVE): ditto
From: Fumitoshi UKAI  <ukai@debian.or.jp>

Diffstat:
MChangeLog | 13+++++++++++++
Mdoc-jp/README.func | 1+
Mdoc/README.func | 1+
Mfuncname.tab | 1+
Mmain.c | 35+++++++++++++++++++++--------------
Mproto.h | 1+
6 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,16 @@ +2002-01-23 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 02885] Re: goURL + * funcname.tab (GOTO_RELATIVE): added + * main.c (goURL0): renamed from goURL + don't add http:// here, if base URL is NULL, cmd_loadURL() + will add http:// when necessary + * main.c (goURL): go to URL with current URL + * main.c (gorURL): go to relative URL + * proto.h (gorURL): added + * doc/README.func (GOTO_RELATIVE): added + * doc-jp/README.func (GOTO_RELATIVE): ditto + 2002-01-22 Fumitoshi UKAI <ukai@debian.or.jp> * [w3m-dev-en 00670] GOTO behavior change diff --git a/doc-jp/README.func b/doc-jp/README.func @@ -23,6 +23,7 @@ FRAME <FRAME> GOTO URLを指定して開きます GOTO_LINE 画面下で行番号を入力し,そこで指定した行に移動します GOTO_LINK リンクが指す先の文書を読みこみます +GOTO_RELATIVE 相対URLを指定して開きます HELP ヘルプファイルを表示します HISTORY URL履歴を表示します INFO 現在の文書に関する情報を表示します diff --git a/doc/README.func b/doc/README.func @@ -23,6 +23,7 @@ FRAME Render frame GOTO Go to URL GOTO_LINE Go to specified line GOTO_LINK Go to current link +GOTO_RELATIVE Go to relative URL HELP View help HISTORY View history of URL INFO View info of current document diff --git a/funcname.tab b/funcname.tab @@ -29,6 +29,7 @@ FRAME rFrame GOTO goURL GOTO_LINE goLine GOTO_LINK followA +GOTO_RELATIVE gorURL HELP ldhelp HISTORY ldHist INFO pginfo diff --git a/main.c b/main.c @@ -3611,28 +3611,23 @@ cmd_loadURL(char *url, ParsedURL *current) /* go to specified URL */ -void -goURL(void) +static void +goURL0(char *prompt, char *def_url) { char *url; ParsedURL p_url; + ParsedURL *b_url; + b_url = baseURL(Currentbuf); url = searchKeyData(); if (url == NULL) { - Str cur_url = parsedURL2Str(&Currentbuf->currentURL); - ParsedURL pu; if (!(Currentbuf->bufferprop & BP_INTERNAL)) - pushHashHist(URLHist, cur_url->ptr); - url = inputLineHist("Goto URL: ", cur_url->ptr, IN_URL, URLHist); + pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr); + url = inputLineHist(prompt, def_url, IN_URL, URLHist); if (url != NULL) { SKIP_BLANKS(url); - parseURL(url, &pu, NULL); - if (retryAsHttp) { - if ((pu.scheme == SCM_MISSING) - || ((pu.scheme == SCM_LOCAL) - && (strncmp(url, "file:", 5) != 0))) - url = Sprintf("http://%s", url)->ptr; - } + if (def_url != NULL) + b_url = NULL; /* XXX: for retryAsHttp */ } } #ifdef JP_CHARSET @@ -3653,7 +3648,19 @@ goURL(void) } parseURL2(url, &p_url, baseURL(Currentbuf)); pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr); - cmd_loadURL(url, baseURL(Currentbuf)); + cmd_loadURL(url, b_url); +} + +void +goURL(void) +{ + goURL0("Goto URL: ", parsedURL2Str(&Currentbuf->currentURL)->ptr); +} + +void +gorURL(void) +{ + goURL0("Goto relative URL: ", NULL); } static void diff --git a/proto.h b/proto.h @@ -74,6 +74,7 @@ extern void nextU(void); extern void backBf(void); extern void deletePrevBuf(void); extern void goURL(void); +extern void gorURL(void); extern void ldBmark(void); extern void adBmark(void); extern void ldOpt(void);