about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2013-10-02 20:21:37 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2013-10-02 20:21:37 -0400
commit150b76256f4da361a8dcb18ce1a15bda26a8c42a (patch)
treeb0eaa51be6827b0743a3c6c214c21d62fb309f42 /src
parent90e4fcf9933fc9d66fb92e5a666445ba21995a51 (diff)
downloadlynx-snapshots-150b76256f4da361a8dcb18ce1a15bda26a8c42a.tar.gz
snapshot of project "lynx", label v2-8-8dev_16g
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c17
-rw-r--r--src/LYGlobalDefs.h3
-rw-r--r--src/LYMain.c9
3 files changed, 24 insertions, 5 deletions
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"
    ),