[w3m-dev 03541] Re: W3M_LINE_NO / W3M_CURRENT_COLUMN
* main.c (goLine): check searchKeyData() (set_buffer_environ): W3M_CURRENT_* From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03541] Re: W3M_LINE_NO / W3M_CURRENT_COLUMN
|
||||||
|
* main.c (goLine): check searchKeyData()
|
||||||
|
(set_buffer_environ): W3M_CURRENT_*
|
||||||
|
|
||||||
2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 03536] <del>, <s>
|
* [w3m-dev 03536] <del>, <s>
|
||||||
@@ -5583,4 +5589,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.599 2002/12/06 16:49:18 ukai Exp $
|
$Id: ChangeLog,v 1.600 2002/12/09 15:21:12 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: main.c,v 1.160 2002/12/05 16:29:08 ukai Exp $ */
|
/* $Id: main.c,v 1.161 2002/12/09 15:21:13 ukai Exp $ */
|
||||||
#define MAINPROGRAM
|
#define MAINPROGRAM
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -2392,8 +2392,12 @@ _goLine(char *l)
|
|||||||
void
|
void
|
||||||
goLine(void)
|
goLine(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
char *str = searchKeyData();
|
||||||
if (prec_num)
|
if (prec_num)
|
||||||
_goLine("^");
|
_goLine("^");
|
||||||
|
else if (str)
|
||||||
|
_goLine(str);
|
||||||
else
|
else
|
||||||
_goLine(inputStr("Goto line: ", ""));
|
_goLine(inputStr("Goto line: ", ""));
|
||||||
}
|
}
|
||||||
@@ -5358,50 +5362,64 @@ dictwordat(void)
|
|||||||
void
|
void
|
||||||
set_buffer_environ(Buffer *buf)
|
set_buffer_environ(Buffer *buf)
|
||||||
{
|
{
|
||||||
Anchor *a;
|
static Buffer *prev_buf = NULL;
|
||||||
Str s;
|
static Line *prev_line = NULL;
|
||||||
ParsedURL pu;
|
static short prev_col = -1, prev_pos = -1;
|
||||||
|
Line *l;
|
||||||
|
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return;
|
return;
|
||||||
|
if (buf != prev_buf) {
|
||||||
set_environ("W3M_SOURCEFILE", buf->sourcefile);
|
set_environ("W3M_SOURCEFILE", buf->sourcefile);
|
||||||
set_environ("W3M_FILENAME", buf->filename);
|
set_environ("W3M_FILENAME", buf->filename);
|
||||||
set_environ("W3M_CURRENT_WORD", GetWord(buf));
|
|
||||||
set_environ("W3M_TITLE", buf->buffername);
|
set_environ("W3M_TITLE", buf->buffername);
|
||||||
set_environ("W3M_URL", parsedURL2Str(&buf->currentURL)->ptr);
|
set_environ("W3M_URL", parsedURL2Str(&buf->currentURL)->ptr);
|
||||||
if (buf->real_type)
|
set_environ("W3M_TYPE", buf->real_type ? buf->real_type : "unknown");
|
||||||
set_environ("W3M_TYPE", buf->real_type);
|
|
||||||
else
|
|
||||||
set_environ("W3M_TYPE", "unknown");
|
|
||||||
#ifdef JP_CHARSET
|
#ifdef JP_CHARSET
|
||||||
set_environ("W3M_CHARSET", code_to_str(buf->document_code));
|
set_environ("W3M_CHARSET", code_to_str(buf->document_code));
|
||||||
#endif /* JP_CHARSET */
|
#endif /* JP_CHARSET */
|
||||||
|
}
|
||||||
|
l = buf->currentLine;
|
||||||
|
if (l && (buf != prev_buf || l != prev_line || buf->pos != prev_pos)) {
|
||||||
|
Anchor *a;
|
||||||
|
ParsedURL pu;
|
||||||
|
char *s = GetWord(buf);
|
||||||
|
set_environ("W3M_CURRENT_WORD", s ? s : "");
|
||||||
a = retrieveCurrentAnchor(buf);
|
a = retrieveCurrentAnchor(buf);
|
||||||
if (a == NULL) {
|
if (a) {
|
||||||
|
parseURL2(a->url, &pu, baseURL(buf));
|
||||||
|
set_environ("W3M_CURRENT_LINK", parsedURL2Str(&pu)->ptr);
|
||||||
|
}
|
||||||
|
else
|
||||||
set_environ("W3M_CURRENT_LINK", "");
|
set_environ("W3M_CURRENT_LINK", "");
|
||||||
}
|
|
||||||
else {
|
|
||||||
parseURL2(a->url, &pu, baseURL(buf));
|
|
||||||
s = parsedURL2Str(&pu);
|
|
||||||
set_environ("W3M_CURRENT_LINK", s->ptr);
|
|
||||||
}
|
|
||||||
a = retrieveCurrentImg(buf);
|
a = retrieveCurrentImg(buf);
|
||||||
if (a == NULL) {
|
if (a) {
|
||||||
set_environ("W3M_CURRENT_IMG", "");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parseURL2(a->url, &pu, baseURL(buf));
|
parseURL2(a->url, &pu, baseURL(buf));
|
||||||
s = parsedURL2Str(&pu);
|
set_environ("W3M_CURRENT_IMG", parsedURL2Str(&pu)->ptr);
|
||||||
set_environ("W3M_CURRENT_IMG", s->ptr);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
set_environ("W3M_CURRENT_IMG", "");
|
||||||
a = retrieveCurrentForm(buf);
|
a = retrieveCurrentForm(buf);
|
||||||
if (a == NULL) {
|
if (a)
|
||||||
|
set_environ("W3M_CURRENT_FORM", form2str((FormItemList *)a->url));
|
||||||
|
else
|
||||||
set_environ("W3M_CURRENT_FORM", "");
|
set_environ("W3M_CURRENT_FORM", "");
|
||||||
|
set_environ("W3M_CURRENT_LINE", Sprintf("%d",
|
||||||
|
l->real_linenumber)->ptr);
|
||||||
|
set_environ("W3M_CURRENT_COLUMN", Sprintf("%d",
|
||||||
|
buf->currentColumn + buf->cursorX + 1)->ptr);
|
||||||
}
|
}
|
||||||
else {
|
else if (!l) {
|
||||||
s = Strnew_charp(form2str((FormItemList *)a->url));
|
set_environ("W3M_CURRENT_WORD", "");
|
||||||
set_environ("W3M_CURRENT_FORM", s->ptr);
|
set_environ("W3M_CURRENT_LINK", "");
|
||||||
|
set_environ("W3M_CURRENT_IMG", "");
|
||||||
|
set_environ("W3M_CURRENT_FORM", "");
|
||||||
|
set_environ("W3M_CURRENT_LINE", "0");
|
||||||
|
set_environ("W3M_CURRENT_COLUMN", "0");
|
||||||
}
|
}
|
||||||
|
prev_buf = buf;
|
||||||
|
prev_line = l;
|
||||||
|
prev_pos = buf->pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|||||||
Reference in New Issue
Block a user