diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2013-10-02 20:21:37 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2013-10-02 20:21:37 -0400 |
commit | 150b76256f4da361a8dcb18ce1a15bda26a8c42a (patch) | |
tree | b0eaa51be6827b0743a3c6c214c21d62fb309f42 | |
parent | 90e4fcf9933fc9d66fb92e5a666445ba21995a51 (diff) | |
download | lynx-snapshots-150b76256f4da361a8dcb18ce1a15bda26a8c42a.tar.gz |
snapshot of project "lynx", label v2-8-8dev_16g
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | lynx.man | 5 | ||||
-rw-r--r-- | src/GridText.c | 17 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 3 | ||||
-rw-r--r-- | src/LYMain.c | 9 |
5 files changed, 32 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES index e4748075..4910f75f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,13 @@ --- $LynxId: CHANGES,v 1.661 2013/10/02 16:51:58 tom Exp $ +-- $LynxId: CHANGES,v 1.663 2013/10/02 20:19:31 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== 2013-10-02 (2.8.8dev.17) +* add -list_inline option, which modifies -dump output to put links inline with + the text rather than in a list at the end of the dump (Debian #584080) -TD * add clarification in manpage regarding -force_html option versus -dump or - -crawl (Debian #254603) -TD + -crawl (Debian #254603, Debian #295273) -TD * improve manpage descriptions of -reload, -get_data and -post_data (Debian #350853) -TD * modify manpage synopsis to make it clearer that Lynx accepts more than one diff --git a/lynx.man b/lynx.man index 8280df5d..e605c087 100644 --- a/lynx.man +++ b/lynx.man @@ -1,4 +1,4 @@ -.\" $LynxId: lynx.man,v 1.105 2013/10/02 16:50:13 tom Exp $ +.\" $LynxId: lynx.man,v 1.106 2013/10/02 20:21:37 tom Exp $ .\" ************************************************************************** .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds AQ \(aq @@ -419,6 +419,9 @@ do justification of text. .B \-link\fR=\fINUMBER starting count for lnk#.dat files produced by \fB\-crawl\fR. .TP +.B \-list_inline +for \fB\-dump\fR, show the links inline with the text. +.TP .B \-listonly for \fB\-dump\fR, show only the list of links. .TP diff --git a/src/GridText.c b/src/GridText.c index 285ca604..01a3edee 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -1,5 +1,5 @@ /* - * $LynxId: GridText.c,v 1.266 2013/06/12 21:03:36 tom Exp $ + * $LynxId: GridText.c,v 1.267 2013/10/02 20:09:49 tom Exp $ * * Character grid hypertext object * =============================== @@ -5119,11 +5119,21 @@ static void add_link_number(HText *text, TextAnchor *a, int save_position) && links_are_numbered()) { char saved_lastchar = text->LastChar; int saved_linenum = text->Lines; + HTAnchor *link_dest; + char *link_text; compute_show_number(a); - sprintf(marker, "[%d]", a->show_number); - HText_appendText(text, marker); + if (dump_links_inline + && (link_dest = HTAnchor_followLink(a->anchor)) != 0 + && (link_text = HTAnchor_address(link_dest)) != 0) { + HText_appendText(text, "["); + HText_appendText(text, link_text); + HText_appendText(text, "]"); + } else { + sprintf(marker, "[%d]", a->show_number); + HText_appendText(text, marker); + } if (saved_linenum && text->Lines && saved_lastchar != ' ') text->LastChar = ']'; /* if marker not after space caused split */ if (save_position) { @@ -8322,6 +8332,7 @@ void print_crawl_to_fd(FILE *fp, char *thelink, * Add the References list if appropriate */ if ((no_list == FALSE) && + (dump_links_inline == FALSE) && links_are_numbered()) { printlist(fp, FALSE); } diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 4d6a3fc8..590dbd0f 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYGlobalDefs.h,v 1.136 2013/07/29 00:29:14 tom Exp $ + * $LynxId: LYGlobalDefs.h,v 1.137 2013/10/02 19:03:07 tom Exp $ * * global variable definitions */ @@ -231,6 +231,7 @@ extern "C" { extern BOOLEAN LYcase_sensitive; /* TRUE to turn on case sensitive search */ extern BOOLEAN check_mail; /* TRUE to report unread/new mail messages */ extern BOOLEAN child_lynx; /* TRUE to exit with an arrow */ + extern BOOLEAN dump_links_inline; extern BOOLEAN dump_links_only; extern BOOLEAN dump_output_immediately; extern BOOLEAN dump_to_stderr; diff --git a/src/LYMain.c b/src/LYMain.c index 3c01234b..161847fd 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMain.c,v 1.243 2013/05/30 08:58:21 tom Exp $ + * $LynxId: LYMain.c,v 1.244 2013/10/02 20:08:54 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> @@ -212,6 +212,7 @@ BOOLEAN bold_name_anchors = FALSE; BOOLEAN LYcase_sensitive = CASE_SENSITIVE_ALWAYS_ON; BOOLEAN check_mail = CHECKMAIL; BOOLEAN child_lynx = FALSE; +BOOLEAN dump_links_inline = FALSE; BOOLEAN dump_links_only = FALSE; BOOLEAN dump_output_immediately = FALSE; BOOLEAN dump_to_stderr = FALSE; @@ -2191,6 +2192,7 @@ int main(int argc, i + 1, HTList_count(Goto_URLs), startfile)); status = mainloop(); if (!no_list && + !dump_links_inline && !crawl) /* For -crawl it has already been done! */ printlist(stdout, FALSE); if (i != 0) @@ -2199,6 +2201,7 @@ int main(int argc, #else status = mainloop(); if (!no_list && + !dump_links_inline && !crawl && /* For -crawl it has already been done! */ links_are_numbered()) printlist(stdout, FALSE); @@ -3622,6 +3625,10 @@ soon as they are seen)" "=NUMBER\nstarting count for lnk#.dat files produced by -crawl" ), PARSE_SET( + "list_inline", 4|TOGGLE_ARG, dump_links_inline, + "with -dump, forces it to show links inline with text" + ), + PARSE_SET( "listonly", 4|TOGGLE_ARG, dump_links_only, "with -dump, forces it to show only the list of links" ), |