? bootstrap.sh
? stamp-h
? stamp-h.in
? stamp-h1.in
? stamp-h2.in
? doc/stamp-vti.1
? makeinfo/hello-lily.png
? makeinfo/hello-world.png
? makeinfo/image-example.info
? makeinfo/no-lily.png
Index: ChangeLog
===================================================================
RCS file: /cvsroot/texinfo/texinfo/ChangeLog,v
retrieving revision 1.123
diff -p -u -r1.123 ChangeLog
--- ChangeLog	9 Apr 2003 12:29:26 -0000	1.123
+++ ChangeLog	16 Apr 2003 16:23:47 -0000
@@ -1,3 +1,14 @@
+2003-04-14  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* info/display.c (display_update_one_window): Skip new style
+	image tag/cookie.
+
+2003-04-09  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* bootstrap.sh: New file.
+
+	* makeinfo/makeinfo.c (cm_image): Write ^@^H[image ...^@^H] tag.
+
 2003-04-08    <karl@gnu.org>
 
 	* makeinfo/makeinfo.c (usage): avoid double blank line.
Index: NEWS
===================================================================
RCS file: /cvsroot/texinfo/texinfo/NEWS,v
retrieving revision 1.45
diff -p -u -r1.45 NEWS
--- NEWS	9 Apr 2003 12:29:26 -0000	1.45
+++ NEWS	16 Apr 2003 16:23:47 -0000
@@ -30,11 +30,16 @@ convenience, here's a url to one of the 
   . search for image files in the include file search path.
   . --html output now uses <h3> at the smallest.
   . under --html, @cartouche now outputs a <table> with a border.
+  . @image now writes full ^@^H[image ..^@^H] tag to .info file, so
+    that graphical info browsers may show the actual image.  Also,
+    makeinfo will not require a .txt image file substitute if a real
+    image is found.
 * texinfo.tex:
   . new Polish translation txi-pl.tex.
 * info:
   . RET now goes to the nearest xref (rather like Emacs Info),
     instead of the next xref starting on the current line.
+  . Skip ^@^H cookies.
 * Distribution:
   . Variables now declared const where appropriate.
   . automake 1.7.3.
Index: info/display.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/display.c,v
retrieving revision 1.2
diff -p -u -r1.2 display.c
--- info/display.c	5 Feb 2003 17:53:31 -0000	1.2
+++ info/display.c	16 Apr 2003 16:23:47 -0000
@@ -152,6 +152,15 @@ display_update_one_window (win)
             {
               replen = win->width - pl_index + pl_ignore;
             }
