carbon2-commit: move inclusion point of text.h to clean things up a bit

Ben Wing ben at xemacs.org
Fri Mar 5 12:53:46 EST 2010


changeset:   5142:3aa3888729c3
user:        Ben Wing <ben at xemacs.org>
date:        Tue Mar 02 06:19:51 2010 -0600
files:       src/ChangeLog src/lisp.h src/text.h
description:
move inclusion point of text.h to clean things up a bit

-------------------- ChangeLog entries follow: --------------------

src/ChangeLog addition:

2010-03-02  Ben Wing  <ben at xemacs.org>

	* lisp.h:
	* text.h:
	Move inclusion point of text.h earlier in lisp.h -- just before
	the definition of characters, which needs some of the stuff in
	text.h.  With text.h later, some basic character properties had to
	be defined in lisp.h -- put them back into text.h where they belong.
	Move some text in lisp.h at the point of text.h inclusion into
	text.h -- it serves as a mini-introduction.


diff -r ed624ab64583 -r 3aa3888729c3 src/ChangeLog
--- a/src/ChangeLog	Tue Mar 02 05:22:10 2010 -0600
+++ b/src/ChangeLog	Tue Mar 02 06:19:51 2010 -0600
@@ -1,3 +1,14 @@
+2010-03-02  Ben Wing  <ben at xemacs.org>
+
+	* lisp.h:
+	* text.h:
+	Move inclusion point of text.h earlier in lisp.h -- just before
+	the definition of characters, which needs some of the stuff in
+	text.h.  With text.h later, some basic character properties had to
+	be defined in lisp.h -- put them back into text.h where they belong.
+	Move some text in lisp.h at the point of text.h inclusion into
+	text.h -- it serves as a mini-introduction.
+
 2010-03-02  Ben Wing  <ben at xemacs.org>
 
 	* Makefile.in.in:
diff -r ed624ab64583 -r 3aa3888729c3 src/lisp.h
--- a/src/lisp.h	Tue Mar 02 05:22:10 2010 -0600
+++ b/src/lisp.h	Tue Mar 02 06:19:51 2010 -0600
@@ -3448,7 +3448,17 @@
     x = wrong_type_argument (Qnatnump, x);	\
 } while (0)
 
+END_C_DECLS
+
+/* -------------- properties of internally-formatted text ------------- */
+
+#include "text.h"
+
 /*------------------------------- char ---------------------------------*/
+
+BEGIN_C_DECLS
+
+#ifdef ERROR_CHECK_TYPES
 
 /* NOTE: There are basic functions for converting between a character and
    the string representation of a character in text.h, as well as lots of
@@ -3456,31 +3466,6 @@
    working with Ichars in charset.h, for retrieving the charset of an
    Ichar, the length of an Ichar when converted to text, etc.
 */
-
-#ifdef MULE
-
-MODULE_API int non_ascii_valid_ichar_p (Ichar ch);
-
-/* Return whether the given Ichar is valid.
- */
-
-DECLARE_INLINE_HEADER (
-int
-valid_ichar_p (Ichar ch)
-)
-{
-  return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch);
-}
-
-#else /* not MULE */
-
-/* This works when CH is negative, and correctly returns non-zero only when CH
-   is in the range [0, 255], inclusive. */
-#define valid_ichar_p(ch) (! (ch & ~0xFF))
-
-#endif /* not MULE */
-
-#ifdef ERROR_CHECK_TYPES
 
 DECLARE_INLINE_HEADER (
 int
@@ -3827,37 +3812,6 @@
 void prune_weak_lists (void);
 
 END_C_DECLS
-
-/************************************************************************/
-/*      Definitions related to the format of text and of characters     */
-/************************************************************************/
-
-/* Note:
-
-   "internally formatted text" and the term "internal format" in
-   general are likely to refer to the format of text in buffers and
-   strings; "externally formatted text" and the term "external format"
-   refer to any text format used in the O.S. or elsewhere outside of
-   XEmacs.  The format of text and of a character are related and
-   there must be a one-to-one relationship (hopefully through a
-   relatively simple algorithmic means of conversion) between a string
-   of text and an equivalent array of characters, but the conversion
-   between the two is NOT necessarily trivial.
-
-   In a non-Mule XEmacs, allowed characters are numbered 0 through
-   255, where no fixed meaning is assigned to them, but (when
-   representing text, rather than bytes in a binary file) in practice
-   the lower half represents ASCII and the upper half some other 8-bit
-   character set (chosen by setting the font, case tables, syntax
-   tables, etc. appropriately for the character set through ad-hoc
-   means such as the `iso-8859-1' file and the
-   `standard-display-european' function).
-
-   #### Finish this.
-
-	*/
-#include "text.h"
-
 
 /************************************************************************/
 /*	   Definitions of primitive Lisp functions and variables	*/
diff -r ed624ab64583 -r 3aa3888729c3 src/text.h
--- a/src/text.h	Tue Mar 02 05:22:10 2010 -0600
+++ b/src/text.h	Tue Mar 02 06:19:51 2010 -0600
@@ -46,6 +46,33 @@
 #endif
 
 BEGIN_C_DECLS
+
+/************************************************************************/
+/*        A short intro to the format of text and of characters         */
+/************************************************************************/
+
+/*
+   "internally formatted text" and the term "internal format" in
+   general are likely to refer to the format of text in buffers and
+   strings; "externally formatted text" and the term "external format"
+   refer to any text format used in the O.S. or elsewhere outside of
+   XEmacs.  The format of text and of a character are related and
+   there must be a one-to-one relationship (hopefully through a
+   relatively simple algorithmic means of conversion) between a string
+   of text and an equivalent array of characters, but the conversion
+   between the two is NOT necessarily trivial.
+
+   In a non-Mule XEmacs, allowed characters are numbered 0 through
+   255, where no fixed meaning is assigned to them, but (when
+   representing text, rather than bytes in a binary file) in practice
+   the lower half represents ASCII and the upper half some other 8-bit
+   character set (chosen by setting the font, case tables, syntax
+   tables, etc. appropriately for the character set through ad-hoc
+   means such as the `iso-8859-1' file and the
+   `standard-display-european' function).
+   
+   For more info, see `text.c' and the Internals Manual.
+*/
 
 /* ---------------------------------------------------------------------- */
 /*                     Super-basic character properties                   */
@@ -163,6 +190,29 @@
  */
 
 #define MAX_ICHAR_LEN 4
+
+#endif /* not MULE */
+
+#ifdef MULE
+
+MODULE_API int non_ascii_valid_ichar_p (Ichar ch);
+
+/* Return whether the given Ichar is valid.
+ */
+
+DECLARE_INLINE_HEADER (
+int
+valid_ichar_p (Ichar ch)
+)
+{
+  return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch);
+}
+
+#else /* not MULE */
+
+/* This works when CH is negative, and correctly returns non-zero only when CH
+   is in the range [0, 255], inclusive. */
+#define valid_ichar_p(ch) (! (ch & ~0xFF))
 
 #endif /* not MULE */
 



More information about the XEmacs-Patches mailing list