texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/makeinfo cmds.c,1.6,1.7 cmds.h,1.1.1.1,1.2


From: dirt
Subject: texinfo/makeinfo cmds.c,1.6,1.7 cmds.h,1.1.1.1,1.2
Date: Tue, 23 Dec 2003 13:40:54 +0100

Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv24981/makeinfo

Modified Files:
        cmds.c cmds.h 
Log Message:
2003-12-23  Alper Ersoy  <address@hidden>

        * makeinfo/cmds.c (cm_acronym):
        * makeinfo/cmds.h: save second arguments of acronym in acronyms_stack
        and reuse them as title attributes of acronym element of HTML output,
        when there is only one argument given.



Index: cmds.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cmds.c      2003/12/22 12:04:44     1.6
--- cmds.c      2003/12/23 12:40:52     1.7
***************
*** 675,678 ****
--- 675,682 ----
  }
  
+ /* We keep acronyms with two arguments around, to be able to refer to them
+    later with only one argument.*/
+ static ACRONYM_DESC *acronyms_stack = NULL;
+ 
  void
  cm_acronym (arg)
***************
*** 710,713 ****
--- 714,728 ----
      description[strlen (description)-1] = '\0';
  
+   /* Save new description.  */
+   if (strlen (description) > 0)
+     {
+       ACRONYM_DESC *new = xmalloc (sizeof (ACRONYM_DESC));
+ 
+       new->acronym = xstrdup (acronym);
+       new->description = xstrdup (description);
+       new->next = acronyms_stack;
+       acronyms_stack = new;
+     }
+ 
    if (html)
      {
***************
*** 716,721 ****
        if (strlen (description) > 0)
          add_word_args (" title=\"%s\"", text_expansion (description));
!       else
!         printf ("FIXME: should get title from previous acronyms, if 
possible.\n");
  
        add_char ('>');
--- 731,751 ----
        if (strlen (description) > 0)
          add_word_args (" title=\"%s\"", text_expansion (description));
!       else if (acronyms_stack)
!         {
!           /* No second argument, get from previous.  Searching is from last to
!              first defined, so we get the most recent version of the
!              description. */
!           ACRONYM_DESC *temp = acronyms_stack;
! 
!           while (temp)
!             {
!               if (STREQ (acronym, temp->acronym) && strlen 
(temp->description) > 0)
!                 {
!                   add_word_args (" title=\"%s\"", text_expansion 
(temp->description));
!                   break;
!                 }
!               temp = temp->next;
!             }
!         }
  
        add_char ('>');

Index: cmds.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** cmds.h      2003/12/06 01:33:21     1.1.1.1
--- cmds.h      2003/12/23 12:40:52     1.2
***************
*** 48,50 ****
--- 48,57 ----
  extern COMMAND command_table[];
  
+ typedef struct acronym_desc
+ {
+   struct acronym_desc *next;
+   char *acronym;
+   char *description;
+ } ACRONYM_DESC;
+ 
  #endif /* !CMDS_H */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]