+	  else if (*nodetext == '\0'
+		   && (nodetext + 1) < last_node_char
+		   && *(nodetext + 1) == '\b')
+	    {
+	      /* Found new style image tag/cookie \0\b[ or \0\b]
+		 Just skip for now.  */
+	      nodetext++;
+	      continue;
+	    }
           else
             {
               rep = printed_representation (*nodetext, pl_index);
Index: makeinfo/makeinfo.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.24
diff -p -u -r1.24 makeinfo.c
--- makeinfo/makeinfo.c	8 Apr 2003 14:13:54 -0000	1.24
+++ makeinfo/makeinfo.c	16 Apr 2003 16:23:49 -0000
@@ -3441,62 +3441,43 @@ cm_image (arg)
       char *pathname = NULL;
       char *fullname = xmalloc (strlen (name_arg)
                        + (ext_arg && *ext_arg ? strlen (ext_arg) + 1 : 4) + 1);
-
-      if (html)
-        {
-          if (ext_arg && *ext_arg)
-            {
-              sprintf (fullname, "%s.%s", name_arg, ext_arg);
-              if (access (fullname, R_OK) != 0)
-		{
-		  pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
-		  if (pathname != NULL && access (pathname, R_OK) != 0)
-		    {
-		      line_error(_("@image file `%s' (for HTML) not readable: %s"),
-				 fullname, strerror (errno));
-		      return;
-		    }
-		  else if (pathname == NULL)
-		    {
-		      line_error (_("No such file `%s'"),
-				  fullname);
-		      return;
-		    }
-		}
-            }
-          else
-            {
-	      sprintf (fullname, "%s.png", name_arg);
-	      if (access (fullname, R_OK) != 0)
+      
+      if (ext_arg && *ext_arg)
+	{
+	  sprintf (fullname, "%s.%s", name_arg, ext_arg);
+	  if (access (fullname, R_OK) != 0)
+	    pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
+	}
+      else
+	{
+	  sprintf (fullname, "%s.png", name_arg);
+	  if (access (fullname, R_OK) != 0)
+	    {
+	      pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
+	      if (pathname == NULL)
 		{
-		  pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
-		  if (pathname != NULL && access (pathname, R_OK) != 0)
-		    {
-		      line_error(_("@image file `%s' (for HTML) not readable: %s"),
-				 fullname, strerror (errno));
-		      return;
-		    }
-
 		  sprintf (fullname, "%s.jpg", name_arg);
 		  if (access (fullname, R_OK) != 0)
-		    {
-		      pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
-		      if (pathname != NULL && access (pathname, R_OK) != 0)
-			{
-			  line_error(_("@image file `%s' (for HTML) not readable: %s"),
-				     fullname, strerror (errno));
-			  return;
-			}
-		      else if (pathname == NULL)
-			{
-			  line_error (_("No `%s.png' or `.jpg', and no extension supplied"),
-				      name_arg);
-			  return;
-			}
-		    }
+		    pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
 		}
             }
-
+	}
+      
+      if (html)
+        {
+	  if (pathname == NULL && access (fullname, R_OK) != 0)
+	    {
+	      line_error(_("@image file `%s' (for HTML) not readable: %s"),
+			     fullname, strerror (errno));
+	      return;
+	    }
+	  if (pathname != NULL && access (pathname, R_OK) != 0)
+	    {
+	      line_error (_("No such file `%s'"),
+			  fullname);
+	      return;
+	    }
+	  
           add_html_elt ("<img src=");
           add_word_args ("\"%s\"", fullname);
           add_html_elt (" alt=");
@@ -3513,16 +3494,22 @@ cm_image (arg)
       else
         { /* Try to open foo.txt.  */
           FILE *image_file;
-          strcpy (fullname, name_arg);
-          strcat (fullname, ".txt");
-          image_file = fopen (fullname, "r");
+	  char *txtpath = NULL;
+	  char *txtname = xmalloc (strlen (name_arg)
+				   + (ext_arg && *ext_arg ? strlen (ext_arg) + 1 : 4) + 1);
+          strcpy (txtname, name_arg);
+          strcat (txtname, ".txt");
+          image_file = fopen (txtname, "r");
 	  if (image_file == NULL)
 	    {
-	      pathname = get_file_info_in_path (fullname, include_files_path, &file_info);
-	      if (pathname != NULL)
-		image_file = fopen (pathname, "r");
+	      txtpath = get_file_info_in_path (txtname, include_files_path, &file_info);
+	      if (txtpath != NULL)
+		image_file = fopen (txtpath, "r");
 	    }
-          if (image_file)
+	  
+          if (image_file != NULL
+	      || access (fullname, R_OK) == 0
+	      || (pathname != NULL && access (pathname, R_OK) == 0))
             {
               int ch;
               int save_inhibit_indentation = inhibit_paragraph_indentation;
@@ -3532,22 +3519,44 @@ cm_image (arg)
               filling_enabled = 0;
               last_char_was_newline = 0;
 
-              /* Maybe we need to remove the final newline if the image
-                 file is only one line to allow in-line images.  On the
-                 other hand, they could just make the file without a
-                 final newline.  */
-              while ((ch = getc (image_file)) != EOF)
-                add_char (ch);
+	      add_char ('\0');
+	      add_word ("\010[image");
+
+	      if (access (fullname, R_OK) == 0
+		  || pathname != NULL && access (pathname, R_OK) == 0)
+		add_word_args (" src=%s", fullname);
+
+	      if (*alt_arg)
+		add_word_args (" alt=\"%s\"", alt_arg);
+	      
+	      if (image_file != NULL)
+		{
+		  add_word (" text=\"");
+		  /* Maybe we need to remove the final newline if the image
+		     file is only one line to allow in-line images.  On the
+		     other hand, they could just make the file without a
+		     final newline.  */
+		  while ((ch = getc (image_file)) != EOF)
+		    {
+		      if (ch == '"' || ch == '\\')
+			add_char ('\\');
+		      add_char (ch);
+		    }
+		  add_char ('"');
+		  
+		  if (fclose (image_file) != 0)
+		    perror (txtname);
+		}
 
               inhibit_paragraph_indentation = save_inhibit_indentation;
               filling_enabled = save_filling_enabled;
 
-              if (fclose (image_file) != 0)
-                perror (fullname);
+	      add_char ('\0');
+	      add_word ("\010]"); 
             }
           else
             line_error (_("@image file `%s' (for text) unreadable: %s"),
-                        fullname, strerror (errno));
+                        txtname, strerror (errno));
         }
 
       free (fullname);

