[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6754] same change for XS paragraph formatting module
From: |
Gavin D. Smith |
Subject: |
[6754] same change for XS paragraph formatting module |
Date: |
Tue, 03 Nov 2015 17:55:13 +0000 |
Revision: 6754
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6754
Author: gavin
Date: 2015-11-03 17:55:12 +0000 (Tue, 03 Nov 2015)
Log Message:
-----------
same change for XS paragraph formatting module
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs
trunk/tp/Texinfo/Convert/XSParagraph/xspara.c
trunk/tp/Texinfo/Convert/XSParagraph/xspara.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2015-11-03 17:40:20 UTC (rev 6753)
+++ trunk/ChangeLog 2015-11-03 17:55:12 UTC (rev 6754)
@@ -12,6 +12,9 @@
commands>. Call set_space_protection to set
'double_width_no_break' for the output for the cross-reference.
+ * tp/Texinfo/Convert/XSParagraph/xspara.c
+ (xspara_set_space_protection, xspara_add_text): Likewise.
+
2015-11-03 Gavin Smith <address@hidden>
* tp/t/plaintext.t (east_asian_in_w): New test.
Modified: trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs 2015-11-03 17:40:20 UTC
(rev 6753)
+++ trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs 2015-11-03 17:55:12 UTC
(rev 6754)
@@ -227,7 +227,8 @@
//xspara_set_state (paragraph);
xspara_allow_end_sentence ();
-# Optional parameters are IGNORE_COLUMNS, KEEP_END_LINES, FRENCHSPACING
+# Optional parameters are IGNORE_COLUMNS, KEEP_END_LINES, FRENCHSPACING,
+# DOUBLE_WIDTH_NO_BREAK.
# Pass them to the C function as -1 if not given or undef.
char *
xspara_set_space_protection (paragraph, space_protection_in, ...)
@@ -238,6 +239,7 @@
int ignore_columns = -1;
int keep_end_lines = -1;
int french_spacing = -1;
+ int double_width_no_break = -1;
SV *arg_in;
CODE:
if (SvOK(space_protection_in))
@@ -265,11 +267,18 @@
if (SvOK(arg_in))
french_spacing = (int)SvIV(arg_in);
}
+ if (items > 0)
+ {
+ items--;
+ arg_in = ST(5);
+ if (SvOK(arg_in))
+ double_width_no_break = (int)SvIV(arg_in);
+ }
//xspara_set_state (paragraph);
RETVAL = xspara_set_space_protection
(space_protection, ignore_columns, keep_end_lines,
- french_spacing);
+ french_spacing, double_width_no_break);
xspara_get_state (paragraph);
OUTPUT:
RETVAL
Modified: trunk/tp/Texinfo/Convert/XSParagraph/xspara.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c 2015-11-03 17:40:20 UTC
(rev 6753)
+++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c 2015-11-03 17:55:12 UTC
(rev 6754)
@@ -66,6 +66,7 @@
int keep_end_lines; /* A newline in the input ends a line in the output.
Used by @flushleft and @flushright. */
int french_spacing; /* Only one space, not two, after a full stop. */
+ int double_width_no_break; /* No line break between double width chars. */
} PARAGRAPH;
static PARAGRAPH state;
@@ -667,7 +668,8 @@
xspara_set_space_protection (int protect_spaces,
int ignore_columns,
int keep_end_lines,
- int french_spacing)
+ int french_spacing,
+ int double_width_no_break)
{
if (protect_spaces != -1)
state.protect_spaces = protect_spaces;
@@ -675,6 +677,8 @@
state.ignore_columns = ignore_columns;
if (keep_end_lines != -1)
state.keep_end_lines = keep_end_lines;
+ if (double_width_no_break != -1)
+ state.double_width_no_break = double_width_no_break;
/*fprintf (stderr, "SETTING SPACE (%d, %d, %d, %d)\n",
protect_spaces,
@@ -958,9 +962,11 @@
}
/* If protect_spaces is on, accumulate the characters so that
they can be pushed onto the next line if necessary. */
- if (!state.protect_spaces)
- xspara__add_pending_word (&result, 0);
- state.end_sentence = -2;
+ if (!state.protect_spaces && !state.double_width_no_break)
+ {
+ xspara__add_pending_word (&result, 0);
+ state.end_sentence = -2;
+ }
}
/*************** Word character ******************************/
else if (width == 1)
Modified: trunk/tp/Texinfo/Convert/XSParagraph/xspara.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.h 2015-11-03 17:40:20 UTC
(rev 6753)
+++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.h 2015-11-03 17:55:12 UTC
(rev 6754)
@@ -5,7 +5,7 @@
char *xspara_add_next (char *, int, int transparent);
char *xspara_add_text (char *);
char *xspara_set_space_protection (int space_protection, int ignore_columns,
- int keep_end_lines, int french_spacing);
+ int keep_end_lines, int french_spacing, int double_width_no_break);
void xspara__end_line (void);
char *xspara_end_line (void);
char *xspara_get_pending (void);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6754] same change for XS paragraph formatting module,
Gavin D. Smith <=