aboutsummaryrefslogtreecommitdiffstats
path: root/support/makeinfo.patch
blob: 7d2d307f8b2ffeb79c417f01fb7cef17a3d9cf75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
*** makeinfo.c.dist	Thu Sep 26 21:45:04 1991
--- makeinfo.c	Thu Oct 24 21:04:19 1991
***************
*** 73,78 ****
--- 73,79 ----
  /* Forward declarations. */
  unsigned char *xmalloc (), *xrealloc ();
  extern int in_fixed_width_font;
+ extern int the_current_enumerate_type;
  
  /* Some systems don't declare this function in pwd.h. */
  struct passwd *getpwnam ();
***************
*** 925,931 ****
    extern int executing_string;
    FSTACK *temp = filestack;
  
!   if (!filestack)
      abort ();			/* My fault.  I wonder what I did? */
  
    /* Make sure that commands with braces have been satisfied. */
--- 926,932 ----
    extern int executing_string;
    FSTACK *temp = filestack;
  
!   if (!filestack && !executing_string)
      abort ();			/* My fault.  I wonder what I did? */
  
    /* Make sure that commands with braces have been satisfied. */
***************
*** 941,947 ****
  
    /* Pop the stack. */
    filestack = filestack->next;
!   free (temp);
    pop_node_filename ();
  }
  
--- 942,949 ----
  
    /* Pop the stack. */
    filestack = filestack->next;
!   if (temp)
!     free (temp);
    pop_node_filename ();
  }
  
***************
*** 2586,2593 ****
      case enumerate:
        inhibit_paragraph_indentation = 0;
        current_indent += default_indentation_increment;
-       start_numbering (1);
        filling_enabled = indented_fill = true;
        break;
  
      case alphaenumerate:
--- 2588,2610 ----
      case enumerate:
        inhibit_paragraph_indentation = 0;
        current_indent += default_indentation_increment;
        filling_enabled = indented_fill = true;
+ 
+       if (*(insertion_stack->item_function))
+ 	{
+ 	  if (isalpha (*(insertion_stack->item_function)))
+ 	    {
+ 	       start_lettering (*(insertion_stack->item_function));
+ 	    }
+ 	  else
+ 	    {
+ 	       int n = atoi (insertion_stack->item_function);
+ 
+                start_numbering (n);
+ 	    }
+ 	}
+       else
+         start_numbering (1);
        break;
  
      case alphaenumerate:
***************
*** 2687,2693 ****
        break;
  
      case enumerate:
!       stop_numbering ();
        current_indent -= default_indentation_increment;
        break;
  
--- 2704,2714 ----
        break;
  
      case enumerate:
!       if (isalpha (the_current_enumerate_type))
!         stop_lettering ();
!       else
!         stop_numbering ();
! 
        current_indent -= default_indentation_increment;
        break;
  
***************
*** 2770,2775 ****
--- 2791,2800 ----
  int letter_offset = 0;
  int the_current_letter = 0;
  
+ int enumerate_type_stack[max_ns];
+ int enumerate_type_offset = 0;
+ int the_current_enumerate_type = '1';
+ 
  start_numbering (at_number)
       int at_number;
  {
***************
*** 2778,2783 ****
--- 2803,2815 ----
        line_error ("Enumeration stack overflow");
        return;
      }
+   if (enumerate_type_offset + 1 == max_ns)
+     {
+       line_error ("Enumeration stack overflow");
+       return;
+     }
+   the_current_enumerate_type =
+ 	enumerate_type_stack[enumerate_type_offset++] = '1';
    number_stack[number_offset++] = the_current_number;
    the_current_number = at_number;
  }
***************
*** 2787,2792 ****
--- 2819,2831 ----
    the_current_number = number_stack[--number_offset];
    if (number_offset < 0)
      number_offset = 0;
+   --enumerate_type_offset;
+   the_current_enumerate_type = enumerate_type_stack[enumerate_type_offset-1];
+   if (enumerate_type_offset < 0)
+     {
+        enumerate_type_offset = 0;
+        the_current_enumerate_type = '1';
+     }
  }
  
  start_lettering (at_letter)
***************
*** 2797,2802 ****
--- 2836,2848 ----
        line_error ("Alpha-enumeration stack overflow");
        return;
      }
+   if (enumerate_type_offset + 1 == max_ns)
+     {
+       line_error ("Enumeration stack overflow");
+       return;
+     }
+   the_current_enumerate_type =
+   	enumerate_type_stack[enumerate_type_offset++] = 'a';
    letter_stack[letter_offset++] = the_current_letter;
    the_current_letter = at_letter;
  }
***************
*** 2806,2811 ****
--- 2852,2864 ----
    the_current_letter = letter_stack[--letter_offset];
    if (letter_offset < 0)
      letter_offset = 0;
+   --enumerate_type_offset;
+   the_current_enumerate_type = enumerate_type_stack[enumerate_type_offset-1];
+   if (enumerate_type_offset < 0)
+     {
+        enumerate_type_offset = 0;
+        the_current_enumerate_type = '1';
+     }
  }
  
  /* Place a letter into the output stream. */
***************
*** 4307,4319 ****
  	    temp++;
  	  else
  	    {
! 	      if (input_text[temp] == '.' ||
! 		  input_text[temp] == ',' ||
  		  input_text[temp] == '\t')
  		return;
  	      else
  		{
! 		  line_error ("Cross-reference must be terminated with a period or a comma");
  		  return;
  		}
  	    }
--- 4360,4372 ----
  	    temp++;
  	  else
  	    {
! 	      if (member (input_text[temp], ".,;:") ||
! 		  (px_ref_flag && input_text[temp] == ')' ) ||
  		  input_text[temp] == '\t')
  		return;
  	      else
  		{
! 		  line_error ("Cross-reference must be terminated with punctuation");
  		  return;
  		}
  	    }
***************
*** 4729,4736 ****
  		  output_column++;
  		}
  	      else if (current_insertion_type () == enumerate)
! 		number_item ();
! 	      else
  		letter_item ();
  
  	      /* Special hack.  This makes close paragraph ignore you until
--- 4782,4794 ----
  		  output_column++;
  		}
  	      else if (current_insertion_type () == enumerate)
! 		{
! 		  if (isalpha (the_current_enumerate_type))
! 		    letter_item ();
! 		  else
! 		    number_item ();
! 		}
! 	      else  /* alphaenumerate or capsenumerate */
  		letter_item ();
  
  	      /* Special hack.  This makes close paragraph ignore you until