aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2020-01-13 03:26:40 +0000
committerGitHub <noreply@github.com>2020-01-13 03:26:40 +0000
commitd2abc086894ed847752b7cdfe412f9bd845b5c4a (patch)
tree3c35abd44abacaf7a7d855c56a6a8c033e988b39 /main.c
parentUpdate ChangeLog (diff)
parentAdd command to go home. (diff)
downloadw3m-d2abc086894ed847752b7cdfe412f9bd845b5c4a.tar.gz
w3m-d2abc086894ed847752b7cdfe412f9bd845b5c4a.zip
Merge pull request #124 from butwerenotthereyet/go-home
Add command to go home.
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/main.c b/main.c
index 7bb058e..1cf8131 100644
--- a/main.c
+++ b/main.c
@@ -4256,6 +4256,23 @@ DEFUN(goURL, GOTO, "Open specified document in a new buffer")
goURL0("Goto URL: ", FALSE);
}
+DEFUN(goHome, GOTO_HOME, "Open home page in a new buffer")
+{
+ char *url;
+ if ((url = getenv("HTTP_HOME")) != NULL ||
+ (url = getenv("WWW_HOME")) != NULL) {
+ ParsedURL p_url;
+ Buffer *cur_buf = Currentbuf;
+ SKIP_BLANKS(url);
+ url = url_encode(url, NULL, 0);
+ parseURL2(url, &p_url, NULL);
+ pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr);
+ cmd_loadURL(url, NULL, NULL, NULL);
+ if (Currentbuf != cur_buf) /* success */
+ pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr);
+ }
+}
+
DEFUN(gorURL, GOTO_RELATIVE, "Go to relative address")
{
goURL0("Goto relative URL: ", TRUE);