diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-04-06 16:27:53 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-04-06 16:27:53 +0000 |
commit | a603190b2e1702537f859a648eb5e2b6910ff2e4 (patch) | |
tree | 6ae3da1ae67bc54359266d1939ca98395e32ec54 | |
parent | [w3m-dev 03838] W3M_LIBS splitted from LIBS (diff) | |
download | w3m-a603190b2e1702537f859a648eb5e2b6910ff2e4.tar.gz w3m-a603190b2e1702537f859a648eb5e2b6910ff2e4.zip |
[w3m-dev 03843] cleanup macros
* config.h.dist config.h.in etc.c file.c fm.h ftp.c linein.c
main.c rc.c:
delete EMACS_LIKE_LINEEDIT, VI_PREC_NUM, LABEL_TOPLINE,
NEXTPAGE_TOPLINE, FTPPASS_HOSTNAMEGEN
use_mark default FALSE
emacs_like_lineedit default FALSE
vi_prec_num default FALSE
add UseHistory, use_history
* NEWS: rc: use_history
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | config.h.dist | 5 | ||||
-rw-r--r-- | config.h.in | 7 | ||||
-rw-r--r-- | etc.c | 4 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | fm.h | 19 | ||||
-rw-r--r-- | ftp.c | 6 | ||||
-rw-r--r-- | linein.c | 18 | ||||
-rw-r--r-- | main.c | 17 | ||||
-rw-r--r-- | rc.c | 35 |
11 files changed, 33 insertions, 98 deletions
@@ -1,3 +1,16 @@ +2003-04-07 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 03843] cleanup macros + * config.h.dist config.h.in etc.c file.c fm.h ftp.c linein.c + main.c rc.c: + delete EMACS_LIKE_LINEEDIT, VI_PREC_NUM, LABEL_TOPLINE, + NEXTPAGE_TOPLINE, FTPPASS_HOSTNAMEGEN + use_mark default FALSE + emacs_like_lineedit default FALSE + vi_prec_num default FALSE + add UseHistory, use_history + * NEWS: rc: use_history + 2003-04-05 ABE Yuji <cbo46560@pop12.odn.ne.jp> * [w3m-dev 03838] W3M_LIBS splitted from LIBS @@ -7645,4 +7658,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.810 2003/04/04 16:00:09 ukai Exp $ +$Id: ChangeLog,v 1.811 2003/04/06 16:27:53 ukai Exp $ @@ -1,6 +1,7 @@ w3m 0.5 or 1.0? * autoconfiscate +* rc: use_history w3m 0.4.1 - 2003-03-07 diff --git a/config.h.dist b/config.h.dist index 5ca09d4..b08345a 100644 --- a/config.h.dist +++ b/config.h.dist @@ -119,11 +119,7 @@ INSTALL_W3MIMGDISPLAY=$(INSTALL_PROGRAM) #define USE_COLOR #undef USE_ANSI_COLOR #undef USE_MIGEMO -#undef EMACS_LIKE_LINEEDIT -#undef VI_PREC_NUM #undef USE_MARK -#undef LABEL_TOPLINE -#undef NEXTPAGE_TOPLINE #define USE_MOUSE #define USE_GPM #undef USE_SYSMOUSE @@ -132,7 +128,6 @@ INSTALL_W3MIMGDISPLAY=$(INSTALL_PROGRAM) #define USE_DIGEST_AUTH #define USE_SSL #undef USE_SSL_VERIFY -#undef FTPPASS_HOSTNAMEGEN #undef USE_NNTP #undef USE_GOPHER #define USE_EXTERNAL_URI_LOADER diff --git a/config.h.in b/config.h.in index 5ec5cc7..e58c796 100644 --- a/config.h.in +++ b/config.h.in @@ -42,11 +42,7 @@ #undef USE_ANSI_COLOR #undef USE_BG_COLOR #undef USE_MIGEMO -#define EMACS_LIKE_LINEEDIT -#define VI_PREC_NUM #define USE_MARK -#define LABEL_TOPLINE -#define NEXTPAGE_TOPLINE #undef USE_MOUSE #undef USE_GPM #undef USE_SYSMOUSE @@ -55,7 +51,6 @@ #undef USE_DIGEST_AUTH #undef USE_SSL #undef USE_SSL_VERIFY -#define FTPPASS_HOSTNAMEGEN #undef USE_HELP_CGI #undef USE_EXTERNAL_URI_LOADER #undef USE_W3MMAILER @@ -70,10 +65,8 @@ #undef USE_GDKPIXBUF #undef USE_IMLIB2 #undef USE_XFACE -#define SHOW_PARAMS #undef USE_DICT #undef USE_HISTORY -#define VIEW_UNSEENOBJECTS #undef FORMAT_NICE #define ID_EXT #undef CLEAR_BUF @@ -1,4 +1,4 @@ -/* $Id: etc.c,v 1.70 2003/03/13 17:47:49 ukai Exp $ */ +/* $Id: etc.c,v 1.71 2003/04/06 16:27:54 ukai Exp $ */ #include "fm.h" #include <pwd.h> #include "myctype.h" @@ -84,9 +84,7 @@ lineSkip(Buffer *buf, Line *line, int offset, int last) Line *l; l = currentLineSkip(buf, line, offset, last); -#ifdef NEXTPAGE_TOPLINE if (!nextpage_topline) -#endif for (i = buf->LINES - 1 - (buf->lastLine->linenumber - l->linenumber); i > 0 && l->prev != NULL; i--, l = l->prev) ; return l; @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.219 2003/03/02 15:09:24 ukai Exp $ */ +/* $Id: file.c,v 1.220 2003/04/06 16:27:54 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -2079,12 +2079,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, #endif /* not JP_CHARSET */ if (a != NULL) { gotoLine(b, a->start.line); -#ifdef LABEL_TOPLINE if (label_topline) b->topLine = lineSkip(b, b->topLine, b->currentLine->linenumber - b->topLine->linenumber, FALSE); -#endif b->pos = a->start.pos; arrangeCursor(b); } @@ -1,4 +1,4 @@ -/* $Id: fm.h,v 1.113 2003/02/18 15:43:24 ukai Exp $ */ +/* $Id: fm.h,v 1.114 2003/04/06 16:27:54 ukai Exp $ */ /* * w3m: WWW wo Miru utility * @@ -898,20 +898,12 @@ global int visited_color init(5); /* magenta */ #endif /* USE_COLOR */ global int confirm_on_quit init(TRUE); #ifdef USE_MARK -global int use_mark init(TRUE); +global int use_mark init(FALSE); #endif -#ifdef EMACS_LIKE_LINEEDIT -global int emacs_like_lineedit init(TRUE); -#endif -#ifdef VI_PREC_NUM -global int vi_prec_num init(TRUE); -#endif -#ifdef LABEL_TOPLINE +global int emacs_like_lineedit init(FALSE); +global int vi_prec_num init(FALSE); global int label_topline init(FALSE); -#endif -#ifdef NEXTPAGE_TOPLINE global int nextpage_topline init(FALSE); -#endif global char *displayTitleTerm init(NULL); global int displayLink init(FALSE); global int displayLineInfo init(FALSE); @@ -944,9 +936,7 @@ global int disable_secret_security_check init(FALSE); global char *passwd_file init(PASSWD_FILE); global char *pre_form_file init(PRE_FORM_FILE); global char *ftppasswd init(NULL); -#ifdef FTPPASS_HOSTNAMEGEN global int ftppass_hostnamegen init(TRUE); -#endif global int do_download init(FALSE); #ifdef USE_IMAGE global char *image_source init(NULL); @@ -1005,6 +995,7 @@ extern Hist *URLHist; extern Hist *ShellHist; extern Hist *TextHist; #ifdef USE_HISTORY +global int UseHistory init(TRUE); global int URLHistSize init(100); global int SaveURLHist init(TRUE); #endif /* USE_HISTORY */ @@ -1,4 +1,4 @@ -/* $Id: ftp.c,v 1.29 2003/03/06 14:26:14 ukai Exp $ */ +/* $Id: ftp.c,v 1.30 2003/04/06 16:27:54 ukai Exp $ */ #include <stdio.h> #include <pwd.h> #include <Str.h> @@ -15,7 +15,7 @@ #endif /* DEBUG */ #include <sys/socket.h> -#if defined(FTPPASS_HOSTNAMEGEN) || defined(INET6) +#if defined(INET6) #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> @@ -119,7 +119,6 @@ ftp_login(FTP ftp) sock = openSocket(ftp->host, "ftp", 21); if (sock < 0) goto open_err; -#ifdef FTPPASS_HOSTNAMEGEN if (ftppass_hostnamegen && !strcmp(ftp->user, "anonymous")) { size_t n = strlen(ftp->pass); @@ -143,7 +142,6 @@ ftp_login(FTP ftp) } } } -#endif ftp->rf = newInputStream(sock); ftp->wf = fdopen(dup(sock), "wb"); if (!ftp->rf || !ftp->wf) @@ -1,4 +1,4 @@ -/* $Id: linein.c,v 1.29 2003/03/06 14:31:22 ukai Exp $ */ +/* $Id: linein.c,v 1.30 2003/04/06 16:27:54 ukai Exp $ */ #include "fm.h" #include "local.h" #include "myctype.h" @@ -201,29 +201,21 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist, if (!i_quote && (((cm_mode & CPL_ALWAYS) && (c == CTRL_I || c == ' ')) || ((cm_mode & CPL_ON) && (c == CTRL_I)))) { -#ifdef EMACS_LIKE_LINEEDIT if (emacs_like_lineedit && cm_next) { _dcompl(); need_redraw = TRUE; } else { -#endif _compl(); cm_disp_next = -1; -#ifdef EMACS_LIKE_LINEEDIT } -#endif } else if (!i_quote && CLen == CPos && (cm_mode & CPL_ALWAYS || cm_mode & CPL_ON) && c == CTRL_D) { -#ifdef EMACS_LIKE_LINEEDIT if (!emacs_like_lineedit) { -#endif _dcompl(); need_redraw = TRUE; -#ifdef EMACS_LIKE_LINEEDIT } -#endif } else if (!i_quote && c == DEL_CODE) { _bs(); @@ -456,24 +448,19 @@ _esc(void) break; case CTRL_I: case ' ': -#ifdef EMACS_LIKE_LINEEDIT if (emacs_like_lineedit) { _rdcompl(); cm_clear = FALSE; need_redraw = TRUE; } else -#endif _rcompl(); break; case CTRL_D: -#ifdef EMACS_LIKE_LINEEDIT if (!emacs_like_lineedit) -#endif _rdcompl(); need_redraw = TRUE; break; -#ifdef EMACS_LIKE_LINEEDIT case 'f': if (emacs_like_lineedit) _mvRw(); @@ -486,7 +473,6 @@ _esc(void) if (emacs_like_lineedit) _bsw(); break; -#endif #ifdef JP_CHARSET case '$': /* ISO-2022-jp characters */ @@ -865,11 +851,9 @@ next_dcompl(int next) move(y, 0); clrtoeolx(); bold(); -#ifdef EMACS_LIKE_LINEEDIT if (emacs_like_lineedit) addstr("----- Press TAB to continue -----"); else -#endif addstr("----- Press CTRL-D to continue -----"); boldend(); } @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.219 2003/03/23 15:21:02 ukai Exp $ */ +/* $Id: main.c,v 1.220 2003/04/06 16:27:54 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -410,7 +410,8 @@ main(int argc, char **argv, char **envp) TextHist = newHist(); URLHist = newHist(); #ifdef USE_HISTORY - loadHistory(URLHist); + if (UseHistory) + loadHistory(URLHist); #endif /* not USE_HISTORY */ if (!non_null(HTTP_proxy) && @@ -1420,11 +1421,9 @@ nscroll(int n, int mode) else { tlnum = buf->topLine->linenumber; llnum = buf->topLine->linenumber + buf->LINES - 1; -#ifdef NEXTPAGE_TOPLINE if (nextpage_topline) diff_n = 0; else -#endif diff_n = n - (tlnum - top->linenumber); if (lnum < tlnum) lnum = tlnum + diff_n; @@ -1462,11 +1461,9 @@ nscroll(int n, int mode) void pgFore(void) { -#ifdef VI_PREC_NUM if (vi_prec_num) nscroll(searchKeyNum() * (Currentbuf->LINES - 1), B_NORMAL); else -#endif nscroll(prec_num ? searchKeyNum() : searchKeyNum() * (Currentbuf->LINES - 1), prec_num ? B_SCROLL : B_NORMAL); } @@ -1475,11 +1472,9 @@ pgFore(void) void pgBack(void) { -#ifdef VI_PREC_NUM if (vi_prec_num) nscroll(-searchKeyNum() * (Currentbuf->LINES - 1), B_NORMAL); else -#endif nscroll(-(prec_num ? searchKeyNum() : searchKeyNum() * (Currentbuf->LINES - 1)), prec_num ? B_SCROLL : B_NORMAL); } @@ -2346,7 +2341,7 @@ _quitfm(int confirm) save_cookies(); #endif /* USE_COOKIE */ #ifdef USE_HISTORY - if (SaveURLHist) + if (UseHistory && SaveURLHist) saveHistory(URLHist, URLHistSize); #endif /* USE_HISTORY */ w3m_exit(0); @@ -2795,14 +2790,12 @@ loadLink(char *url, char *target, char *referer, FormList *request) } if (al) { gotoLine(Currentbuf, al->start.line); -#ifdef LABEL_TOPLINE if (label_topline) Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, Currentbuf->currentLine-> linenumber - Currentbuf->topLine->linenumber, FALSE); -#endif Currentbuf->pos = al->start.pos; arrangeCursor(Currentbuf); } @@ -2832,13 +2825,11 @@ gotoLabel(char *label) (*buf->clone)++; pushBuffer(buf); gotoLine(Currentbuf, al->start.line); -#ifdef LABEL_TOPLINE if (label_topline) Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, Currentbuf->currentLine->linenumber - Currentbuf->topLine->linenumber, FALSE); -#endif Currentbuf->pos = al->start.pos; arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_FORCE_REDRAW); @@ -1,4 +1,4 @@ -/* $Id: rc.c,v 1.82 2003/02/05 16:48:09 ukai Exp $ */ +/* $Id: rc.c,v 1.83 2003/04/06 16:27:54 ukai Exp $ */ /* * Initialization file etc. */ @@ -57,6 +57,7 @@ static int RC_table_size; #define CMT_PIXEL_PER_CHAR "文字幅 (4.0...32.0)" #define CMT_PIXEL_PER_LINE "一行の高さ (4.0...64.0)" #define CMT_PAGERLINE "ページャとして利用した時に保存される行数" +#define CMT_HISTORY "履歴を使う" #define CMT_HISTSIZE "保持するURL履歴の数" #define CMT_SAVEHIST "URL履歴の保存" #define CMT_KANJICODE "表示用漢字コード" @@ -119,18 +120,10 @@ static int RC_table_size; #ifdef USE_MARK #define CMT_USE_MARK "マーク機能を有効にする" #endif -#ifdef EMACS_LIKE_LINEEDIT #define CMT_EMACS_LIKE_LINEEDIT "Emacs風の行編集にする" -#endif -#ifdef VI_PREC_NUM #define CMT_VI_PREC_NUM "vi風の数値プレフィクス" -#endif -#ifdef LABEL_TOPLINE #define CMT_LABEL_TOPLINE "ラベルに移動する時にカーソルがトップになるようにする" -#endif -#ifdef NEXTPAGE_TOPLINE #define CMT_NEXTPAGE_TOPLINE "次のページに移動する時にカーソルがトップになるようにする" -#endif #define CMT_FOLD_LINE "plain text ファイルの行を折り返す" #define CMT_SHOW_NUM "行番号を表示する" #define CMT_SHOW_SRCH_STR "検索文字列を表示する" @@ -146,9 +139,7 @@ static int RC_table_size; #define CMT_PASSWDFILE "パスワードファイル" #define CMT_PRE_FORM_FILE "文書読込時のフォーム設定用ファイル" #define CMT_FTPPASS "FTPのパスワード(普通は自分のmail addressを使う)" -#ifdef FTPPASS_HOSTNAMEGEN #define CMT_FTPPASS_HOSTNAMEGEN "FTPのパスワードのドメイン名を自動生成する" -#endif #define CMT_USERAGENT "User-Agent" #define CMT_ACCEPTENCODING "圧縮方法(Accept-Encoding:)" #define CMT_ACCEPTMEDIA "受けつけるメディアタイプ(Accept:)" @@ -222,6 +213,7 @@ static int RC_table_size; #define CMT_PIXEL_PER_CHAR "Number of pixels per character (4.0...32.0)" #define CMT_PIXEL_PER_LINE "Number of pixels per line (4.0...64.0)" #define CMT_PAGERLINE "Number of remembered lines when used as a pager" +#define CMT_HISTORY "Use URL history" #define CMT_HISTSIZE "Number of remembered URL" #define CMT_SAVEHIST "Save URL history" /* #define CMT_KANJICODE "Display Kanji Code" */ @@ -284,18 +276,10 @@ static int RC_table_size; #ifdef USE_MARK #define CMT_USE_MARK "Enable mark operations" #endif -#ifdef EMACS_LIKE_LINEEDIT #define CMT_EMACS_LIKE_LINEEDIT "Enable Emacs-style line editing" -#endif -#ifdef VI_PREC_NUM #define CMT_VI_PREC_NUM "Enable vi-like numeric prefix" -#endif -#ifdef LABEL_TOPLINE #define CMT_LABEL_TOPLINE "Move cursor to top line when going to label" -#endif -#ifdef NEXTPAGE_TOPLINE #define CMT_NEXTPAGE_TOPLINE "Move cursor to top line when moving to next page" -#endif #define CMT_FOLD_LINE "Fold lines of plain text file" #define CMT_SHOW_NUM "Show line numbers" #define CMT_SHOW_SRCH_STR "Show search string" @@ -311,9 +295,7 @@ static int RC_table_size; #define CMT_PASSWDFILE "Password file" #define CMT_PRE_FORM_FILE "File for setting form on loading" #define CMT_FTPPASS "Password for anonymous FTP (your mail address)" -#ifdef FTPPASS_HOSTNAMEGEN #define CMT_FTPPASS_HOSTNAMEGEN "Generate domain part of password for FTP" -#endif #define CMT_USERAGENT "User-Agent identification string" #define CMT_ACCEPTENCODING "Accept-Encoding header" #define CMT_ACCEPTMEDIA "Accept header" @@ -575,14 +557,10 @@ struct param_ptr params1[] = { {"show_lnum", P_INT, PI_ONOFF, (void *)&showLineNum, CMT_SHOW_NUM, NULL}, {"show_srch_str", P_INT, PI_ONOFF, (void *)&show_srch_str, CMT_SHOW_SRCH_STR, NULL}, -#ifdef LABEL_TOPLINE {"label_topline", P_INT, PI_ONOFF, (void *)&label_topline, CMT_LABEL_TOPLINE, NULL}, -#endif -#ifdef NEXTPAGE_TOPLINE {"nextpage_topline", P_INT, PI_ONOFF, (void *)&nextpage_topline, CMT_NEXTPAGE_TOPLINE, NULL}, -#endif {NULL, 0, 0, NULL, NULL, NULL}, }; @@ -618,6 +596,7 @@ struct param_ptr params2[] = { struct param_ptr params3[] = { {"pagerline", P_NZINT, PI_TEXT, (void *)&PagerMax, CMT_PAGERLINE, NULL}, #ifdef USE_HISTORY + {"use_history", P_INT, PI_ONOFF, (void *)&UseHistory, CMT_HISTORY, NULL}, {"history", P_INT, PI_TEXT, (void *)&URLHistSize, CMT_HISTSIZE, NULL}, {"save_hist", P_INT, PI_ONOFF, (void *)&SaveURLHist, CMT_SAVEHIST, NULL}, #endif /* USE_HISTORY */ @@ -628,14 +607,10 @@ struct param_ptr params3[] = { #ifdef USE_MARK {"mark", P_INT, PI_ONOFF, (void *)&use_mark, CMT_USE_MARK, NULL}, #endif -#ifdef EMACS_LIKE_LINEEDIT {"emacs_like_lineedit", P_INT, PI_ONOFF, (void *)&emacs_like_lineedit, CMT_EMACS_LIKE_LINEEDIT, NULL}, -#endif -#ifdef VI_PREC_NUM {"vi_prec_num", P_INT, PI_ONOFF, (void *)&vi_prec_num, CMT_VI_PREC_NUM, NULL}, -#endif {"mark_all_pages", P_INT, PI_ONOFF, (void *)&MarkAllPages, CMT_MARK_ALL_PAGES, NULL}, {"wrap_search", P_INT, PI_ONOFF, (void *)&WrapDefault, CMT_WRAP, NULL}, @@ -766,10 +741,8 @@ struct param_ptr params9[] = { (void *)&disable_secret_security_check, CMT_DISABLE_SECRET_SECURITY_CHECK, NULL}, {"ftppasswd", P_STRING, PI_TEXT, (void *)&ftppasswd, CMT_FTPPASS, NULL}, -#ifdef FTPPASS_HOSTNAMEGEN {"ftppass_hostnamegen", P_INT, PI_ONOFF, (void *)&ftppass_hostnamegen, CMT_FTPPASS_HOSTNAMEGEN, NULL}, -#endif {"pre_form_file", P_STRING, PI_TEXT, (void *)&pre_form_file, CMT_PRE_FORM_FILE, NULL}, {"user_agent", P_STRING, PI_TEXT, (void *)&UserAgent, CMT_USERAGENT, NULL}, |