[PATCH] Always use boyer_moore in ASCII or Latin-1 buffers with ASCII search strings
17 years
Aidan Kehoe
3 files changed, 189 insertions(+), 56 deletions(-)
src/ChangeLog | 30 +++++++++
src/casetab.c | 25 ++++++-
src/search.c | 190 +++++++++++++++++++++++++++++++++++++++++----------------
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1198686616 -3600
# Node ID 4ee73bbe4f8e814fb02c11cb586a6ea3e539e720
# Parent cc293ef846d240af187a523bb32eb5e26a083531
Always use boyer_moore in ASCII or Latin-1 buffers with ASCII search strings.
2007-12-26 Aidan Kehoe <kehoea(a)parhasard.net>
* casetab.c:
Extend and correct some case table documentation.
* search.c (search_buffer):
Correct a bug where only the first entry for a character in the
case equivalence table was examined in determining if the
Boyer-Moore search algorithm is appropriate.
If there are case mappings outside of the charset and row of the
characters specified in the search string, those case mappings can
be safely ignored (and Boyer-Moore search can be used) if we know
from the buffer statistics that the corresponding characters cannot
occur.
* search.c (boyer_moore):
Assert that we haven't been passed a string with varying
characters sets or rows within character sets. That's what
simple_search is for.
In the very rare event that a character in the search string has a
canonical case mapping that is not in the same character set and
row, don't try to search for the canonical character, search for
some other character that is in the the desired character set and
row. Assert that the case table isn't corrupt.
Do not search for any character case mappings that cannot possibly
occur in the buffer, given the buffer metadata about its
contents.
diff -r cc293ef846d2 -r 4ee73bbe4f8e src/ChangeLog
--- a/src/ChangeLog Mon Dec 24 14:00:51 2007 +0100
+++ b/src/ChangeLog Wed Dec 26 17:30:16 2007 +0100
@@ -1,3 +1,33 @@ 2007-12-24 Aidan Kehoe <kehoea@parhasa
+2007-12-26 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * casetab.c:
+ Extend and correct some case table documentation.
+ * search.c (search_buffer):
+ Correct a bug where only the first entry for a character in the
+ case equivalence table was examined in determining if the
+ Boyer-Moore search algorithm is appropriate.
+
+ If there are case mappings outside of the charset and row of the
+ characters specified in the search string, those case mappings can
+ be safely ignored (and Boyer-Moore search can be used) if we know
+ from the buffer statistics that the corresponding characters cannot
+ occur.
+
+ * search.c (boyer_moore):
+ Assert that we haven't been passed a string with varying
+ characters sets or rows within character sets. That's what
+ simple_search is for.
+
+ In the very rare event that a character in the search string has a
+ canonical case mapping that is not in the same character set and
+ row, don't try to search for the canonical character, search for
+ some other character that is in the the desired character set and
+ row. Assert that the case table isn't corrupt.
+
+ Do not search for any character case mappings that cannot possibly
+ occur in the buffer, given the buffer metadata about its
+ contents.
+
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (Fintern_soft):
diff -r cc293ef846d2 -r 4ee73bbe4f8e src/casetab.c
--- a/src/casetab.c Mon Dec 24 14:00:51 2007 +0100
+++ b/src/casetab.c Wed Dec 26 17:30:16 2007 +0100
@@ -48,13 +48,28 @@ Boston, MA 02111-1307, USA. */
or vice versa, both characters will have the same entry in the canon
table.
- (4) `equiv' lists the "equivalence classes" defined by `canon'. Imagine
+ (4) `eqv' lists the "equivalence classes" defined by `canon'. Imagine
that all characters are divided into groups having the same `canon'
- entry; these groups are called "equivalence classes" and `equiv' lists
- them by linking the characters in each equivalence class together in a
- circular list.
+ entry; these groups are called "equivalence classes" and `eqv' lists them
+ by linking the characters in each equivalence class together in a
+ circular list. That is, to find out all all the members of a given char's
+ equivalence classe, you need something like the following code:
- `canon' is used when doing case-insensitive comparisons. `equiv' is
+ (let* ((char ?i)
+ (original-char char)
+ (standard-case-eqv (case-table-eqv (standard-case-table))))
+ (loop
+ with res = (list char)
+ until (eq (setq char (get-char-table char standard-case-eqv))
+ original-char)
+ do (push char res)
+ finally return res))
+
+ (Where #'case-table-eqv doesn't yet exist, and probably never will, given
+ that the C code needs to keep it in a consistent state so Lisp can't mess
+ around with it.)
+
+ `canon' is used when doing case-insensitive comparisons. `eqv' is
used in the Boyer-Moore search code.
*/
diff -r cc293ef846d2 -r 4ee73bbe4f8e src/search.c
--- a/src/search.c Mon Dec 24 14:00:51 2007 +0100
+++ b/src/search.c Wed Dec 26 17:30:16 2007 +0100
@@ -1340,11 +1340,14 @@ search_buffer (struct buffer *buf, Lisp_
{
int charset_base = -1;
int boyer_moore_ok = 1;
- Ibyte *pat = 0;
Ibyte *patbuf = alloca_ibytes (len * MAX_ICHAR_LEN);
- pat = patbuf;
+ Ibyte *pat = patbuf;
+
#ifdef MULE
- /* &&#### needs some 8-bit work here */
+ int entirely_one_byte_p = buf->text->entirely_one_byte_p;
+ int nothing_greater_than_0xff =
+ buf->text->num_8_bit_fixed_chars == BUF_Z(buf) - BUF_BEG (buf);
+
while (len > 0)
{
Ibyte tmp_str[MAX_ICHAR_LEN];
@@ -1367,23 +1370,68 @@ search_buffer (struct buffer *buf, Lisp_
inv_bytelen = set_itext_ichar (tmp_str, inverse);
new_bytelen = set_itext_ichar (tmp_str, translated);
- if (new_bytelen != orig_bytelen || inv_bytelen != orig_bytelen)
- boyer_moore_ok = 0;
- if (translated != c || inverse != c)
- {
- /* Keep track of which charset and character set row
- contains the characters that need translation.
- Zero out the bits corresponding to the last byte.
- */
- int charset_base_code = c & ~ICHAR_FIELD3_MASK;
- if (charset_base == -1)
- charset_base = charset_base_code;
- else if (charset_base != charset_base_code)
- /* If two different rows appear, needing translation, then
- we cannot use boyer_moore search. See the comment at the
- head of boyer_moore(). */
- boyer_moore_ok = 0;
- }
+ if (-1 == charset_base)
+ {
+ /* Keep track of which charset and character set row
+ contains the characters that need translation.
+
+ Zero out the bits corresponding to the last byte. */
+ charset_base = c & ~ICHAR_FIELD3_MASK;
+ }
+
+ if (boyer_moore_ok && (translated != c || inverse != c))
+ {
+ Ichar starting_c = c;
+ int charset_base_code;
+
+ do
+ {
+ c = TRANSLATE (inverse_trt, c);
+
+ /* If a character cannot occur in the buffer, ignore
+ it. */
+ if (c > 0x7F && entirely_one_byte_p)
+ continue;
+
+ if (c > 0xFF && nothing_greater_than_0xff)
+ continue;
+
+ charset_base_code = c & ~ICHAR_FIELD3_MASK;
+
+ if (charset_base_code != charset_base)
+ {
+ /* If two different rows, or two different charsets,
+ appear, needing translation, then we cannot use
+ boyer_moore search. See the comment at the head of
+ boyer_moore(). */
+ boyer_moore_ok = 0;
+ break;
+ }
+ } while (c != starting_c);
+
+ if (boyer_moore_ok && (charset_base !=
+ (translated & ~ICHAR_FIELD3_MASK)))
+ {
+ /* In the rare event that the CANON entry for this
+ character is not in the desired set, choose one
+ that is, from the equivalence set. It doesn't much
+ matter which. */
+ Ichar starting_ch = translated;
+ do
+ {
+ translated = TRANSLATE (inverse_trt, translated);
+
+ if (charset_base == (translated & ~ICHAR_FIELD3_MASK))
+ break;
+
+ } while (starting_ch != translated);
+
+ assert (starting_ch != translated);
+
+ new_bytelen = set_itext_ichar (tmp_str, translated);
+ }
+ }
+
memcpy (pat, tmp_str, new_bytelen);
pat += new_bytelen;
base_pat += orig_bytelen;
@@ -1551,14 +1599,14 @@ simple_search (struct buffer *buf, Ibyte
makes it possible to translate just the last byte of a character,
and do so after just a simple test of the context.
- If that criterion is not satisfied, do not call this function. */
+ If that criterion is not satisfied, do not call this function. You will
+ get an assertion failure. */
static Charbpos
boyer_moore (struct buffer *buf, Ibyte *base_pat, Bytecount len,
Bytebpos pos, Bytebpos lim, EMACS_INT n, Lisp_Object trt,
Lisp_Object inverse_trt, int USED_IF_MULE (charset_base))
{
- /* &&#### needs some 8-bit work here */
/* #### Someone really really really needs to comment the workings
of this junk somewhat better.
@@ -1602,6 +1650,13 @@ boyer_moore (struct buffer *buf, Ibyte *
#ifdef MULE
Ibyte translate_prev_byte = 0;
Ibyte translate_anteprev_byte = 0;
+ /* These need to be rethought in the event that the internal format
+ changes, or in the event that num_8_bit_fixed_chars disappears
+ (entirely_one_byte_p can be trivially worked out by checking is the
+ byte count equal to the char count.) */
+ int buffer_entirely_one_byte_p = buf->text->entirely_one_byte_p;
+ int buffer_nothing_greater_than_0xff =
+ buf->text->num_8_bit_fixed_chars == BUF_Z(buf) - BUF_BEG (buf);
#endif
#ifdef C_ALLOCA
EMACS_INT BM_tab_space[0400];
@@ -1684,20 +1739,47 @@ boyer_moore (struct buffer *buf, Ibyte *
while (!ibyte_first_byte_p (*charstart))
charstart--;
untranslated = itext_ichar (charstart);
- if (charset_base == (untranslated & ~ICHAR_FIELD3_MASK))
- {
- ch = TRANSLATE (trt, untranslated);
- if (!ibyte_first_byte_p (*ptr))
- {
- translate_prev_byte = ptr[-1];
- if (!ibyte_first_byte_p (translate_prev_byte))
- translate_anteprev_byte = ptr[-2];
- }
- }
- else
- {
- this_translated = 0;
- ch = *ptr;
+
+ /* We shouldn't have been passed a string with varying
+ character sets or rows. That's what simple_search is
+ for. */
+ assert (charset_base == (untranslated & ~ICHAR_FIELD3_MASK));
+
+ ch = TRANSLATE (trt, untranslated);
+ if (!ibyte_first_byte_p (*ptr))
+ {
+ translate_prev_byte = ptr[-1];
+ if (!ibyte_first_byte_p (translate_prev_byte))
+ translate_anteprev_byte = ptr[-2];
+ }
+
+ if (charset_base != (ch & ~ICHAR_FIELD3_MASK))
+ {
+ /* In the very rare event that the CANON entry for this
+ character is not in the desired set, choose one that
+ is, from the equivalence set. It doesn't much matter
+ which, since we're building our own cheesy equivalence
+ table instead of using that belonging to the case
+ table directly.
+
+ We can get here if search_buffer has worked out that
+ the buffer is entirely single width. */
+ Ichar starting_ch = ch;
+ do
+ {
+ ch = TRANSLATE (inverse_trt, ch);
+ if (charset_base == (ch & ~ICHAR_FIELD3_MASK))
+ break;
+
+ } while (starting_ch != ch);
+
+ /* If starting_ch is equal to ch, the case table is
+ corrupt. (Any mapping in the canon table should be
+ reflected in the equivalence table, and we know from
+ the canon table that untranslated maps to starting_ch
+ and that untranslated has the correct value for
+ charset_base.) */
+ assert (starting_ch != ch);
}
}
else
@@ -1713,28 +1795,34 @@ boyer_moore (struct buffer *buf, Ibyte *
if (i == infinity)
stride_for_teases = BM_tab[j];
BM_tab[j] = dirlen - i;
- /* A translation table is accompanied by its inverse --
- see comment in casetab.c. */
+ /* A translation table is accompanied by its inverse -- see
+ comment in casetab.c. */
if (this_translated)
{
Ichar starting_ch = ch;
EMACS_INT starting_j = j;
- while (1)
+ do
{
ch = TRANSLATE (inverse_trt, ch);
- if (ch > 0400)
- j = ((unsigned char) ch | 0200);
- else
- j = (unsigned char) ch;
- /* For all the characters that map into CH,
- set up simple_translate to map the last byte
- into STARTING_J. */
- simple_translate[j] = (Ibyte) starting_j;
- if (ch == starting_ch)
- break;
- BM_tab[j] = dirlen - i;
- }
+ if (ch > 0x7F && buffer_entirely_one_byte_p)
+ continue;
+
+ if (ch > 0xFF && buffer_nothing_greater_than_0xff)
+ continue;
+
+ if (ch > 0400)
+ j = ((unsigned char) ch | 0200);
+ else
+ j = (unsigned char) ch;
+
+ /* For all the characters that map into CH, set up
+ simple_translate to map the last byte into
+ STARTING_J. */
+ simple_translate[j] = (Ibyte) starting_j;
+ BM_tab[j] = dirlen - i;
+
+ } while (ch != starting_ch);
}
#else
EMACS_INT k;
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Add support for installing bundled patches.
17 years
Stephen Turnbull
changeset: 4354:232d873b9705ad6655ef42e6f59cecadc3100853
tag: tip
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sun Dec 23 20:32:16 2007 -0800
files: .hgignore ChangeLog Makefile.in.in etc/ChangeLog etc/bundled-packages/README etc/bundled-packages/test.sh
description:
Add support for installing bundled patches.
diff -r 4143b78d0df09521124aed8cd0ed848b978130ba -r 232d873b9705ad6655ef42e6f59cecadc3100853 .hgignore
--- a/.hgignore Sun Dec 23 15:29:17 2007 +0100
+++ b/.hgignore Sun Dec 23 20:32:16 2007 -0800
@@ -44,4 +44,4 @@ info/.*\.info(-[0-9]+)?$
^src/xemacs\.def(\.in)?$
^src/xemacs\.dmp$
^src/Emacs\.ad\.h$
-
+^etc/bundled-packages/.*\.tar\.gz$
diff -r 4143b78d0df09521124aed8cd0ed848b978130ba -r 232d873b9705ad6655ef42e6f59cecadc3100853 ChangeLog
--- a/ChangeLog Sun Dec 23 15:29:17 2007 +0100
+++ b/ChangeLog Sun Dec 23 20:32:16 2007 -0800
@@ -1,3 +1,14 @@ 2007-12-08 Jerry James <james(a)xemacs.o
+2007-12-23 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * Makefile.in.in (mkpkgdir):
+ (check-available-packages):
+ (install-bootstrap-packages):
+ (install-nonmule-packages):
+ (install-all-packages):
+ New targets supporting bundled packages.
+
+ * .hgignore: Ignore tarballs in etc/bundled-packages/.
+
2007-12-08 Jerry James <james(a)xemacs.org>
* config.guess:
diff -r 4143b78d0df09521124aed8cd0ed848b978130ba -r 232d873b9705ad6655ef42e6f59cecadc3100853 Makefile.in.in
--- a/Makefile.in.in Sun Dec 23 15:29:17 2007 +0100
+++ b/Makefile.in.in Sun Dec 23 20:32:16 2007 -0800
@@ -491,6 +491,48 @@ mkdir: FRC.mkdir
#endif
${sitelispdir}
+## Install bundled packages, if present.
+
+package_path = @LATE_PACKAGE_DIRECTORIES@
+pkgsrcdir = ${srcdir}/etc/bundled-packages
+
+## #### Probably we should add a rule for lib-src/make-path here.
+
+check-available-packages:
+ @if test -r ${pkgsrcdir}/bootstrap.tar.gz; \
+ then echo "To install a set of bootstrap packages, type:"; \
+ echo " make install-bootstrap-packages"; \
+ fi; \
+ if test -r ${pkgsrcdir}/xemacs-sumo.tar.gz; \
+ then echo "To install the full set of non-mule packages, type:"; \
+ echo " make install-nonmule-packages"; \
+ fi; \
+ if test -r ${pkgsrcdir}/xemacs-mule-sumo.tar.gz; \
+ then echo "To install the full set of packages with mule, type:"; \
+ echo " make install-all-packages"; \
+ fi;
+
+mkpkgdir: FRC.mkdir ${MAKEPATH}
+ @if test -z ${package_path}; \
+ then echo "not configured --with-late-packages; no place to install."; \
+ exit -1; \
+ elif test -e ${package_path}/xemacs-packages \
+ -o -e ${package_path}/mule-packages; \
+ then echo "${package_path} is installed; won't overwrite packages."; \
+ exit -1; \
+ fi
+ ${MAKEPATH} ${package_path};
+
+install-bootstrap-packages: mkpkgdir
+ cd ${package_path}; tar xvzf ${pkgsrcdir}/bootstrap.tar.gz
+
+install-nonmule-packages: mkpkgdir
+ cd ${package_path}; tar xvzf ${pkgsrcdir}/xemacs-sumo.tar.gz
+
+install-all-packages: mkpkgdir
+ cd ${package_path}; tar xvzf ${pkgsrcdir}/xemacs-sumo.tar.gz; \
+ cd ${package_path}; tar xvzf ${pkgsrcdir}/xemacs-mule-sumo.tar.gz
+
## Delete all the installed files that the `install' target would
## create (but not the noninstalled files such as `make all' would
## create).
diff -r 4143b78d0df09521124aed8cd0ed848b978130ba -r 232d873b9705ad6655ef42e6f59cecadc3100853 etc/ChangeLog
--- a/etc/ChangeLog Sun Dec 23 15:29:17 2007 +0100
+++ b/etc/ChangeLog Sun Dec 23 20:32:16 2007 -0800
@@ -1,3 +1,8 @@ 2007-11-22 Vin Shelton <acs(a)xemacs.org
+2007-12-23 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * bundled-packages/README: Documentation for bundled packages.
+ * bundled-packages/test.sh: Test suite for bundled packages.
+
2007-11-22 Vin Shelton <acs(a)xemacs.org>
* photos/vin.png:
diff -r 4143b78d0df09521124aed8cd0ed848b978130ba -r 232d873b9705ad6655ef42e6f59cecadc3100853 etc/bundled-packages/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/bundled-packages/README Sun Dec 23 20:32:16 2007 -0800
@@ -0,0 +1,68 @@
+Package distributions may be placed in this directory.
+If present and a package-path is configured, packages can be installed
+using the top-level makefile.
+
+To configure the package path, use the --with-late-packages option to
+configure, which specifies the path to the directory containing the
+xemacs-packages and mule-packages hierarchies to install.
+
+To find out if a distribution includes bundled packages, type
+
+ make check-available-packages
+
+There are three Make targets that may be available depending on the package
+sets supplied.
+
+ make install-bootstrap-packages
+ Install a selected set of packages sufficient to support
+ downloading and installing packages via the M-x list-packages
+ interface. Chose this if you want to be able to install the
+ latest version of each package immediately.
+
+ make install-nomule-packages
+ Install the full distribution of packages that do not require a
+ Mule-enabled XEmacs. Choose this package if you don't have a
+ Mule-enabled XEmacs and want the convenience of a single-command
+ installation. You can add or update packages via M-x list-packages
+ at any time.
+
+ make install-all-packages
+ Install the full distribution of packages, including those requiring
+ a Mule-enabled XEmacs. Choose this package if you have a Mule-
+ enabled XEmacs and want the convenience of a single-command
+ installation. You can add or update packages via M-x list-packages
+ at any time.
+
+DISTRIBUTOR'S NOTE: you may choose what packages you wish to include in
+bootstrap.tar.gz, but to make list-packages work you need to include at
+least xemacs-base, dired, and efs. The tarball should unpack directly as
+an xemacs-packages tree (and optionaly, a mule-packages tree. Also, if
+either of xemacs-sumo.tar.gz or xemacs-mule-sumo.tar.gz is provided, the
+other should be as well.
+
+If packages are not available with the distribution, you can get them at
+
+ ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-sumo.tar.gz
+ ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-mule-sumo.tar.gz
+ http://turnbull.sk.tsukuba.ac.jp/Tools/XEmacs/bootstrap.tar.gz
+
+and place them in the same directory as this file. You can also make your
+own bootstrap.tar.gz by creating a directory xemacs-packages, then
+untarring the packages of your choice into that directory, and tarring the
+whole thing up with "tar czf bootstrap.tar.gz xemacs-packages". (If you
+wish to include mule-packages, you should place them in mule-packages as
+a sibling of xemacs-packages.)
+
+This facility currently does not support installations which configure
+the --with-early-packages, --with-late-packages, or --with-last-packages
+options.
+
+This facility currently will not overwrite an existing package
+installation, not even if a whole hierarchy (usually the mule-packages)
+is missing. In particular, you cannot use this feature to add the
+mule-packages to a package installation which lacks them, even if the
+hierarchy is missing, or the xemacs-packages hierarchy was installed
+this way. Nor can you "upgrade" a bootstrap installation to a full
+installation. If you wish to do any of these things you will need to
+remove the existing hierarchies.
+
diff -r 4143b78d0df09521124aed8cd0ed848b978130ba -r 232d873b9705ad6655ef42e6f59cecadc3100853 etc/bundled-packages/test.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/bundled-packages/test.sh Sun Dec 23 20:32:16 2007 -0800
@@ -0,0 +1,105 @@
+# tests for the bundled packages feature
+
+# usage: sh etc/bundled-packages/tests.sh [TMP_TEST_DIR]
+
+# Always run this script from the top directory of the source tree.
+# You need a mv that supports the -v for verbose flag, and a mkdir that
+# supports the -p flag to make parents.
+# Output from this script is preceded by 4 stars (****).
+
+# This test script is probably more fragile than the build process, but if
+# it runs to completion things are probably OK.
+
+# configure the installation target
+
+if test -z "$1"; then
+ TMP_TEST_DIR=/tmp/test/bundled-packages
+else
+ TMP_TEST_DIR=$1
+fi
+
+srcdir=`pwd`
+blddir=${TMP_TEST_DIR}/build
+pkgdir=${TMP_TEST_DIR}/lib/xemacs
+
+echo "**** srcdir = ${srcdir}"
+echo "**** blddir = ${blddir}"
+echo "**** pkgdir = ${pkgdir}"
+
+if test -e "${pkgdir}"; then
+ echo "**** pkgdir (${pkgdir}) exists; bailing out."
+ exit -1
+fi
+
+# mv existing tarballs out of harm's way and make a fake one
+
+echo "**** Moving existing tarballs to etc/bundled-packages/saved."
+mkdir -p etc/bundled-packages/saved
+cd etc/bundled-packages
+echo "**** 'mv' may error because there are no files to move. It's harmless."
+mv -v *.tar.gz saved/
+cd ../..
+
+# configure in a temporary directory
+
+if test -e ${blddir}; then
+ echo "**** blddir (${blddir}) exists; bailing out."
+ exit -1
+fi
+mkdir -p ${blddir}
+cd ${blddir}
+echo "**** Running 'configure'. This takes *several minutes*."
+echo "**** Redirecting configure output to ${blddir}/beta.err."
+${srcdir}/configure >beta.err 2>&1
+
+# test check-available-packages
+
+echo "**** This test should produce no error and no output."
+make check-available-packages
+cd ${srcdir}/etc/bundled-packages
+echo "**** This test should explain how to install bootstrap packages."
+echo "This file pretends to be a bootstrap hierarchy." > xemacs-packages
+tar czf bootstrap.tar.gz xemacs-packages
+rm xemacs-packages
+cd ${blddir}
+make check-available-packages
+echo "**** This test should explain how to install all three."
+cd ${srcdir}/etc/bundled-packages
+echo "This file pretends to be a xemacs-packages hierarchy." > xemacs-packages
+echo "This file pretends to be a mule-packages hierarchy." > mule-packages
+tar czf xemacs-sumo.tar.gz xemacs-packages
+tar czf xemacs-mule-sumo.tar.gz mule-packages
+rm xemacs-packages mule-packages
+cd ${blddir}
+make check-available-packages
+
+# test installation without package path given
+
+echo "**** Make the 'make-path' utility needed by the installation routine."
+make -C lib-src make-path
+echo "**** This test should error because --with-late-packages wasn't given."
+make install-bootstrap-packages
+
+# test installation with package path given
+
+echo "**** Running 'configure'. This takes *several minutes*."
+echo "**** Redirecting configure output to ${blddir}/beta.err."
+${srcdir}/configure --with-late-packages=${pkgdir} >beta.err 2>&1
+echo "**** Make the 'make-path' utility needed by the installation routine."
+make -C lib-src make-path
+echo "**** Test install-bootstrap-packages."
+make install-bootstrap-packages
+echo "**** The following should list xemacs-packages in the right place."
+ls ${pkgdir}/*
+
+#### no tests below this line ####
+
+# put tarballs back and clean up
+
+cd ${srcdir}/etc/bundled-packages
+rm *.tar.gz
+echo "**** 'mv' may error because there are no files to move. It's harmless."
+mv -v saved/*.tar.gz ../
+rmdir saved
+rm -rf ${blddir} ${pkgdir}
+exit 0
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Support non-XPM image and text glyphs under Carbon.
17 years
Aidan Kehoe
changeset: 4362:600b94a559b0b289127e224ce93d7f4a783a72a7
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Tue Dec 25 16:59:41 2007 +0100
files: lisp/ChangeLog.carbon2 lisp/glyphs.el src/ChangeLog.carbon2 src/glyphs-carbon.c
description:
Support non-XPM image and text glyphs under Carbon.
lisp/ChangeLog addition:
2007-12-25 Aidan Kehoe <kehoea(a)parhasard.net>
* glyphs.el (init-glyphs):
Initialise image-conversion-list correctly for carbon.
src/ChangeLog addition:
2007-12-25 Aidan Kehoe <kehoea(a)parhasard.net>
glyphs-carbon.c:
Declare that Carbon consoles support the various common glyph
instantiators, if the appropriate libraries are available.
* glyphs-carbon.c (convert_EImage_to_image_ref):
Change to use the RGB format of real eimages.
* glyphs-carbon.c (convert_EImage_to_image_ref_with_alpha):
This is the old function; deals with RGBA data.
* glyphs-carbon.c (carbon_xpm_instantiate):
Call convert_EImage_to_image_ref_with_alpha, not
convert_EImage_to_image_ref, since the XPM data may have an alpha
channel.
diff -r 20b8c35ce0fd67c1ef15011f58d55003778f5f4d -r 600b94a559b0b289127e224ce93d7f4a783a72a7 lisp/ChangeLog.carbon2
--- a/lisp/ChangeLog.carbon2 Sun Dec 23 18:05:26 2007 +0100
+++ b/lisp/ChangeLog.carbon2 Tue Dec 25 16:59:41 2007 +0100
@@ -1,3 +1,8 @@ 2007-12-23 Aidan Kehoe <kehoea@parhasa
+2007-12-25 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * glyphs.el (init-glyphs):
+ Initialise image-conversion-list correctly for carbon.
+
2007-12-23 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/mule-cmds.el (init-locale-at-early-startup):
diff -r 20b8c35ce0fd67c1ef15011f58d55003778f5f4d -r 600b94a559b0b289127e224ce93d7f4a783a72a7 lisp/glyphs.el
--- a/lisp/glyphs.el Sun Dec 23 18:05:26 2007 +0100
+++ b/lisp/glyphs.el Tue Dec 25 16:59:41 2007 +0100
@@ -1227,6 +1227,23 @@ If unspecified in a particular domain, `
;; finish initializing hscroll glyph -- created internally
;; because it has a built-in bitmap
(set-glyph-image hscroll-glyph "$" 'global 'tty)))
+ (if (featurep 'carbon)
+ (set-console-type-image-conversion-list 'carbon
+ `(,@(if (featurep 'xpm) '(("\\.xpm\\'" [xpm :file nil] 2)))
+ ("\\.xbm\\'" [xbm :file nil] 2)
+ ,@(if (featurep 'xpm) '(("\\`/\\* XPM \\*/" [xpm :data nil] 2)))
+ ,@(if (featurep 'xface) '(("\\`X-Face:" [xface :data nil] 2)))
+ ,@(if (featurep 'gif) '(("\\.gif\\'" [gif :file nil] 2)
+ ("\\`GIF8[79]" [gif :data nil] 2)))
+ ,@(if (featurep 'jpeg) '(("\\.jpe?g\\'" [jpeg :file nil] 2)))
+ ;; all of the JFIF-format JPEG's that I've seen begin with
+ ;; the following. I have no idea if this is standard.
+ ,@(if (featurep 'jpeg) '(("\\`\377\330\377\340\000\020JFIF"
+ [jpeg :data nil] 2)))
+ ,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2)))
+ ,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2)))
+ ("" [string :data nil] 2)
+ ("" [nothing]))))
;; For streams, we don't want images at all -- dvl
(set-console-type-image-conversion-list 'stream '(("" [nothing])))
diff -r 20b8c35ce0fd67c1ef15011f58d55003778f5f4d -r 600b94a559b0b289127e224ce93d7f4a783a72a7 src/ChangeLog.carbon2
--- a/src/ChangeLog.carbon2 Sun Dec 23 18:05:26 2007 +0100
+++ b/src/ChangeLog.carbon2 Tue Dec 25 16:59:41 2007 +0100
@@ -1,3 +1,17 @@ 2007-12-23 Aidan Kehoe <kehoea@parhasa
+2007-12-25 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ glyphs-carbon.c:
+ Declare that Carbon consoles support the various common glyph
+ instantiators, if the appropriate libraries are available.
+ * glyphs-carbon.c (convert_EImage_to_image_ref):
+ Change to use the RGB format of real eimages.
+ * glyphs-carbon.c (convert_EImage_to_image_ref_with_alpha):
+ This is the old function; deals with RGBA data.
+ * glyphs-carbon.c (carbon_xpm_instantiate):
+ Call convert_EImage_to_image_ref_with_alpha, not
+ convert_EImage_to_image_ref, since the XPM data may have an alpha
+ channel.
+
2007-12-23 Aidan Kehoe <kehoea(a)parhasard.net>
* intl-carbon.c:
diff -r 20b8c35ce0fd67c1ef15011f58d55003778f5f4d -r 600b94a559b0b289127e224ce93d7f4a783a72a7 src/glyphs-carbon.c
--- a/src/glyphs-carbon.c Sun Dec 23 18:05:26 2007 +0100
+++ b/src/glyphs-carbon.c Tue Dec 25 16:59:41 2007 +0100
@@ -35,6 +35,23 @@ static CGColorRef transparent_color;
#ifdef HAVE_XPM
DEFINE_DEVICE_IIFORMAT (carbon, xpm);
+#endif
+
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing);
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (string);
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string);
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit);
+#ifdef HAVE_JPEG
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg);
+#endif
+#ifdef HAVE_TIFF
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff);
+#endif
+#ifdef HAVE_PNG
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (png);
+#endif
+#ifdef HAVE_GIF
+DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif);
#endif
/* Taken from glyphs-msw.c. */
@@ -136,6 +153,26 @@ convert_EImage_to_image_ref (int width,
convert_EImage_to_image_ref (int width, int height, Binbyte *pic)
{
/* Need to make a copy because data providers don't really /hold/ any data within them, and contents of "pic" aren't guaranteed to hang around. */
+ unsigned int data_len = width * height * 3;
+ Binbyte *data = (Binbyte *) xmalloc (data_len);
+ memcpy (data, pic, data_len);
+
+ CGDataProviderRef provider = CGDataProviderCreateWithData (data, data, data_len, data_provider_release_data);
+ CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB ();
+
+ CGImageRef image = CGImageCreate (width, height, 8, 24, width * 3, cs, 0, provider, NULL, TRUE, kCGRenderingIntentDefault);
+
+ CGDataProviderRelease (provider);
+ CGColorSpaceRelease (cs);
+
+ /* Image retains provider, data should freed when image is freed. */
+ return image;
+}
+
+static CGImageRef
+convert_EImage_to_image_ref_with_alpha (int width, int height, Binbyte *pic)
+{
+ /* Need to make a copy because data providers don't really /hold/ any data within them, and contents of "pic" aren't guaranteed to hang around. */
unsigned int data_len = width * height * 4;
Binbyte *data = (Binbyte *) xmalloc (data_len);
memcpy (data, pic, data_len);
@@ -225,7 +262,7 @@ carbon_init_image_instance_from_eimage (
for (slice = 0; slice < slices; slice++)
{
/* build a Quartz 2D image from the eimage */
- if (!(image_ref = convert_EImage_to_image_ref (width, height, eimage + (width * height * 4 * slice))))
+ if (!(image_ref = convert_EImage_to_image_ref (width, height, eimage + (width * height * 3 * slice))))
{
signal_image_error ("EImage to Quartz 2D image conversion failed", instantiator);
}
@@ -578,7 +615,8 @@ carbon_xpm_instantiate (Lisp_Object imag
}
/* build a bitmap from the eimage */
- if (!(image_ref = convert_EImage_to_image_ref (width, height, eimage)))
+ if (!(image_ref = convert_EImage_to_image_ref_with_alpha
+ (width, height, eimage)))
{
signal_image_error ("XPM to EImage conversion failed",
image_instance);
@@ -607,9 +645,25 @@ void
void
image_instantiator_format_create_glyphs_carbon (void)
{
+ IIFORMAT_VALID_CONSOLE (carbon, nothing);
+ IIFORMAT_VALID_CONSOLE (carbon, string);
+ IIFORMAT_VALID_CONSOLE (carbon, formatted_string);
+ IIFORMAT_VALID_CONSOLE (carbon, inherit);
#ifdef HAVE_XPM
INITIALIZE_DEVICE_IIFORMAT (carbon, xpm);
IIFORMAT_HAS_DEVMETHOD (carbon, xpm, instantiate);
+#endif
+#ifdef HAVE_JPEG
+ IIFORMAT_VALID_CONSOLE (carbon, jpeg);
+#endif
+#ifdef HAVE_TIFF
+ IIFORMAT_VALID_CONSOLE (carbon, tiff);
+#endif
+#ifdef HAVE_PNG
+ IIFORMAT_VALID_CONSOLE (carbon, png);
+#endif
+#ifdef HAVE_GIF
+ IIFORMAT_VALID_CONSOLE (carbon, gif);
#endif
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Accept strings as glyph instantiators, fix control-arrow-glyph, etc
17 years
Aidan Kehoe
Merry Christmas Didier! Your 2007-10-15 commit broke control-arrow-glyph;
this change reverts that part of the patch.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1198588785 -3600
# Node ID 6a17ac5da3c4d311bec3618f02b531b0a0467e4b
# Parent cc293ef846d240af187a523bb32eb5e26a083531
Accept strings as glyph instantiators, fix control-arrow-glyph, etc.
2007-12-25 Aidan Kehoe <kehoea(a)parhasard.net>
* glyphs.el (init-glyphs):
Revert part of Didier's 2007-10-15 commit, which broke
#'make-image-specifier with string arguments, and more noticeably
truncation-glyph, continuation-glyph, octal-escape-glyph,
control-arrow-glyph.
diff -r cc293ef846d2 -r 6a17ac5da3c4 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/ChangeLog Tue Dec 25 14:19:45 2007 +0100
@@ -1,3 +1,11 @@ 2007-12-22 Stephen J. Turnbull <stephe
+2007-12-25 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * glyphs.el (init-glyphs):
+ Revert part of Didier's 2007-10-15 commit, which broke
+ #'make-image-specifier with string arguments, and more noticeably
+ truncation-glyph, continuation-glyph, octal-escape-glyph,
+ control-arrow-glyph.
+
2007-12-22 Stephen J. Turnbull <stephen(a)xemacs.org>
Factor out lists of operators specially treated by `make-autoload'.
diff -r cc293ef846d2 -r 6a17ac5da3c4 lisp/glyphs.el
--- a/lisp/glyphs.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/glyphs.el Tue Dec 25 14:19:45 2007 +0100
@@ -1185,8 +1185,7 @@ If unspecified in a particular domain, `
[jpeg :data nil] 2)))
,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2)))
,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2)))
- ;; No, I don't think we want to inline images... -- dvl
- ;; ("" [string :data nil] 2)
+ ("" [string :data nil] 2)
("" [nothing]))))
;; #### this should really be formatted-string, not string but we
;; don't have it implemented yet
@@ -1210,8 +1209,7 @@ If unspecified in a particular domain, `
("\\`\377\330\377\340\000\020JFIF" [string :data "[jpeg]"])
("\\.png\\'" [string :data nil] 2)
("\\`\211PNG" [string :data "[png]"])
- ;; No, I don't think we want to inline images... -- dvl
- ;;("" [string :data nil] 2)
+ ("" [string :data nil] 2)
;; this last one is here for pointers and icons and such --
;; strings are not allowed so they will be ignored.
("" [nothing])))
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: carbon2-commit: Use the carbon infrastructure to determine the language environment.
17 years
Aidan Kehoe
Ar an cúigiú lá is fiche de mí na Nollaig, scríobh Stephen J. Turnbull:
> Aidan Kehoe writes:
>
> > #'carbon-current-locale just passes back a POSIX locale string.
>
> But is it based on LANG and LC_ALL, or does it pay attention to Mac
> mania when those aren't set (and perhaps in spite of their settings)?
“Mania” ?
What exactly do you think is the point of the Carbon build?
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: [V] Give the current carbon locale in #'report-xemacs-bug if available
17 years
Aidan Kehoe
Ar an cúigiú lá is fiche de mí na Nollaig, scríobh Stephen J. Turnbull:
> VETO
>
> Uh, what are you thinking? Viz:
>
> M-: (carbon-current-locale) RET
>
> Invalid function: [etc, etc]
So? Please to be looking at the code you’re vetoing.
> Aidan Kehoe writes:
> >
> >
> >
> > xemacs-packages/net-utils/ChangeLog addition:
> >
> > 2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
> >
> > * xemacsbug.el (report-xemacs-bug):
> > Give the current carbon locale in #'report-xemacs-bug if available.
> >
> >
> > XEmacs Packages source patch:
> > Diff command: cvs -q diff -Nu
> > Files affected: xemacs-packages/net-utils/xemacsbug.el
> > ===================================================================
> > RCS
> >
> > Index: xemacs-packages/net-utils/xemacsbug.el
> > ===================================================================
> > RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/net-utils/xemacsbugel,v
> > retrieving revision 1.14
> > diff -u -u -r1.14 xemacsbug.el
> > --- xemacs-packages/net-utils/xemacsbug.el 2007/11/29 08:45:15 1.14
> > +++ xemacs-packages/net-utils/xemacsbug.el 2007/12/24 11:09:14
> > @@ -225,6 +225,7 @@
> > default-buffer-file-coding-system
> > default-process-coding-system
> > (current-locale)
> > + (carbon-current-locale)
> > keyboard-coding-system
> > terminal-coding-system))
> > (insert (format " %-34s=> %S\n" sym
> >
> > --
> > ¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
> > precipitadamente de la aldea por culpa de la escasez de rinocerontes?
> >
> > _______________________________________________
> > XEmacs-Patches mailing list
> > XEmacs-Patches(a)xemacs.org
> > http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Abstract out a display-table-specific API (2)
17 years
Aidan Kehoe
The below changes are necessary if
http://mid.gmane.org/18288.1954.87217.762309@parhasard.net is to be
committed to the XEmacs 21.5 trunk and if the trunk is to continue (well,
insofar as it currently does) to build the packages. The changes shouldn’t
be controversial--unless my irritation at Stephen for removing my access to
do them myself comes through in my description--and I’d appreciate it if you
could get to committing them.
xemacs-packages/calendar/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* cal-french.el (french-calendar-accents):
Diacritical marks are always available under XEmacs.
xemacs-packages/games/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* gamegrid.el:
* gamegrid.el (put-display-table): New.
* gamegrid.el (get-display-table): New.
Provide with #'defun-when-void, so as to not override the 21.5
implementation.
* gamegrid.el (gamegrid-setup-default-font):
* gamegrid.el (gamegrid-initialize-display):
Use #'put-display-table, #'get-display-table instead of #'aset,
#'aref.
xemacs-packages/gnus/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp/gnus-sum.el:
* lisp/gnus-sum.el (put-display-table): New.
* lisp/gnus-sum.el (get-display-table): New.
Provide with #'defun-when-void, so as to not override the 21.5
implementation.
* lisp/gnus-sum.el (gnus-summary-set-display-table):
* lisp/gnus-xmas.el (gnus-xmas-summary-set-display-table):
Use #'put-display-table, not #'aref, to deal with the case where
the display table is a char table and not a vector.
xemacs-packages/x-symbol/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp/x-symbol-nomule.el:
* lisp/x-symbol-nomule.el (put-display-table): New.
* lisp/x-symbol-nomule.el (get-display-table): New.
* lisp/x-symbol.el (put-display-table): New.
Provide with #'defun-when-void, so as not to override the 21.5
implementation.
* lisp/x-symbol-nomule.el (x-symbol-nomule-display-table):
* lisp/x-symbol.el (x-symbol-invisible-display-table):
Use #'put-display-table, #'get-display-table instead #'aset,
#'aref.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/x-symbol/lisp/x-symbol.el
===================================================================
RCS xemacs-packages/x-symbol/lisp/x-symbol-nomule.el
===================================================================
RCS xemacs-packages/gnus/lisp/gnus-xmas.el
===================================================================
RCS xemacs-packages/gnus/lisp/gnus-sum.el
===================================================================
RCS xemacs-packages/games/gamegrid.el
===================================================================
RCS xemacs-packages/calendar/cal-french.el
===================================================================
RCS
Index: xemacs-packages/calendar/cal-french.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/cal-french.el,v
retrieving revision 1.6
diff -u -u -r1.6 cal-french.el
--- xemacs-packages/calendar/cal-french.el 2007/04/16 02:12:25 1.6
+++ xemacs-packages/calendar/cal-french.el 2007/12/24 19:41:33
@@ -54,9 +54,9 @@
"True if diacritical marks are available."
(and (or window-system
(terminal-coding-system))
- (not (featurep 'xemacs)
- (or enable-multibyte-characters
- (and (char-table-p standard-display-table)
+ (or (featurep 'xemacs)
+ (and enable-multibyte-characters
+ (and (char-table-p standard-display-table)
(equal (aref standard-display-table 161) [161])))))
t)
Index: xemacs-packages/games/gamegrid.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/games/gamegrid.el,v
retrieving revision 1.6
diff -u -u -r1.6 gamegrid.el
--- xemacs-packages/games/gamegrid.el 2005/11/12 00:29:49 1.6
+++ xemacs-packages/games/gamegrid.el 2007/12/24 19:41:33
@@ -38,6 +38,22 @@
(eval-when-compile
(require 'cl))
+(defun-when-void put-display-table (range value display-table)
+ "Set the value for char RANGE to VALUE in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
+(defun-when-void get-display-table (character display-table)
+ "Find value for CHARACTER in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aref display-table character))
+ (char-table
+ (get-char-table character display-table))))
+
;; ;;;;;;;;;;;;; buffer-local variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar gamegrid-use-glyphs t
@@ -302,7 +318,7 @@
(name (font-name font-spec))
(max-height nil))
(loop for c from 0 to 255 do
- (let ((glyph (aref gamegrid-display-table c)))
+ (let ((glyph (get-display-table c gamegrid-display-table)))
(cond ((glyphp glyph)
(let ((height (glyph-height glyph)))
(if (or (null max-height)
@@ -327,7 +343,7 @@
(glyph (gamegrid-make-glyph (car spec) (caddr spec)))
(face (gamegrid-make-face (cadr spec) (caddr spec))))
(aset gamegrid-face-table c face)
- (aset gamegrid-display-table c glyph)))
+ (put-display-table c glyph gamegrid-display-table)))
(gamegrid-setup-default-font)
(gamegrid-set-display-table)
(gamegrid-hide-cursor))
Index: xemacs-packages/gnus/lisp/gnus-sum.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/gnus/lisp/gnus-sum.el,v
retrieving revision 1.11
diff -u -u -r1.11 gnus-sum.el
--- xemacs-packages/gnus/lisp/gnus-sum.el 2007/03/05 18:07:04 1.11
+++ xemacs-packages/gnus/lisp/gnus-sum.el 2007/12/24 19:41:35
@@ -54,6 +54,22 @@
(autoload 'gnus-article-outlook-repair-attribution "deuglify" nil t)
(autoload 'gnus-article-outlook-rearrange-citation "deuglify" nil t)
+(defun-when-void put-display-table (range value display-table)
+ "Set the value for char RANGE to VALUE in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
+(defun-when-void get-display-table (character display-table)
+ "Find value for CHARACTER in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aref display-table character))
+ (char-table
+ (get-char-table character display-table))))
+
(defcustom gnus-kill-summary-on-exit t
"*If non-nil, kill the summary buffer when you exit from it.
If nil, the summary will become a \"*Dead Summary*\" buffer, and
@@ -3091,13 +3107,13 @@
(i 32))
;; Nix out all the control chars...
(while (>= (setq i (1- i)) 0)
- (aset table i [??]))
+ (put-display-table i [??] table))
;; ... but not newline and cr, of course. (cr is necessary for the
;; selective display).
- (aset table ?\n nil)
- (aset table ?\r nil)
+ (put-display-table ?\n nil table)
+ (put-display-table ?\r nil table)
;; We keep TAB as well.
- (aset table ?\t nil)
+ (put-display-table ?\t nil table)
;; We nix out any glyphs 127 through 255, or 127 through 159 in
;; Emacs 23 (unicode), that are not set already.
(let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160))
@@ -3105,8 +3121,8 @@
256)))
(while (>= (setq i (1- i)) 127)
;; Only modify if the entry is nil.
- (unless (aref table i)
- (aset table i [??]))))
+ (unless (get-display-table i table)
+ (put-display-table i [??] table))))
(setq buffer-display-table table)))
(defun gnus-summary-set-article-display-arrow (pos)
Index: xemacs-packages/gnus/lisp/gnus-xmas.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/gnus/lisp/gnus-xmas.el,v
retrieving revision 1.10
diff -u -u -r1.10 gnus-xmas.el
--- xemacs-packages/gnus/lisp/gnus-xmas.el 2006/03/16 04:17:55 1.10
+++ xemacs-packages/gnus/lisp/gnus-xmas.el 2007/12/24 19:41:35
@@ -184,18 +184,18 @@
(i 32))
;; Nix out all the control chars...
(while (>= (setq i (1- i)) 0)
- (aset table i [??]))
+ (put-display-table i [??] table))
;; ... but not newline and cr, of course. (cr is necessary for the
;; selective display).
- (aset table ?\n nil)
- (aset table ?\r nil)
+ (put-display-table ?\n nil table)
+ (put-display-table ?\r nil table)
;; We keep TAB as well.
- (aset table ?\t nil)
+ (put-display-table ?\t nil table)
;; We nix out any glyphs over 126 below ctl-arrow.
(let ((i (if (integerp ctl-arrow) ctl-arrow 160)))
(while (>= (setq i (1- i)) 127)
- (unless (aref table i)
- (aset table i [??]))))
+ (unless (get-display-table i table)
+ (put-display-table i [??] table))))
;; Can't use `set-specifier' because of a bug in 19.14 and earlier
(add-spec-to-specifier current-display-table table (current-buffer) nil)))
Index: xemacs-packages/x-symbol/lisp/x-symbol-nomule.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/x-symbol/lisp/x-symbol-nomule.el,v
retrieving revision 1.3
diff -u -u -r1.3 x-symbol-nomule.el
--- xemacs-packages/x-symbol/lisp/x-symbol-nomule.el 2003/04/02 03:18:32 1.3
+++ xemacs-packages/x-symbol/lisp/x-symbol-nomule.el 2007/12/24 19:41:35
@@ -55,6 +55,22 @@
(defalias 'x-symbol-encode-charsym-after 'x-symbol-nomule-encode-charsym-after)
(defalias 'x-symbol-init-quail-bindings 'ignore)
+(defun-when-void put-display-table (range value display-table)
+ "Set the value for char RANGE to VALUE in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
+(defun-when-void get-display-table (character display-table)
+ "Find value for CHARACTER in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aref display-table character))
+ (char-table
+ (get-char-table character display-table))))
+
(defvar x-symbol-nomule-mouse-yank-function mouse-yank-function
"Function that is called upon by `x-symbol-nomule-mouse-yank-function'.")
@@ -80,11 +96,10 @@
"Internal. Face to fontify current font-lock match.")
(defvar x-symbol-nomule-display-table
- ;; display-table via characters table is not implemented in XEmacs yet...
- (let ((table (make-vector 256 nil))
+ (let ((table (make-display-table))
(i 128))
(while (< i 160)
- (aset table i "")
+ (put-display-table i "" table)
(incf i))
table)
"Display table in faces with non-standard charset registry.
Index: xemacs-packages/x-symbol/lisp/x-symbol.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/x-symbol/lisp/x-symbol.el,v
retrieving revision 1.5
diff -u -u -r1.5 x-symbol.el
--- xemacs-packages/x-symbol/lisp/x-symbol.el 2003/05/31 14:17:15 1.5
+++ xemacs-packages/x-symbol/lisp/x-symbol.el 2007/12/24 19:41:36
@@ -51,8 +51,14 @@
(defvar x-symbol-trace-invisible nil)
;; shows that invisible is reset but Emacs still shows it as invisible
+(defun-when-void put-display-table (range value display-table)
+ "Set the value for char RANGE to VALUE in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
-
;;;;##########################################################################
;;;; General code, default values for `x-symbol-*-function'
@@ -1606,7 +1612,7 @@
(let ((table (make-display-table))
(i 0))
(while (< i 256)
- (aset table i "")
+ (put-display-table i "" table)
(setq i (1+ i)))
table)
"Internal variable. Display table for `x-symbol-invisible-face'.")
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Abstract out a display-table-specific API
17 years
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
xemacs-packages/xemacs-base/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* enriched.el:
* enriched.el (put-display-table): New.
* enriched.el (get-display-table): New.
Both made available with #'defun-when-void, so the native
implementation on 21.5 overrides them.
* enriched.el (?\f):
Use put-display-table instead of aset to configure how ?\f is
displayed.
xemacs-packages/misc-games/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* rot13.el:
* rot13.el (put-display-table): New.
Function provided with #'defun-when-void, so as not to override
21.5's native implementation.
* rot13.el (rot13-display-table):.
Call #'put-display-table, not #'aset, to modify the display table.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/misc-games/rot13.el
===================================================================
RCS xemacs-packages/xemacs-base/enriched.el
===================================================================
RCS
Index: xemacs-packages/xemacs-base/enriched.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/enriched.el,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 enriched.el
--- xemacs-packages/xemacs-base/enriched.el 1998/01/14 06:32:19 1.1.1.1
+++ xemacs-packages/xemacs-base/enriched.el 2007/12/24 19:15:58
@@ -54,6 +54,14 @@
(provide 'enriched)
+(defun-when-void put-display-table (range value display-table)
+ "Set the value for char RANGE to VALUE in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
;;;
;;; Variables controlling the display
;;;
@@ -93,7 +101,7 @@
;; (or (copy-sequence standard-display-table)
;; (make-display-table)))
(make-display-table))
-(aset enriched-display-table ?\f (make-vector (1- (frame-width)) ?-))
+(put-display-table ?\f (make-vector (1- (frame-width)) ?-) enriched-display-table)
(defconst enriched-par-props '(left-margin right-margin justification)
"Text-properties that usually apply to whole paragraphs.
Index: xemacs-packages/misc-games/rot13.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/misc-games/rot13.el,v
retrieving revision 1.2
diff -u -u -r1.2 rot13.el
--- xemacs-packages/misc-games/rot13.el 2000/09/25 03:16:51 1.2
+++ xemacs-packages/misc-games/rot13.el 2007/12/24 19:15:58
@@ -35,15 +35,23 @@
;;; Code:
+(defun-when-void put-display-table (range value display-table)
+ "Set the value for char RANGE to VALUE in DISPLAY-TABLE. "
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
(defvar rot13-display-table
(let ((i -1)
(a (char-to-int ?a))
(A (char-to-int ?A))
(table (make-display-table)))
(while (< (incf i) 26)
- (aset table (+ i a) (char-to-string (int-to-char (+ (% (+ i 13) 26) a))))
- (aset table (+ i A) (char-to-string (int-to-char (+ (% (+ i 13) 26) A)))))
- table)
+ (put-display-table (+ i a) (char-to-string (int-to-char (+ (% (+ i 13) 26) a))) table)
+ (put-display-table (+ i A) (char-to-string (int-to-char (+ (% (+ i 13) 26) A))) table)
+ table))
"Char table for rot 13 display.")
;;;###autoload
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Unify the typed character under X11, using the unicode precedence list
17 years
Aidan Kehoe
With this, with the implementation of the main ISO 8859 coding systems using
my make-8-bit-coding-system framework, and with a stable and sane dumped
unicode precedence list, the Mule deunification problem should be solved for
interactive use by humans (with the exception of that latin-euro-latin9.el
bug I just removed.) Comments?
(Note that by “humans” I do not mean people intentionally using
iso-latin-2-with-esc or iso-latin-9-with-esc and so on.)
2 files changed, 16 insertions(+), 1 deletion(-)
src/ChangeLog | 7 +++++++
src/event-xlike-inc.c | 10 +++++++++-
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1198504956 -3600
# Node ID 63c25d1cbecf001ad5d3df335e95283d0a3d917d
# Parent 74d00c7cc134a6cc94eac170ca774ecef7736ee8
Unify the typed character under X11, using the unicode precedence list
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* event-xlike-inc.c (x_keysym_to_character):
* event-xlike-inc.c (gtk_keysym_to_character):
Unify the typed character if possible, following the current value
for the unicode precedence list.
diff -r 74d00c7cc134 -r 63c25d1cbecf src/ChangeLog
--- a/src/ChangeLog Sun Dec 09 18:31:41 2007 +0100
+++ b/src/ChangeLog Mon Dec 24 15:02:36 2007 +0100
@@ -1,3 +1,10 @@ 2007-12-06 Aidan Kehoe <kehoea@parhasa
+2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * event-xlike-inc.c (x_keysym_to_character):
+ * event-xlike-inc.c (gtk_keysym_to_character):
+ Unify the typed character if possible, following the current value
+ for the unicode precedence list.
+
2007-12-06 Aidan Kehoe <kehoea(a)parhasard.net>
* tests.c (Ftest_data_format_conversion):
diff -r 74d00c7cc134 -r 63c25d1cbecf src/event-xlike-inc.c
--- a/src/event-xlike-inc.c Sun Dec 09 18:31:41 2007 +0100
+++ b/src/event-xlike-inc.c Mon Dec 24 15:02:36 2007 +0100
@@ -708,7 +708,15 @@ gtk_keysym_to_character(guint keysym)
return Qnil;
#ifdef MULE
- return make_char (make_ichar (charset, code, 0));
+ {
+ Lisp_Object unified = Funicode_to_char
+ (Fchar_to_unicode (make_char (make_ichar (charset, code, 0))), Qnil);
+ if (!NILP (unified))
+ {
+ return unified;
+ }
+ return make_char (make_ichar (charset, code, 0));
+ }
#else
return make_char (code + 0x80);
#endif
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Don't override scaron, zcaron in the latin-euro-latin9 autoloads
17 years
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
mule-packages/latin-euro-standards/ChangeLog addition:
2007-12-24 Aidan Kehoe <kehoea(a)parhasard.net>
* latin-euro-latin9.el (define-keysym-as-char):
Don't override the bindings for scaron, zcaron in the autoloaded
code. See bug report here:
http://mid.gmane.org/87ll1xcm3r.fsf@xemacs.org
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: mule-packages/latin-euro-standards/latin-euro-latin9.el
===================================================================
RCS
Index: mule-packages/latin-euro-standards/latin-euro-latin9.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/latin-euro-standards/latin-euro-latin9.el,v
retrieving revision 1.4
diff -u -u -r1.4 latin-euro-latin9.el
--- mule-packages/latin-euro-standards/latin-euro-latin9.el 2005/06/29 19:47:48 1.4
+++ mule-packages/latin-euro-standards/latin-euro-latin9.el 2007/12/24 13:36:52
@@ -142,10 +142,14 @@
(foo (k o)
(define-keysym-as-char k (make-char 'latin-iso8859-15 o))))
(foo 'EuroSign #x24)
- (foo 'Scaron #x26)
- (foo 'scaron #x28)
- (foo 'Zcaron #x34)
- (foo 'zcaron #x38)
+ ;; Don't override these. This code is autoloaded, before the X11 device is
+ ;; available, so what happens is the Latin 2 keysyms are overridden. See
+ ;; http://mid.gmane.org/87ll1xcm3r.fsf@xemacs.org and the associated
+ ;; thread; Hrvoje was correct, I was wrong.
+; (foo 'Scaron #x26)
+; (foo 'scaron #x28)
+; (foo 'Zcaron #x34)
+; (foo 'zcaron #x38)
(foo 'OE #x3C)
(foo 'oe #x3D)
(foo 'Ydiaeresis #x3E))
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches