commit/XEmacs: 2 new changesets
7 years, 2 months
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/81e6fa9d46d0/
Changeset: 81e6fa9d46d0
User: kehoea
Date: 2017-10-17 13:16:04+00:00
Summary: Correct the definition of the STRING_FULLSIZE() macro, alloc.c, NEW_GC
src/ChangeLog addition:
2017-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
* alloc.c (STRING_FULLSIZE):
Correct the definition of this macro under NEW_GC, get the NEW_GC
build working again.
Incidentally wake up the buildbot with this commit.
Affected #: 2 files
diff -r 222b2a338e9daa7f4b7c12efe00859c76058e946 -r 81e6fa9d46d02bedd36f321266b3f5787055e1b0 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -7,6 +7,13 @@
Removed unused file-local C variables QSsubstitute,
Qsubstitute_negated from these files.
+2017-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * alloc.c (STRING_FULLSIZE):
+ Correct the definition of this macro under NEW_GC, get the NEW_GC
+ build working again.
+ Incidentally wake up the buildbot with this commit.
+
2017-10-07 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c (Feval):
diff -r 222b2a338e9daa7f4b7c12efe00859c76058e946 -r 81e6fa9d46d02bedd36f321266b3f5787055e1b0 src/alloc.c
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2802,7 +2802,7 @@
#ifdef NEW_GC
#define STRING_FULLSIZE(size) \
- ALIGN_SIZE (FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_String_Direct_Data, Lisp_Object, data, (size) + 1), sizeof (Lisp_Object *));
+ ALIGN_SIZE (FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_String_Direct_Data, Lisp_Object, data, (size) + 1), sizeof (Lisp_Object *))
#else /* not NEW_GC */
/* String blocks contain this many useful bytes. */
#define STRING_CHARS_BLOCK_SIZE \
https://bitbucket.org/xemacs/xemacs/commits/95a188885942/
Changeset: 95a188885942
User: kehoea
Date: 2017-10-17 13:48:30+00:00
Summary: Handle START a bit better for string arguments, #'find, #'position
src/ChangeLog addition:
2017-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
* sequence.c (position):
Handle START a bit better, use XSTRING_ASCII_BEGIN() so we don't
have to step through each character for the constant-byte-length
part of the string.
Affected #: 2 files
diff -r 81e6fa9d46d02bedd36f321266b3f5787055e1b0 -r 95a188885942f52fda8d85b7f132163a90fd8943 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2017-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * sequence.c (position):
+ Handle START a bit better, use XSTRING_ASCII_BEGIN() so we don't
+ have to step through each character for the constant-byte-length
+ part of the string.
+
2017-10-13 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c:
diff -r 81e6fa9d46d02bedd36f321266b3f5787055e1b0 -r 95a188885942f52fda8d85b7f132163a90fd8943 src/sequence.c
--- a/src/sequence.c
+++ b/src/sequence.c
@@ -1681,10 +1681,16 @@
}
else if (STRINGP (sequence))
{
- Ibyte *startp = XSTRING_DATA (sequence), *cursor = startp;
- Bytecount byte_len = XSTRING_LENGTH (sequence), cursor_offset = 0;
+ Ibyte *startp = XSTRING_DATA (sequence), *cursor;
+ Bytecount byte_len = XSTRING_LENGTH (sequence), cursor_offset;
Lisp_Object character = Qnil;
+ cursor_offset = ii = (Bytecount) (min (XSTRING_ASCII_BEGIN (sequence),
+ starting));
+ cursor = startp + cursor_offset;
+ /* It's probably worth making this even faster for the
+ non-variable-width-string case. Not now, though. */
+
while (cursor_offset < byte_len && ii < ending)
{
if (ii >= starting)
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Remove a couple of unused file-level variables
from doc.c, text.c
7 years, 2 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/222b2a338e9d/
Changeset: 222b2a338e9d
User: kehoea
Date: 2017-10-13 20:29:51+00:00
Summary: Remove a couple of unused file-level variables from doc.c, text.c
src/ChangeLog addition:
2017-10-13 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c:
* doc.c (vars_of_doc):
* text.c:
* text.c (syms_of_text):
Removed unused file-local C variables QSsubstitute,
Qsubstitute_negated from these files.
Affected #: 3 files
diff -r 2870572bc49be089166437bb3fbaa800bcdf8d14 -r 222b2a338e9daa7f4b7c12efe00859c76058e946 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2017-10-13 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c:
+ * doc.c (vars_of_doc):
+ * text.c:
+ * text.c (syms_of_text):
+ Removed unused file-local C variables QSsubstitute,
+ Qsubstitute_negated from these files.
+
2017-10-07 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c (Feval):
diff -r 2870572bc49be089166437bb3fbaa800bcdf8d14 -r 222b2a338e9daa7f4b7c12efe00859c76058e946 src/doc.c
--- a/src/doc.c
+++ b/src/doc.c
@@ -36,10 +36,7 @@
#include "elhash.h"
Lisp_Object Vinternal_doc_file_name;
-
-Lisp_Object QSsubstitute, Qdefvar;
-
-Lisp_Object Qfunction_documentation;
+Lisp_Object Qdefvar, Qfunction_documentation;
/* Work out what source file a function or variable came from, taking the
information from the documentation file. */
@@ -1399,7 +1396,4 @@
Name of file containing documentation strings of built-in symbols.
*/ );
Vinternal_doc_file_name = Qnil;
-
- QSsubstitute = build_ascstring (" *substitute*");
- staticpro (&QSsubstitute);
}
diff -r 2870572bc49be089166437bb3fbaa800bcdf8d14 -r 222b2a338e9daa7f4b7c12efe00859c76058e946 src/text.c
--- a/src/text.c
+++ b/src/text.c
@@ -1370,7 +1370,7 @@
Lisp_Object QSin_char_byte_conversion, QSin_byte_char_conversion;
Lisp_Object QSin_internal_external_conversion, QSin_external_internal_conversion;
-Lisp_Object /* Qfail, Qsubstitute, */ Qsubstitute_negated, Quse_private;
+Lisp_Object /* Qfail, Qsubstitute, */ Quse_private;
Fixnum Vchar_code_limit;
@@ -6116,7 +6116,6 @@
DEFSUBR (Fchar_width);
/* Qfail, Qsubstitute, Qsucceed in general.c */
- DEFSYMBOL (Qsubstitute_negated); /* #### what's this used for? */
DEFSYMBOL (Quse_private);
#ifdef ENABLE_COMPOSITE_CHARS
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Remove #'frame-utmost-window-2 from the global
namespace.
7 years, 2 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/2870572bc49b/
Changeset: 2870572bc49b
User: kehoea
Date: 2017-10-12 19:27:07+00:00
Summary: Remove #'frame-utmost-window-2 from the global namespace.
lisp/ChangeLog addition:
2017-10-12 Aidan Kehoe <kehoea(a)parhasard.net>
* frame.el (frame-utmost-window-2): Made into a label.
* frame.el (frame-utmost-window-1): Use the label.
Remove #'frame-utmost-window-2 from the global namespace.
Affected #: 2 files
diff -r d986eee8b74633db8cfee3ded33cde9de38802e3 -r 2870572bc49be089166437bb3fbaa800bcdf8d14 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-12 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame.el (frame-utmost-window-2): Made into a label.
+ * frame.el (frame-utmost-window-1): Use the label.
+ Remove #'frame-utmost-window-2 from the global namespace.
+
2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/chinese.el:
diff -r d986eee8b74633db8cfee3ded33cde9de38802e3 -r 2870572bc49be089166437bb3fbaa800bcdf8d14 lisp/frame.el
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1913,81 +1913,76 @@
;; new functions like this can be added without requiring C
;; additions.
-(defun frame-utmost-window-2 (window position left-right-p major-end-p
- minor-end-p)
- ;; LEFT-RIGHT-P means we're looking for the leftmost or rightmost
- ;; window, instead of the highest or lowest. In this case, we
- ;; say that the "major axis" goes left-to-right instead of top-to-
- ;; bottom. The "minor axis" always goes perpendicularly.
- ;;
- ;; If MAJOR-END-P is t, we're looking for a windows that abut the
- ;; end (i.e. right or bottom) of the major axis, instead of the
- ;; start.
- ;;
- ;; If MINOR-END-P is t, then we want to start counting from the
- ;; end of the minor axis instead of the beginning.
- ;;
- ;; Here's the general idea: Imagine we're trying to count the number
- ;; of windows that abut the top; call this function foo(). So, we
- ;; start with the root window. If this is a vertical combination
- ;; window, then foo() applied to the root window is the same as
- ;; foo() applied to the first child. If the root is a horizontal
- ;; combination window, then foo() applied to the root is the
- ;; same as the sum of foo() applied to each of the children.
- ;; Otherwise, the root window is a leaf window, and foo() is 1.
- ;; Now it's clear that, each time foo() encounters a leaf window,
- ;; it's encountering a different window that abuts the top.
- ;; With a little examining, you can see that foo encounters the
- ;; top-abutting windows in order from left to right. We can
- ;; modify foo() to return the nth top-abutting window by simply
- ;; keeping a global variable that is decremented each time
- ;; foo() encounters a leaf window and would return 1. If the
- ;; global counter gets to zero, we've encountered the window
- ;; we were looking for, so we exit right away using a `throw'.
- ;; Otherwise, we make sure that all normal paths return nil.
-
- (let (child)
- (cond ((setq child (if left-right-p
- (window-first-hchild window)
- (window-first-vchild window)))
- (if major-end-p
- (while (window-next-child child)
- (setq child (window-next-child child))))
- (frame-utmost-window-2 child position left-right-p major-end-p
- minor-end-p))
- ((setq child (if left-right-p
- (window-first-vchild window)
- (window-first-hchild window)))
- (if minor-end-p
- (while (window-next-child child)
- (setq child (window-next-child child))))
- (while child
- (frame-utmost-window-2 child position left-right-p major-end-p
- minor-end-p)
- (setq child (if minor-end-p
- (window-previous-child child)
- (window-next-child child))))
- nil)
- (t
- (setcar position (1- (car position)))
- (if (= (car position) 0)
- (throw 'fhw-exit window)
- nil)))))
-
-(defun frame-utmost-window-1 (frame position left-right-p major-end-p)
- (let (minor-end-p)
- (or frame (setq frame (selected-frame)))
- (or position (setq position 0))
- (if (>= position 0)
- (setq position (1+ position))
- (setq minor-end-p t)
- (setq position (- position)))
- (catch 'fhw-exit
+(defun* frame-utmost-window-1 (frame position left-right-p major-end-p)
+ (labels
+ ((frame-utmost-window-2 (window position left-right-p major-end-p
+ minor-end-p)
+ ;; LEFT-RIGHT-P means we're looking for the leftmost or rightmost
+ ;; window, instead of the highest or lowest. In this case, we say
+ ;; that the "major axis" goes left-to-right instead of top-to-
+ ;; bottom. The "minor axis" always goes perpendicularly.
+ ;;
+ ;; If MAJOR-END-P is t, we're looking for a windows that abut the end
+ ;; (i.e. right or bottom) of the major axis, instead of the start.
+ ;;
+ ;; If MINOR-END-P is t, then we want to start counting from the end
+ ;; of the minor axis instead of the beginning.
+ ;;
+ ;; Here's the general idea: Imagine we're trying to count the number
+ ;; of windows that abut the top; call this function foo(). So, we
+ ;; start with the root window. If this is a vertical combination
+ ;; window, then foo() applied to the root window is the same as foo()
+ ;; applied to the first child. If the root is a horizontal
+ ;; combination window, then foo() applied to the root is the same as
+ ;; the sum of foo() applied to each of the children. Otherwise, the
+ ;; root window is a leaf window, and foo() is 1. Now it's clear
+ ;; that, each time foo() encounters a leaf window, it's encountering
+ ;; a different window that abuts the top. With a little examining,
+ ;; you can see that foo encounters the top-abutting windows in order
+ ;; from left to right. We can modify foo() to return the nth
+ ;; top-abutting window by simply keeping a global variable that is
+ ;; decremented each time foo() encounters a leaf window and would
+ ;; return 1. If the global counter gets to zero, we've encountered
+ ;; the window we were looking for, so we exit right away using a
+ ;; `return-from'. Otherwise, we make sure that all normal paths
+ ;; return nil.
+ (let (child)
+ (cond ((setq child (if left-right-p
+ (window-first-hchild window)
+ (window-first-vchild window)))
+ (if major-end-p
+ (while (window-next-child child)
+ (setq child (window-next-child child))))
+ (frame-utmost-window-2 child position left-right-p
+ major-end-p minor-end-p))
+ ((setq child (if left-right-p
+ (window-first-vchild window)
+ (window-first-hchild window)))
+ (if minor-end-p
+ (while (window-next-child child)
+ (setq child (window-next-child child))))
+ (while child
+ (frame-utmost-window-2 child position left-right-p
+ major-end-p minor-end-p)
+ (setq child (if minor-end-p
+ (window-previous-child child)
+ (window-next-child child))))
+ nil)
+ (t
+ (setcar position (1- (car position)))
+ (if (eql (car position) 0)
+ (return-from frame-utmost-window-1 window)))))))
+ (let (minor-end-p)
+ (or frame (setq frame (selected-frame)))
+ (or position (setq position 0))
+ (if (>= position 0)
+ (setq position (1+ position))
+ (setq minor-end-p t)
+ (setq position (- position)))
;; we use a cons here as a simple form of call-by-reference.
;; scheme has "boxes" for the same purpose.
(frame-utmost-window-2 (frame-root-window frame) (list position)
- left-right-p major-end-p minor-end-p))))
-
+ left-right-p major-end-p minor-end-p))))
(defun frame-highest-window (&optional frame position)
"Return the highest window on FRAME which is at POSITION.
@@ -2036,7 +2031,6 @@
If omitted, POSITION defaults to 0, i.e. the highest rightmost window.
If there is no window at the given POSITION, return nil."
(frame-utmost-window-1 frame position t t))
-
;; frame properties.
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Correct the sense of an assertion,
old_mule_ichar_to_unicode()
7 years, 2 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/d986eee8b746/
Changeset: d986eee8b746
User: kehoea
Date: 2017-10-09 07:30:37+00:00
Summary: Correct the sense of an assertion, old_mule_ichar_to_unicode()
2017-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* text.c (old_mule_ichar_to_unicode):
Correct the sense of an assertion here, thank you Mike Sperber!
Affected #: 2 files
diff -r 4ae34c21a927f5fc72839592ed99e960d7538d10 -r d986eee8b74633db8cfee3ded33cde9de38802e3 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,6 +4,11 @@
Qunbound isn't a symbol, don't check for it once we've verified
ORIGINAL_FUN is a symbol.
+2017-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * text.c (old_mule_ichar_to_unicode):
+ Correct the sense of an assertion here, thank you Mike Sperber!
+
2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h:
diff -r 4ae34c21a927f5fc72839592ed99e960d7538d10 -r d986eee8b74633db8cfee3ded33cde9de38802e3 src/text.c
--- a/src/text.c
+++ b/src/text.c
@@ -1703,7 +1703,8 @@
old_mule_ichar_to_unicode (Ichar chr, enum converr fail)
{
ASSERT_VALID_ICHAR (chr);
- text_checking_assert (chr < 256);
+ text_checking_assert (chr >= 256); /* The inline function should handle
+ ASCII, control-1, Latin 1. */
{
int c1, c2;
Lisp_Object charset;
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Don't check whether original_fun is Qunbound,
we know it's a symbol, Feval()
7 years, 2 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/4ae34c21a927/
Changeset: 4ae34c21a927
User: kehoea
Date: 2017-10-07 08:30:37+00:00
Summary: Don't check whether original_fun is Qunbound, we know it's a symbol, Feval()
src/ChangeLog addition:
2017-10-07 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c (Feval):
Qunbound isn't a symbol, don't check for it once we've verified
ORIGINAL_FUN is a symbol.
Affected #: 2 files
diff -r e3925877abce049cee4c83fcfd8a78a875ee813b -r 4ae34c21a927f5fc72839592ed99e960d7538d10 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-07 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * eval.c (Feval):
+ Qunbound isn't a symbol, don't check for it once we've verified
+ ORIGINAL_FUN is a symbol.
+
2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h:
diff -r e3925877abce049cee4c83fcfd8a78a875ee813b -r 4ae34c21a927f5fc72839592ed99e960d7538d10 src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -3899,10 +3899,9 @@
retry:
/* Optimise for no indirection. */
fun = original_fun;
- if (SYMBOLP (fun) && !EQ (fun, Qunbound)
- && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
- {
- fun = indirect_function(original_fun, 1);
+ if (SYMBOLP (fun) && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
+ {
+ fun = indirect_function (original_fun, 1);
}
if (SUBRP (fun))
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Drop Ben's attempt to make Big5 into one
charset, unicode-internal.
7 years, 2 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/e3925877abce/
Changeset: e3925877abce
User: kehoea
Date: 2017-10-06 20:09:22+00:00
Summary: Drop Ben's attempt to make Big5 into one charset, unicode-internal.
src/ChangeLog addition:
2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h:
* mule-charset.c:
* mule-charset.c (syms_of_mule_charset):
* mule-charset.c (complex_vars_of_mule_charset):
* mule-charset.c (init_mule_charset):
* mule-coding.c:
* mule-coding.c (byte_big5_two_byte_1_p):
* mule-coding.c (big5_decode):
* mule-coding.c (big5_encode):
* mule-coding.c (decode_big5_char):
* mule-coding.c (big5_char_to_fake_codepoint):
* mule-coding.c (Fencode_big5_char):
* mule-coding.c (init_mule_coding):
* text.c:
* unicode.c (verify_load_unicode_args):
Remove the attempt to implement Big5 as one charset under
unicode-internal; this makes unicode-internal builds incompatible
with byte-code compiled by 21.4 and even source code,
e.g. leim/quail/Punct-B5.el.
lisp/ChangeLog addition:
2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/chinese.el:
* mule/chinese.el (for):
* mule/chinese.el (chinese-big5/list):
* mule/chinese.el (find-charset):
* mule/mule-category.el (predefined-category-list):
* mule/mule-charset.el:
Remove Ben's attempt under unicode-internal to make Big5 into one
charset. This is incompatible with byte-compiled code from 21.4,
which uses the hackish chinese-big5-1, chinese-big5-2 charsets
with ISO-2022 escapes to encode these characters.
If at some point in the future where we use UTF-8 for compiled
code this could be revisited.
Affected #: 10 files
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
+2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * mule/chinese.el:
+ * mule/chinese.el (for):
+ * mule/chinese.el (chinese-big5/list):
+ * mule/chinese.el (find-charset):
+ * mule/mule-category.el (predefined-category-list):
+ * mule/mule-charset.el:
+ Remove Ben's attempt under unicode-internal to make Big5 into one
+ charset. This is incompatible with byte-compiled code from 21.4,
+ which uses the hackish chinese-big5-1, chinese-big5-2 charsets
+ with ISO-2022 escapes to encode these characters.
+ If at some point in the future where we use UTF-8 for compiled
+ code this could be revisited.
+
2017-09-30 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/thai.el:
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b lisp/mule/chinese.el
--- a/lisp/mule/chinese.el
+++ b/lisp/mule/chinese.el
@@ -37,11 +37,8 @@
;; Setup auto-fill-chars for charsets that should invoke auto-filling.
;; SPACE and NEWLINE are already set.
-(loop for l in `(chinese-gb2312
- ,@(if (find-charset 'chinese-big5-1)
- '(chinese-big5-1 chinese-big5-2)
- '(chinese-big5)))
- do (put-char-table l t auto-fill-chars))
+(loop for l in '(chinese-gb2312 chinese-big5-1 chinese-big5-2)
+ do (put-char-table l t auto-fill-chars))
;; CNS11643 Plane3 thru Plane7
;; These represent more and more obscure Chinese characters.
@@ -111,11 +108,9 @@
:list '(chinese-cns11643-1 chinese-cns11643-2 chinese-cns11643-3
chinese-cns11643-4 chinese-cns11643-5 chinese-cns11643-6
chinese-cns11643-7))
-(define-charset-tag 'chinese-big5/list
- :list (if (featurep 'unicode-internal) '(chinese-big5)
- '(chinese-big5-1 chinese-big5-2)))
-(define-charset-tag 'chinese-gb/list
- :list '(chinese-gb2312 chinese-sisheng))
+(define-charset-tag 'chinese-big5/list :list '(chinese-big5-1 chinese-big5-2))
+
+(define-charset-tag 'chinese-gb/list :list '(chinese-gb2312 chinese-sisheng))
(define-charset-tag 'chinese-gb-env/list
:list '(chinese-gb/list chinese-big5/list chinese-cns/list chinese/language))
@@ -302,13 +297,8 @@
(define-coding-system-alias 'cn-big5 'big5)
-;; Need to use `compiled-when' because otherwise we will get an error when
-;; compiling this file under Unicode-internal because (charset-id
-;; 'chinese-big5-2) gets evaluated at compile time and fails.
-(compiled-when (find-charset 'chinese-big5-1)
- ;; Big5 font requires special encoding. But under Unicode-internal we
- ;; have one single charset `chinese-big5', with no special encoding
- ;; needed.
+(when (find-charset 'chinese-big5-1)
+ ;; Big5 font requires special encoding.
(define-ccl-program ccl-encode-big5-font
`(0
;; In: R0:chinese-big5-1 or chinese-big5-2
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b lisp/mule/mule-category.el
--- a/lisp/mule/mule-category.el
+++ b/lisp/mule/mule-category.el
@@ -238,10 +238,8 @@
;;much better category definitions.
;;(chinese-cns11643-1 ?t "Chinese Taiwan (CNS or Big5) 2-byte character set")
(chinese-cns11643-2 ?t "Chinese Taiwan (CNS or Big5) 2-byte character set")
- ,@(if (find-charset 'chinese-big5-1)
- '((chinese-big5-1 ?t)
- (chinese-big5-2 ?t))
- '((chinese-big5 ?t)))
+ (chinese-big5-1 ?t)
+ (chinese-big5-2 ?t)
(korean-ksc5601 ?h "Hangul (Korean) 2-byte character set")
(jit-ucs-charset-0 ?J "Just-in-time-allocated Unicode character")
)
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b lisp/mule/mule-charset.el
--- a/lisp/mule/mule-charset.el
+++ b/lisp/mule/mule-charset.el
@@ -1254,73 +1254,64 @@
tags (cns kanji traditional-chinese chinese/language)
))
-(if (featurep 'unicode-internal)
- ;; We can support Big5 directly.
- (make-charset
- 'chinese-big5
- "Big5 (Chinese traditional)"
- '(dimension 2
- ;; Big5 claims to be a 94x157 charset, but with gaps in the middle.
- ;; In particular, the rows are (theoretically) indexed from A1 - FE
- ;; and the columns from 40 - 7E and A1 - FE. In fact, there are gaps
- ;; in the rows as well (rows C7 and C8 are missing, as well as rows
- ;; FA - FE), but that appears to be due to accident -- i.e. they just
- ;; ran out of chars and/or wanted to make room for expansion. Note
- ;; also that the gap at C7 and C8 is due to the Level-1/Level-2
- ;; division of Big5 (see below). The 94 rows are those between
- ;; A1 and FE, inclusive. The 157 columns count the sum of the columns
- ;; in each disjoint set. For us, we need to use the size of the range
- ;; [40, FE], which is 191.
- chars (94 191)
- offset (161 64)
- short-name "Chinese traditional (Big5)"
- long-name "Chinese traditional (Big5)"
- registries ["big5.eten-0"]
- unicode-map ("unicode/unicode-consortium/EASTASIA/OBSOLETE/BIG5.TXT")
- tags (kanji traditional-chinese chinese/language)
- ))
- ;; Old Mule situation; we can only handle up to 96x96 charsets.
- ;; So we split it into two charsets. According to Ken Lunde's CJKV
- ;; book, Big5 itself is split into "Big Five Level 1" (rows A1-C6)
- ;; and "Big Five Level 2" (rows C9-F9), with the latter containing
- ;; less used characters. We split the same way then coerce the
- ;; result into a 94x94 block.
- (make-charset
- 'chinese-big5-1
- "Frequently used part (A141-C67F) of Big5 (Chinese traditional)"
- '(dimension 2
- chars 94
- final ?0
- graphic 0
- short-name "Chinese traditional (Big5), L1"
- long-name "Chinese traditional (Big5) (Level-1) A141-C67F"
- registries ["big5.eten-0"]
- ;; no unicode map, see chinese-big5-2
- tags (kanji traditional-chinese chinese/language)
- ))
- (make-charset
- 'chinese-big5-2
- "Less frequently used part (C940-FEFE) of Big5 (Chinese traditional)"
- '(dimension 2
- chars 94
- final ?1
- graphic 0
- short-name "Chinese traditional (Big5), L2"
- long-name "Chinese traditional (Big5) (Level-2) C940-FEFE"
- registries ["big5.eten-0"]
- ;; HACK HACK HACK! The `big5' special flag tells the internal code
- ;; in Fload_unicode_mapping_table() to take codepoints out of the
- ;; Big5 table, convert them to a codepoint in a "fake" chinese-big5-1
- ;; or chinese-big5-2, and store appropriately. Hence, it actually
- ;; ignores the name of the charset on which the property is set and
- ;; always stores in the "right" place. Correspondingly, we must set
- ;; the property on big5-2, not 1, so that both charsets will be
- ;; created by the time we initialize the map.
- unicode-map ("unicode/unicode-consortium/EASTASIA/OBSOLETE/BIG5.TXT"
- nil nil nil big5)
- tags (kanji traditional-chinese chinese/language)
- ))
- )
+;; Big5 claims to be a 94x157 charset, but with gaps in the middle.
+;; In particular, the rows are (theoretically) indexed from A1 - FE
+;; and the columns from 40 - 7E and A1 - FE. In fact, there are gaps
+;; in the rows as well (rows C7 and C8 are missing, as well as rows
+;; FA - FE), but that appears to be due to accident -- i.e. they just
+;; ran out of chars and/or wanted to make room for expansion. Note
+;; also that the gap at C7 and C8 is due to the Level-1/Level-2
+;; division of Big5 (see below). The 94 rows are those between
+;; A1 and FE, inclusive. The 157 columns count the sum of the columns
+;; in each disjoint set. For us, we need to use the size of the range
+;; [40, FE], which is 191.
+
+;; Old Mule situation; we can only handle up to 96x96 charsets.
+;; we split it into two charsets. According to Ken Lunde's CJKV
+;; book, Big5 itself is split into "Big Five Level 1" (rows A1-C6)
+;; and "Big Five Level 2" (rows C9-F9), with the latter containing
+;; less used characters. We split the same way then coerce the
+;; result into a 94x94 block.
+
+;; Since escape-quoted, used for byte-compiled files and auto-saves even on
+;; unicode-internal, is ISO 2022-based, it's not practical to switch, as Ben
+;; attempted to do, to a single Big5 charset for unicode-internal; doing this
+;; would mean byte-complied code from 21.4 would error on 21.5.
+
+(make-charset
+ 'chinese-big5-1
+ "Frequently used part (A141-C67F) of Big5 (Chinese traditional)"
+ '(dimension 2
+ chars 94
+ final ?0
+ graphic 0
+ short-name "Chinese traditional (Big5), L1"
+ long-name "Chinese traditional (Big5) (Level-1) A141-C67F"
+ registries ["big5.eten-0"]
+ ;; no unicode map, see chinese-big5-2
+ tags (kanji traditional-chinese chinese/language)))
+
+(make-charset
+ 'chinese-big5-2
+ "Less frequently used part (C940-FEFE) of Big5 (Chinese traditional)"
+ '(dimension 2
+ chars 94
+ final ?1
+ graphic 0
+ short-name "Chinese traditional (Big5), L2"
+ long-name "Chinese traditional (Big5) (Level-2) C940-FEFE"
+ registries ["big5.eten-0"]
+ ;; HACK HACK HACK! The `big5' special flag tells the internal code
+ ;; in Fload_unicode_mapping_table() to take codepoints out of the
+ ;; Big5 table, convert them to a codepoint in a "fake" chinese-big5-1
+ ;; or chinese-big5-2, and store appropriately. Hence, it actually
+ ;; ignores the name of the charset on which the property is set and
+ ;; always stores in the "right" place. Correspondingly, we must set
+ ;; the property on big5-2, not 1, so that both charsets will be
+ ;; created by the time we initialize the map.
+ unicode-map ("unicode/unicode-consortium/EASTASIA/OBSOLETE/BIG5.TXT"
+ nil nil nil big5)
+ tags (kanji traditional-chinese chinese/language)))
;;;;;;;;;;;;;;;;;;;;; Korean ;;;;;;;;;;;;;;;;;;;;
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
+2017-10-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lisp.h:
+ * mule-charset.c:
+ * mule-charset.c (syms_of_mule_charset):
+ * mule-charset.c (complex_vars_of_mule_charset):
+ * mule-charset.c (init_mule_charset):
+ * mule-coding.c:
+ * mule-coding.c (byte_big5_two_byte_1_p):
+ * mule-coding.c (big5_decode):
+ * mule-coding.c (big5_encode):
+ * mule-coding.c (decode_big5_char):
+ * mule-coding.c (big5_char_to_fake_codepoint):
+ * mule-coding.c (Fencode_big5_char):
+ * mule-coding.c (init_mule_coding):
+ * text.c:
+ * unicode.c (verify_load_unicode_args):
+ Remove the attempt to implement Big5 as one charset under
+ unicode-internal; this makes unicode-internal builds incompatible
+ with byte-code compiled by 21.4 and even source code,
+ e.g. leim/quail/Punct-B5.el.
+
2017-10-04 Aidan Kehoe <kehoea(a)parhasard.net>
* text.c (old_mule_ichar_to_unicode):
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -5824,12 +5824,10 @@
Qchinese_cns11643_1,
Qchinese_cns11643_2,
#ifdef UNICODE_INTERNAL
- Qchinese_big5,
Qjapanese_shift_jis,
-#else /* not UNICODE_INTERNAL */
+#endif /* UNICODE_INTERNAL */
Qchinese_big5_1,
Qchinese_big5_2,
-#endif /* UNICODE_INTERNAL */
Qchinese_sisheng,
Qcomposite;
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b src/mule-charset.c
--- a/src/mule-charset.c
+++ b/src/mule-charset.c
@@ -60,12 +60,10 @@
Lisp_Object Vcharset_japanese_jisx0212;
Lisp_Object Vcharset_chinese_cns11643_1;
Lisp_Object Vcharset_chinese_cns11643_2;
-#ifdef UNICODE_INTERNAL
-Lisp_Object Vcharset_chinese_big5;
-Lisp_Object Vcharset_japanese_shift_jis;
-#else
Lisp_Object Vcharset_chinese_big5_1;
Lisp_Object Vcharset_chinese_big5_2;
+#ifdef UNICODE_INTERNAL
+Lisp_Object Vcharset_japanese_shift_jis;
#endif /* UNICODE_INTERNAL */
Lisp_Object Vcharset_composite;
@@ -197,12 +195,10 @@
Qjapanese_jisx0212,
Qchinese_cns11643_1,
Qchinese_cns11643_2,
-#ifdef UNICODE_INTERNAL
- Qchinese_big5,
- Qjapanese_shift_jis,
-#else /* not UNICODE_INTERNAL */
Qchinese_big5_1,
Qchinese_big5_2,
+#ifdef UNICODE_INTERNAL
+ Qjapanese_shift_jis,
#endif /* UNICODE_INTERNAL */
Qchinese_sisheng,
Qcomposite;
@@ -1838,12 +1834,10 @@
DEFSYMBOL (Qjapanese_jisx0212);
DEFSYMBOL (Qchinese_cns11643_1);
DEFSYMBOL (Qchinese_cns11643_2);
-#ifdef UNICODE_INTERNAL
- DEFSYMBOL (Qchinese_big5);
- DEFSYMBOL (Qjapanese_shift_jis);
-#else /* not UNICODE_INTERNAL */
DEFSYMBOL (Qchinese_big5_1);
DEFSYMBOL (Qchinese_big5_2);
+#ifdef UNICODE_INTERNAL
+ DEFSYMBOL (Qjapanese_shift_jis);
#endif /* UNICODE_INTERNAL */
DEFSYMBOL (Qcomposite);
@@ -2021,17 +2015,14 @@
Vcharset_chinese_cns11643_1 = Qnil;
staticpro (&Vcharset_chinese_cns11643_2);
Vcharset_chinese_cns11643_2 = Qnil;
-#ifdef UNICODE_INTERNAL
- /* We can support Shift-JIS and Big5 directly.*/
- staticpro (&Vcharset_japanese_shift_jis);
- Vcharset_japanese_shift_jis = Qnil;
- staticpro (&Vcharset_chinese_big5);
- Vcharset_chinese_big5 = Qnil;
-#else
staticpro (&Vcharset_chinese_big5_1);
Vcharset_chinese_big5_1 = Qnil;
staticpro (&Vcharset_chinese_big5_2);
Vcharset_chinese_big5_2 = Qnil;
+#ifdef UNICODE_INTERNAL
+ /* We can support Shift-JIS directly.*/
+ staticpro (&Vcharset_japanese_shift_jis);
+ Vcharset_japanese_shift_jis = Qnil;
#endif /* UNICODE_INTERNAL */
#ifdef ENABLE_COMPOSITE_CHARS
@@ -2144,12 +2135,10 @@
Vcharset_japanese_jisx0212 = Fget_charset (Qjapanese_jisx0212);
Vcharset_chinese_cns11643_1 = Fget_charset (Qchinese_cns11643_1);
Vcharset_chinese_cns11643_2 = Fget_charset (Qchinese_cns11643_2);
-#ifdef UNICODE_INTERNAL
- /* We can support Shift-JIS and Big5 directly.*/
- Vcharset_japanese_shift_jis = Fget_charset (Qjapanese_shift_jis);
- Vcharset_chinese_big5 = Fget_charset (Qchinese_big5);
-#else
Vcharset_chinese_big5_1 = Fget_charset (Qchinese_big5_1);
Vcharset_chinese_big5_2 = Fget_charset (Qchinese_big5_2);
+#ifdef UNICODE_INTERNAL
+ /* We can support Shift-JIS directly.*/
+ Vcharset_japanese_shift_jis = Fget_charset (Qjapanese_shift_jis);
#endif /* UNICODE_INTERNAL */
}
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b src/mule-coding.c
--- a/src/mule-coding.c
+++ b/src/mule-coding.c
@@ -898,8 +898,6 @@
/* BIG5 (used for Mandarin in Taiwan). */
DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (big5);
-#ifndef UNICODE_INTERNAL
-
/* BIG5 is a coding system encoding two character sets: ASCII and
Big5. An ASCII character is encoded as is. Big5 is a two-byte
character set and is encoded in two-byte.
@@ -991,8 +989,6 @@
b2 += b2 < 0x3F ? 0x40 : 0x62; \
} while (0)
-#endif /* not UNICODE_INTERNAL */
-
inline static int
byte_big5_two_byte_1_p (int c)
{
@@ -1024,17 +1020,11 @@
/* Previous character was first byte of Big5 char. */
if (byte_big5_two_byte_2_p (c))
{
-#ifdef UNICODE_INTERNAL
- non_ascii_charset_codepoint_to_dynarr
- (Vcharset_chinese_big5, data->ch, c, dst,
- CONVERR_USE_PRIVATE);
-#else /* not UNICODE_INTERNAL */
Lisp_Object charset;
int b1, b2;
DECODE_BIG5 (data->ch, c, charset, b1, b2);
non_ascii_charset_codepoint_to_dynarr
(charset, b1, b2, dst, CONVERR_USE_PRIVATE);
-#endif /* UNICODE_INTERNAL */
}
else
{
@@ -1084,13 +1074,6 @@
}
ichar_to_charset_codepoint
(ich, Vbig5_precedence, &charset, &c1, &c2, CONVERR_FAIL);
-#ifdef UNICODE_INTERNAL
- if (EQ (charset, Vcharset_chinese_big5))
- {
- Dynarr_add (dst, c1);
- Dynarr_add (dst, c2);
- }
-#else /* not UNICODE_INTERNAL */
if (EQ (charset, Vcharset_chinese_big5_1) ||
EQ (charset, Vcharset_chinese_big5_2))
{
@@ -1099,7 +1082,6 @@
Dynarr_add (dst, b1);
Dynarr_add (dst, b2);
}
-#endif /* UNICODE_INTERNAL */
else
{
handle_standard_encoding_error (str, src, dst);
@@ -1131,10 +1113,6 @@
static Ichar
decode_big5_char (int b1, int b2)
{
-#ifdef UNICODE_INTERNAL
- return charset_codepoint_to_ichar (Vcharset_chinese_big5, b1, b2,
- CONVERR_FAIL);
-#else /* not UNICODE_INTERNAL */
if (byte_big5_two_byte_1_p (b1) &&
byte_big5_two_byte_2_p (b2))
{
@@ -1146,11 +1124,8 @@
}
else
return -1;
-#endif /* UNICODE_INTERNAL */
}
-#ifndef UNICODE_INTERNAL
-
void
big5_char_to_fake_codepoint (int b1, int b2, Lisp_Object *charset, int *c1,
int *c2)
@@ -1168,8 +1143,6 @@
}
}
-#endif /* not UNICODE_INTERNAL */
-
DEFUN ("decode-big5-char", Fdecode_big5_char, 1, 1, 0, /*
Convert Big Five character codes in CODE into a character.
CODE is a cons of two integers specifying the codepoints in Big Five.
@@ -1208,12 +1181,6 @@
CHECK_CHAR_COERCE_INT (character);
ichar_to_charset_codepoint (XCHAR (character), Vbig5_precedence,
&charset, &c1, &c2, CONVERR_FAIL);
-#ifdef UNICODE_INTERNAL
- if (EQ (charset, Vcharset_chinese_big5))
- {
- return Fcons (make_fixnum (c1), make_fixnum (c2));
- }
-#else /* not UNICODE_INTERNAL */
if (EQ (charset, Vcharset_chinese_big5_1) ||
EQ (charset, Vcharset_chinese_big5_2))
{
@@ -1221,7 +1188,6 @@
ENCODE_BIG5 (charset, c1, c2, b1, b2);
return Fcons (make_fixnum (b1), make_fixnum (b2));
}
-#endif /* UNICODE_INTERNAL */
else
return Qnil;
}
@@ -4187,14 +4153,7 @@
simple_convert_predence_list_to_array
(list3 (Vcharset_japanese_jisx0208, Vcharset_japanese_jisx0208_1978,
Vcharset_katakana_jisx0201));
-
-#ifdef UNICODE_INTERNAL
- Vbig5_precedence =
- simple_convert_predence_list_to_array
- (list1 (Vcharset_chinese_big5));
-#else /* not UNICODE_INTERNAL */
Vbig5_precedence =
simple_convert_predence_list_to_array
(list2 (Vcharset_chinese_big5_1, Vcharset_chinese_big5_2));
-#endif /* UNICODE_INTERNAL */
}
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b src/text.c
--- a/src/text.c
+++ b/src/text.c
@@ -5521,14 +5521,11 @@
All codes above are two decimal numbers except for Big Five and ANSI
Z39.64, which we don't support. We add 32 to each of the decimal numbers.
-Note that in an old-Mule world (see below), Big Five is split in a rather
-hackish fashion into two charsets, `chinese-big5-1' and `chinese-big5-2',
-due to its excessive size (94x157), with the first codepoint in the range
-0xA1 to 0xFE and the second in the range 0x40 to 0x7E or 0xA1 to 0xFE.
-`decode-big5-char' is used to generate the char from its codes, and
-`encode-big5-char' extracts the codes. This hack doesn't exist with
-Unicode-internal, and hence the expression (make-char 'chinese-big5 164 116)
-could be used.
+Big Five is split in a rather hackish fashion into two charsets,
+`chinese-big5-1' and `chinese-big5-2', due to its excessive size (94x157),
+with the first codepoint in the range 0xA1 to 0xFE and the second in the range
+0x40 to 0x7E or 0xA1 to 0xFE. `decode-big5-char' is used to generate the char
+from its codes, and `encode-big5-char' extracts the codes.
Note that there are three different internal formats for characters:
diff -r 19876e056bb7630f1854719c8b037a1f2fb691e8 -r e3925877abce049cee4c83fcfd8a78a875ee813b src/unicode.c
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -2248,10 +2248,8 @@
{
if (EQ (elt, Qignore_first_column))
*flags_out |= LOAD_UNICODE_IGNORE_FIRST_COLUMN;
-#ifndef UNICODE_INTERNAL
else if (EQ (elt, Qbig5))
*flags_out |= LOAD_UNICODE_BIG5;
-#endif /* not UNICODE_INTERNAL */
else
invalid_constant
("Unrecognized `load-unicode-mapping-table' flag", elt);
@@ -2324,9 +2322,7 @@
int flgs;
int stage;
int to_unicode_min_val[256], to_unicode_max_val[256];
-#ifndef UNICODE_INTERNAL
int big5_other_unicode_min_val[256], big5_other_unicode_max_val[256];
-#endif
int i;
/* This may be called to autoload the Unicode tables, from a function
@@ -2338,7 +2334,6 @@
verify_load_unicode_args (filename, start, end, offset, flags,
&st, &en, &of, &flgs);
-#ifndef UNICODE_INTERNAL
if (flgs & LOAD_UNICODE_BIG5)
{
/* At this point the charsets haven't been initialized
@@ -2353,7 +2348,6 @@
big5_other_unicode_max_val[i] = 0;
}
}
-#endif /* not UNICODE_INTERNAL */
for (i = 0; i < 256; i++)
{
@@ -2482,7 +2476,6 @@
cp1high = cp1 >> 8;
cp1low = cp1 & 255;
-#ifndef UNICODE_INTERNAL
if (flgs & LOAD_UNICODE_BIG5)
{
big5_char_to_fake_codepoint (cp1high, cp1low,
@@ -2509,7 +2502,6 @@
set_unicode_conversion (cp2, charset, c1, c2);
}
else
-#endif /* not UNICODE_INTERNAL */
{
int l1, l2, h1, h2;
c1 = cp1high, c2 = cp1low;
@@ -2520,9 +2512,7 @@
goto out_of_range;
}
-#ifndef UNICODE_INTERNAL
do_it:
-#endif
if (stage == 0)
{
if (c2 < to_unicode_min_val[c1])
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Be more realistic, #'char-to-unicode,
#'make-char
7 years, 3 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/19876e056bb7/
Changeset: 19876e056bb7
User: kehoea
Date: 2017-10-04 23:08:17+00:00
Summary: Be more realistic, #'char-to-unicode, #'make-char
2017-10-04 Aidan Kehoe <kehoea(a)parhasard.net>
* text.c (old_mule_ichar_to_unicode):
Assert we haven't been handed an Ichar less than 256 in value.
* text.c (unicode_internal_handle_bad_ichar_to_unicode): New.
Handle a value passed to the inline ichar_to_unicode(), if CHR is
not an official Unicode character and FAIL is not
CONVERR_USE_PRIVATE.
* text.c (Fmake_char):
Make this API compatible with GNU and with pre-unicode-internal,
return a private character by default if HANDLE-ERROR is nil.
* text.c (Fchar_to_unicode):
Return nil if HANDLE-ERROR is FAIL or nil here.
* text.c (Funicode_to_char):
* text.c (Fchar_to_charset_codepoint):
* text.c (Fchar_charset):
* text.c (Fsplit_char):
Update the docstrings in this three functions.
* text.h (ichar_to_unicode):
Make the implementation of this a bit more realistic with
UNICODE_INTERNAL, use the new
unicode_internal_handle_bad_ichar_to_unicode().
Affected #: 3 files
diff -r 8df05e6e201fbbd618c7127c762bf954028ceec3 -r 19876e056bb7630f1854719c8b037a1f2fb691e8 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,26 @@
+2017-10-04 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * text.c (old_mule_ichar_to_unicode):
+ Assert we haven't been handed an Ichar less than 256 in value.
+ * text.c (unicode_internal_handle_bad_ichar_to_unicode): New.
+ Handle a value passed to the inline ichar_to_unicode(), if CHR is
+ not an official Unicode character and FAIL is not
+ CONVERR_USE_PRIVATE.
+ * text.c (Fmake_char):
+ Make this API compatible with GNU and with pre-unicode-internal,
+ return a private character by default if HANDLE-ERROR is nil.
+ * text.c (Fchar_to_unicode):
+ Return nil if HANDLE-ERROR is FAIL or nil here.
+ * text.c (Funicode_to_char):
+ * text.c (Fchar_to_charset_codepoint):
+ * text.c (Fchar_charset):
+ * text.c (Fsplit_char):
+ Update the docstrings in this three functions.
+ * text.h (ichar_to_unicode):
+ Make the implementation of this a bit more realistic with
+ UNICODE_INTERNAL, use the new
+ unicode_internal_handle_bad_ichar_to_unicode().
+
2017-09-30 Aidan Kehoe <kehoea(a)parhasard.net>
* text.c (old_mule_non_ascii_valid_ichar_p):
diff -r 8df05e6e201fbbd618c7127c762bf954028ceec3 -r 19876e056bb7630f1854719c8b037a1f2fb691e8 src/text.c
--- a/src/text.c
+++ b/src/text.c
@@ -1703,11 +1703,7 @@
old_mule_ichar_to_unicode (Ichar chr, enum converr fail)
{
ASSERT_VALID_ICHAR (chr);
-
- /* This shortcut depends on the representation of an Ichar, see text.c. */
- if (chr < 256)
- return (int) chr;
-
+ text_checking_assert (chr < 256);
{
int c1, c2;
Lisp_Object charset;
@@ -1862,6 +1858,39 @@
#endif /* not UNICODE_INTERNAL */
+int
+unicode_internal_handle_bad_ichar_to_unicode (Ichar chr, enum converr fail)
+{
+ ASSERT_VALID_ICHAR (chr);
+ text_checking_assert (fail != CONVERR_USE_PRIVATE);
+ text_checking_assert (!valid_unicode_codepoint_p (chr,
+ UNICODE_OFFICIAL_ONLY));
+ switch (fail)
+ {
+ case CONVERR_FAIL:
+ return -1;
+ case CONVERR_ERROR:
+ if (chr > UNICODE_OFFICIAL_MAX)
+ {
+ args_out_of_range_3 (make_fixnum (chr), Qzero,
+ make_fixnum (UNICODE_OFFICIAL_MAX));
+ }
+ if (chr >= FIRST_UTF_16_SURROGATE)
+ {
+ args_out_of_range_3 (make_fixnum (chr), Qzero,
+ make_fixnum (FIRST_UTF_16_SURROGATE));
+ }
+ /* FALLTHROUGH */
+ case CONVERR_ABORT:
+ case CONVERR_USE_PRIVATE:
+ default:
+ ABORT ();
+ case CONVERR_SUCCEED:
+ case CONVERR_SUBSTITUTE:
+ return 0xFFFD;
+ }
+}
+
#endif /* MULE */
/* Take a possibly invalid Ichar value (must be >= 0) and move upwards as
@@ -5422,11 +5451,11 @@
to translate. Currently, this happens only with Unicode-internal (see
below):
-nil or `fail' Return nil
-`abort' Signal an error
-`succeed' Same as `substitute'
-`substitute' Substitute the Unicode replacement char (0xFFFD)
-`use-private' Encode using private Unicode space
+`use-private' or `nil' Encode using private Unicode space
+`fail' Return nil
+`error' Signal an error
+`succeed' Same as `substitute'
+`substitute' Substitute the Unicode replacement char (0xFFFD)
Each octet should be in the range corresponding to the offset and size
for that dimension, as defined in the charset. For a typical one-dimensional
@@ -5602,10 +5631,16 @@
*/
(charset, octet1, octet2, handle_error))
{
- enum converr fail = decode_handle_error (handle_error, 1);
+ enum converr fail;
int a1, a2;
Ichar ch;
+ if (NILP (handle_error))
+ {
+ handle_error = Quse_private;
+ }
+
+ fail = decode_handle_error (handle_error, 1);
charset = get_external_charset_codepoint (charset, octet1, octet2,
&a1, &a2, 1);
ch = charset_codepoint_to_ichar (charset, a1, a2, fail);
@@ -5622,7 +5657,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute the Unicode replacement char (0xFFFD)
`use-private' Encode using private Unicode space
@@ -5630,9 +5665,18 @@
(character, handle_error))
{
enum converr fail = decode_handle_error (handle_error, 1);
+ INT_32_BIT result;
CHECK_CHAR_COERCE_INT (character);
- return make_fixnum (ichar_to_unicode (XCHAR (character), fail));
+
+ result = ichar_to_unicode (XCHAR (character), fail);
+
+ if (result < 0)
+ {
+ return Qnil;
+ }
+
+ return make_fixnum (result);
}
DEFUN ("unicode-to-char", Funicode_to_char, 1, 3, 0, /*
@@ -5684,7 +5728,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute a '?' character
*/
@@ -5727,7 +5771,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute a '?' character
*/
@@ -5761,7 +5805,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute the Unicode replacement char (0xFFFD)
`use-private' Encode using private Unicode space
@@ -5799,7 +5843,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute a '?' character
*/
@@ -5849,7 +5893,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute a '?' character
*/
@@ -5928,7 +5972,7 @@
HANDLE-ERROR controls error behavior:
nil or `fail' Return nil
-`abort' Signal an error
+`error' Signal an error
`succeed' Same as `substitute'
`substitute' Substitute a '?' character
*/
diff -r 8df05e6e201fbbd618c7127c762bf954028ceec3 -r 19876e056bb7630f1854719c8b037a1f2fb691e8 src/text.h
--- a/src/text.h
+++ b/src/text.h
@@ -522,15 +522,17 @@
#define LAST_TRAILING_BYTE 0xFF
#endif
-#ifndef UNICODE_INTERNAL
-MODULE_API int old_mule_non_ascii_valid_ichar_p (Ichar ch);
+#ifdef UNICODE_INTERNAL
+MODULE_API INT_32_BIT unicode_internal_handle_bad_ichar_to_unicode (Ichar,
+ enum
+ converr);
+#elif defined (MULE)
+MODULE_API INT_32_BIT old_mule_non_ascii_valid_ichar_p (Ichar ch);
#endif
-/* Return whether the given Ichar is valid.
- */
-
+/* Return whether the given Ichar is valid. */
DECLARE_INLINE_HEADER (
-int
+Boolint
valid_ichar_p (Ichar ch)
)
{
@@ -826,12 +828,30 @@
Return value will be -1 if cannot convert. */
DECLARE_INLINE_HEADER (
int
-ichar_to_unicode (Ichar chr, enum converr USED_IF_OLD_MULE (fail))
+ichar_to_unicode (Ichar chr, enum converr USED_IF_MULE (fail))
)
{
ASSERT_VALID_ICHAR (chr);
-#if defined (MULE) && !defined (UNICODE_INTERNAL)
+ /* This shortcut depends on the representation of an Ichar, see text.c. */
+ if (chr < 256)
+ {
+ return (int) chr;
+ }
+
+#ifdef UNICODE_INTERNAL
+ if (fail == CONVERR_USE_PRIVATE)
+ {
+ return (int) chr;
+ }
+
+ if (valid_unicode_codepoint_p (chr, UNICODE_OFFICIAL_ONLY))
+ {
+ return (int) chr;
+ }
+
+ return unicode_internal_handle_bad_ichar_to_unicode (chr, fail);
+#elif defined (MULE)
return old_mule_ichar_to_unicode (chr, fail);
#else
/* Unicode-internal or non-Mule */
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fontify untyped function declarations in C Mode
correctly.
7 years, 3 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/57b32f709a4f/
Changeset: 57b32f709a4f
User: acm
Date: 2017-10-04 16:58:54+00:00
Summary: Fontify untyped function declarations in C Mode correctly.
Also correct two bugs where deleting WS at a BOL could leave an untyped
function declaration unfontified.
* cc-engine.el (c-find-decl-spots): Don't set the flag "top-level" when we're
in a macro.
(c-forward-decl-or-cast-1): Recognize top-level "foo(bar)" or "foo()" in C
Mode as a implicitly typed function declaration.
(c-just-after-func-arglist-p): Don't get confused by "defined (foo)" inside a
macro. It's not a function plus arglist.
* cc-langs.el (c-cpp-expr-functions-key): New defconst and defvar.
* cc-mode.el (c-fl-decl-end): After c-forward-declarator, move over any
following parenthesis expression (i.e. parameter list).
(c-change-expand-fl-region): When c-new-END is at a BOL, include that line in
the returned region, to cope with deletions at column 0.
Affected #: 3 files
diff -r e39b785df77e0a0f89c55aa73e042cc6cc499028 -r 57b32f709a4f3f80c78071d67fec82b4cc629878 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -134,7 +134,7 @@
;;
;; 'c-not-decl
;; Put on the brace which introduces a brace list and on the commas
-;; which separate the element within it.
+;; which separate the elements within it.
;;
;; 'c-awk-NL-prop
;; Used in AWK mode to mark the various kinds of newlines. See
@@ -5413,8 +5413,8 @@
(min c-bs-cache-limit pos)))
(defun c-update-brace-stack (stack from to)
- ;; Give a brace-stack which has the value STACK at position FROM, update it
- ;; to it's value at position TO, where TO is after (or equal to) FROM.
+ ;; Given a brace-stack which has the value STACK at position FROM, update it
+ ;; to its value at position TO, where TO is after (or equal to) FROM.
;; Return a cons of either TO (if it is outside a literal) and this new
;; value, or of the next position after TO outside a literal and the new
;; value.
@@ -5659,11 +5659,13 @@
;; Call CFD-FUN for each possible spot for a declaration, cast or
;; label from the point to CFD-LIMIT.
;;
- ;; CFD-FUN is called with point at the start of the spot. It's passed two
+ ;; CFD-FUN is called with point at the start of the spot. It's passed three
;; arguments: The first is the end position of the token preceding the spot,
;; or 0 for the implicit match at bob. The second is a flag that is t when
- ;; the match is inside a macro. Point should be moved forward by at least
- ;; one token.
+ ;; the match is inside a macro. The third is a flag that is t when the
+ ;; match is at "top level", i.e. outside any brace block, or directly inside
+ ;; a class or namespace, etc. Point should be moved forward by at least one
+ ;; token.
;;
;; If CFD-FUN adds `c-decl-end' properties somewhere below the current spot,
;; it should return non-nil to ensure that the next search will find them.
@@ -6059,6 +6061,8 @@
(setq cfd-macro-end 0)
nil)))) ; end of when condition
+ (when (> cfd-macro-end 0)
+ (setq cfd-top-level nil)) ; In a macro is "never" at top level.
(c-debug-put-decl-spot-faces cfd-match-pos (point))
(if (funcall cfd-fun cfd-match-pos (/= cfd-macro-end 0) cfd-top-level)
(setq cfd-prop-match nil))
@@ -8586,7 +8590,13 @@
(looking-at c-noise-macro-with-parens-name-re))
(c-forward-noise-clause))
- ((looking-at c-type-decl-suffix-key)
+ ((and (looking-at c-type-decl-suffix-key)
+ ;; We avoid recognizing foo(bar) or foo() at top level as a
+ ;; construct here in C, since we want to recognize this as a
+ ;; typeless function declaration.
+ (not (and (c-major-mode-is 'c-mode)
+ (eq context 'top)
+ (eq (char-after) ?\)))))
(if (eq (char-after) ?\))
(when (> paren-depth 0)
(setq paren-depth (1- paren-depth))
@@ -8629,7 +8639,12 @@
(save-excursion
(goto-char after-paren-pos)
(c-forward-syntactic-ws)
- (c-forward-type)))))
+ (or (c-forward-type)
+ ;; Recognize a top-level typeless
+ ;; function declaration in C.
+ (and (c-major-mode-is 'c-mode)
+ (eq context 'top)
+ (eq (char-after) ?\))))))))
(setq pos (c-up-list-forward (point)))
(eq (char-before pos) ?\)))
(c-fdoc-shift-type-backward)
@@ -9046,9 +9061,12 @@
;; (in at least C++) that anything that can be parsed as a declaration
;; is a declaration. Now we're being more defensive and prefer to
;; highlight things like "foo (bar);" as a declaration only if we're
- ;; inside an arglist that contains declarations.
+ ;; inside an arglist that contains declarations. Update (2017-09): We
+ ;; now recognize a top-level "foo(bar);" as a declaration in C.
;; CASE 19
- (eq context 'decl))))
+ (or (eq context 'decl)
+ (and (c-major-mode-is 'c-mode)
+ (eq context 'top))))))
;; The point is now after the type decl expression.
@@ -9556,6 +9574,7 @@
comment at the start of cc-engine.el for more info."
;; Note to maintainers: this function consumes a great mass of CPU cycles.
;; It's use should thus be minimised as far as possible.
+ ;; Consider instead using `c-bs-at-toplevel-p'.
(let ((paren-state (c-parse-state)))
(or (not (c-most-enclosing-brace paren-state))
(c-search-uplist-for-classkey paren-state))))
@@ -9585,8 +9604,15 @@
(not (and (c-major-mode-is 'objc-mode)
(c-forward-objc-directive)))
+ ;; Don't confuse #if .... defined(foo) for a function arglist.
+ (not (and (looking-at c-cpp-expr-functions-key)
+ (save-excursion
+ (save-restriction
+ (widen)
+ (c-beginning-of-macro lim)))))
(setq id-start
(car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) 'top nil)))
+ (numberp id-start)
(< id-start beg)
;; There should not be a '=' or ',' between beg and the
diff -r e39b785df77e0a0f89c55aa73e042cc6cc499028 -r 57b32f709a4f3f80c78071d67fec82b4cc629878 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -935,6 +935,11 @@
'("defined"))
pike '("defined" "efun" "constant"))
+(c-lang-defconst c-cpp-expr-functions-key
+ ;; Matches a function in a cpp expression.
+ t (c-make-keywords-re t (c-lang-const c-cpp-expr-functions)))
+(c-lang-defvar c-cpp-expr-functions-key (c-lang-const c-cpp-expr-functions-key))
+
(c-lang-defconst c-assignment-operators
"List of all assignment operators."
t '("=" "*=" "/=" "%=" "+=" "-=" ">>=" "<<=" "&=" "^=" "|=")
diff -r e39b785df77e0a0f89c55aa73e042cc6cc499028 -r 57b32f709a4f3f80c78071d67fec82b4cc629878 cc-mode.el
--- a/cc-mode.el
+++ b/cc-mode.el
@@ -1551,6 +1551,8 @@
(and (c-beginning-of-macro)
(progn (c-end-of-macro) (point))))))
(when (and (c-forward-declarator lim)
+ (or (not (eq (char-after) ?\())
+ (c-go-list-forward nil lim))
(eq (c-forward-token-2 1 nil lim) 0))
(c-backward-syntactic-ws)
(point))))))
@@ -1569,7 +1571,7 @@
(or (c-fl-decl-start c-new-BEG) (c-point 'bol c-new-BEG))
c-new-END
(or (c-fl-decl-end c-new-END)
- (c-point 'bonl (max (1- c-new-END) (point-min)))))))
+ (c-point 'bonl c-new-END)))))
(defun c-context-expand-fl-region (beg end)
;; Return a cons (NEW-BEG . NEW-END), where NEW-BEG is the beginning of a
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix a CC Mode brace stack cache bug.
7 years, 3 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/e39b785df77e/
Changeset: e39b785df77e
User: acm
Date: 2017-10-02 14:21:41+00:00
Summary: Fix a CC Mode brace stack cache bug.
* cc-engine.el (c-update-brace-stack): Call c-beginning-of-current-token after
a failing search operation, to ensure we don't cache a point inside a token.
Affected #: 1 file
diff -r 31e4abcac39929366dbd6be1d224351064226973 -r e39b785df77e0a0f89c55aa73e042cc6cc499028 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -5420,8 +5420,7 @@
;; value.
(let (match kwd-sym (prev-match-pos 1)
(s (cdr stack))
- (bound-<> (car stack))
- )
+ (bound-<> (car stack)))
(save-excursion
(cond
((and bound-<> (<= to bound-<>))
@@ -5482,6 +5481,9 @@
(setq s (cdr s))))
((c-keyword-member kwd-sym 'c-flat-decl-block-kwds)
(push 0 s))))
+ ;; The failing `c-syntactic-re-search-forward' may have left us in the
+ ;; middle of a token, which might be a significant token. Fix this!
+ (c-beginning-of-current-token)
(cons (point)
(cons bound-<> s)))))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.