commit: Support LZMA compression in info.el.
16 years, 11 months
Aidan Kehoe
changeset: 4409:3ff01259c4a26143b328b31da55afa0914836cf5
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Mon Jan 21 16:26:36 2008 +0100
files: lisp/ChangeLog lisp/info.el
description:
Support LZMA compression in info.el.
2008-01-21 Aidan Kehoe <kehoea(a)parhasard.net>
* info.el (Info-suffix-list):
Support LZMA compression, as used--oddly--by Mandriva Linux.
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r 3ff01259c4a26143b328b31da55afa0914836cf5 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/lisp/ChangeLog Mon Jan 21 16:26:36 2008 +0100
@@ -1,3 +1,8 @@ 2008-01-17 Mike Sperber <mike(a)xemacs.o
+2008-01-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * info.el (Info-suffix-list):
+ Support LZMA compression, as used--oddly--by Mandriva Linux.
+
2008-01-17 Mike Sperber <mike(a)xemacs.org>
* files.el (insert-directory): Bind `coding-system-for-read' to
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r 3ff01259c4a26143b328b31da55afa0914836cf5 lisp/info.el
--- a/lisp/info.el Sun Jan 20 13:09:58 2008 +0100
+++ b/lisp/info.el Mon Jan 21 16:26:36 2008 +0100
@@ -479,6 +479,9 @@ heading.")
(".info.zip" . "unzip -c %s")
(".y" . "cat %s | unyabba")
("info.y" . "cat %s | unyabba")
+ ;; Mandriva Linux uses lzma.
+ (".lzma" . "unlzma --stdout %s")
+ (".info.lzma" . "unlzma --stdout %s")
;; These ones are for MS-DOS filenames.
(".inf" . nil)
(".igz" . "gzip -dc %s")
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: [V] carbon2-commit: Use bignums if necessary for file size in #'file-attributes.
16 years, 11 months
Aidan Kehoe
Ar an chéad lá is fiche de mí Eanair, scríobh Stephen J. Turnbull:
> I wrote:
>
> > > I suspect that there are a half-dozen of issues like this that we
> > > should identify (preferably resolve) before making any attempt to
> > > support large files (even in `file-attributes').
>
> and Aidan Kehoe writes:
>
> > That reads uncomfortably like "we must do everything before we do
> > anything."
>
> No. That reads like "it's a good idea to think about not making
> problems for ourselves before coding."
For many software issues in general, we can’t actually say that we’ve
resolved them (see your ‘preferably resolved’ above) without having a
solution in place, coded and tested. That’s part of what makes writing
software interesting; the implementation is the detailed design.
> Why does that [what you originally wrote, not your paraphrase] make you
> uncomfortable?
It’s hostile--at least on the collaborative level--to a style of coding that
moves piece by piece, going back to fix mistakes made originally when they
become clear.
--
¿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] carbon2-commit: Use bignums if necessary for file size in #'file-attributes.
16 years, 11 months
Aidan Kehoe
Jerry, I just tested the code I committed, and I find that when I pass an
long long (as off_t is declared as; eight bytes wide on 32-bit OS X) to
make_bignum, it gets truncated to a long--the most significant four bytes
are discarded. I can work around this, I suppose, checking the size of off_t
and masking and calling Flsh if necessary, but isn’t this a more general
issue with make_bignum?
Ar an chéad lá is fiche de mí Eanair, scríobh Stephen J. Turnbull:
> Michael Sperber writes:
>
> > Or (or (> size max-file-size) (eq size -1)), which actually seems
> > reasonable to me.
>
> I still don't like it; a file size of -1 makes it plain to everybody
> that this file can't be handled by XEmacs.
We have START and END arguments to #'insert-file-contents, you know. I’ve
written Lisp code that uses them to deal with a file in chunks, and though
it’s not possible right now, it would actually be easy to modify the
implementation to deal with chunks of a “large” file at a time.
For context, GNU return a float if the size doesn’t fit in a Lisp integer.
Also for context, very little of the code at
http://google.com/codesearch?q=file%3A%5C.el+%5C%28file-attributes
relies on this behaviour.
> > Other than that, it seems a bad idea to couple "large-file-ness" to
> > an arbitrary and not necessarily corresponding restriction in
> > `file-attributes'. Rather, we should probably introduce a
> > predicate `large-file-p' or `large-file-attributes-p'.
>
> Agreed. I suspect that there are a half-dozen of issues like this
> that we should identify (preferably resolve) before making any attempt
> to support large files (even in `file-attributes').
That reads uncomfortably like “we must do everything before we do anything.”
--
¿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
carbon2-commit: Update in carbon/README that package location has changed from lib/ to share/.
16 years, 11 months
Marcus Crestani
changeset: 4423:66b946df6c30c36f5418fb927fcd4125e2efb4ee
tag: tip
user: Marcus Crestani <crestani(a)informatik.uni-tuebingen.de>
date: Sun Jan 20 20:41:41 2008 +0100
files: ChangeLog.carbon2 carbon/README
description:
Update in carbon/README that package location has changed from lib/ to share/.
2008-01-20 Marcus Crestani <crestani(a)xemacs.org>
* carbon/README: Package location has changed from lib/ to share/.
diff -r 46e9a171163c8abad266d09021d210394535d1d4 -r 66b946df6c30c36f5418fb927fcd4125e2efb4ee ChangeLog.carbon2
--- a/ChangeLog.carbon2 Sun Jan 20 12:58:09 2008 +0100
+++ b/ChangeLog.carbon2 Sun Jan 20 20:41:41 2008 +0100
@@ -1,3 +1,7 @@ 2007-12-23 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Marcus Crestani <crestani(a)xemacs.org>
+
+ * carbon/README: Package location has changed from lib/ to share/.
+
2007-12-23 Aidan Kehoe <kehoea(a)parhasard.net>
* carbon/README: Update to reflect that this Carbon XEmacs is
diff -r 46e9a171163c8abad266d09021d210394535d1d4 -r 66b946df6c30c36f5418fb927fcd4125e2efb4ee carbon/README
--- a/carbon/README Sun Jan 20 12:58:09 2008 +0100
+++ b/carbon/README Sun Jan 20 20:41:41 2008 +0100
@@ -18,7 +18,7 @@ See the documentation at http://www.xema
See the documentation at http://www.xemacs.org/Documentation/packageGuide.html .
In addition to the normal package locations, Carbon XEmacs will also find
-packages in the directory XEmacs.app/Contents/Resources/lib/. An XEmacs
+packages in the directory XEmacs.app/Contents/Resources/share/. An XEmacs
application bundle with packages installed in this directory is therefore
self-contained and can be moved to a different location on the disk.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Use bignums if necessary for file size in #'file-attributes.
16 years, 11 months
Aidan Kehoe
changeset: 4421:5998e37dc35e7afcd49aa10c250151138e7b07c9
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Jan 19 14:34:19 2008 +0100
files: src/ChangeLog src/dired.c
description:
Use bignums if necessary for file size in #'file-attributes.
2008-01-19 Aidan Kehoe <kehoea(a)parhasard.net>
* dired.c (Ffile_attributes): If bignums are available, use them
for the file size when necessary. If they are not, be clearer
about the check for whether the file size can fit in a Lisp
integer.
diff -r 4b62544f513970f4d9a12c1723dc145bfe6cde84 -r 5998e37dc35e7afcd49aa10c250151138e7b07c9 src/ChangeLog
--- a/src/ChangeLog Fri Jan 18 22:06:01 2008 -0500
+++ b/src/ChangeLog Sat Jan 19 14:34:19 2008 +0100
@@ -1,3 +1,10 @@ 2008-01-18 Jerry James <james(a)xemacs.o
+2008-01-19 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * dired.c (Ffile_attributes): If bignums are available, use them
+ for the file size when necessary. If they are not, be clearer
+ about the check for whether the file size can fit in a Lisp
+ integer.
+
2008-01-18 Jerry James <james(a)xemacs.org>
* device-x.c (x_init_device): Don't write to path or read from
diff -r 4b62544f513970f4d9a12c1723dc145bfe6cde84 -r 5998e37dc35e7afcd49aa10c250151138e7b07c9 src/dired.c
--- a/src/dired.c Fri Jan 18 22:06:01 2008 -0500
+++ b/src/dired.c Sat Jan 19 14:34:19 2008 +0100
@@ -824,7 +824,7 @@ Otherwise, list elements are:
First integer has high-order 16 bits of time, second has low 16 bits.
5. Last modification time, likewise.
6. Last status change time, likewise.
- 7. Size in bytes. (-1, if number is out of range).
+ 7. Size in bytes. (-1, if number out of range and no bignum support.)
8. File modes, as a string of ten letters or dashes as in ls -l.
9. t iff file's gid would change if file were deleted and recreated.
10. inode number.
@@ -900,11 +900,14 @@ If file does not exist, returns nil.
values[4] = make_time (s.st_atime);
values[5] = make_time (s.st_mtime);
values[6] = make_time (s.st_ctime);
- values[7] = make_int ((EMACS_INT) s.st_size);
- /* If the size is out of range, give back -1. */
- /* #### Fix when Emacs gets bignums! */
- if (XINT (values[7]) != s.st_size)
- values[7] = make_int (-1);
+
+#ifndef HAVE_BIGNUM
+ values[7] = make_integer (NUMBER_FITS_IN_AN_EMACS_INT (s.st_size) ?
+ (EMACS_INT)s.st_size : -1);
+#else
+ values[7] = make_integer (s.st_size);
+#endif
+
filemodestring (&s, modes);
values[8] = make_string ((Ibyte *) modes, 10);
#if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Support #!, to allow XEmacs to be called as a script interpreter.
16 years, 11 months
Aidan Kehoe
GNU have this already. This implementation allows shebang lines of the form:
#!/usr/bin/env xemacs-script
(where #!/usr/bin/env xemacs --script doesn’t necessarily work, and where
xemacs-script is a link to the binary), which theirs doesn’t. It also,
unfortunately, fails because I don’t understand autoconf enough to have
@SHEBANG_PROGNAME@ actually expanded; when I do a make-install it creates a
literal /usr/local/bin/@SHEBANG_PROGNAME@ link to the XEmacs binary. Help
appreciated.
Beyond that, issues remaining with this; the byte compiler needs to be
modified to be aware of the syntax when reading source files, and perhaps to
add the shebang line to the corresponding .elc files.
comparing with /Sources/xemacs-21.5-checked-out
searching for changes
changeset: 4409:fd8a9a4d81d9
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Jan 20 19:53:54 2008 +0100
summary: Support #!, to allow XEmacs to be called as a script interpreter.
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 ChangeLog
--- a/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,13 @@ 2008-01-17 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * Makefile.in.in (SHEBANG_PROGNAME):
+ New variable; a symbol link to the XEmacs binary to tell it it
+ should read a script from stdin.
+ * configure.ac (XE_EXPAND_VARIABLE):
+ Set SHEBANG_PROGNAME.
+ * configure:
+ Regenerate.
+
2008-01-17 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac:
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 Makefile.in.in
--- a/Makefile.in.in Sun Jan 20 13:09:58 2008 +0100
+++ b/Makefile.in.in Sun Jan 20 19:53:54 2008 +0100
@@ -92,6 +92,7 @@ configuration=@configuration@
## This will be the name of the generated binary and is set automatically
## by configure.
PROGNAME=@PROGNAME@
+SHEBANG_PROGNAME=@SHEBANG_PROGNAME@
## ==================== Where To Install Things ====================
@@ -407,10 +408,12 @@ install-arch-dep: mkdir
${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}.exe
-chmod 0755 ${bindir}/${PROGNAME}-${version}.exe
cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${PROGNAME}
+ cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
# else
${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}
-chmod 0755 ${bindir}/${PROGNAME}-${version}
cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
+ cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
# endif /* CYGWIN */
#endif /* WIN32_NATIVE */
if test "${prefix}" != "${exec_prefix}"; then \
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 configure
--- a/configure Sun Jan 20 13:09:58 2008 +0100
+++ b/configure Sun Jan 20 19:53:54 2008 +0100
@@ -4851,13 +4851,20 @@ _ACEOF
version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
PROGNAME=infodock
+ SHEBANG_PROGNAME=infodock-script
CPPFLAGS="$CPPFLAGS -DINFODOCK"
else
PROGNAME=xemacs
+ SHEBANG_PROGNAME=xemacs-script
fi
cat >>confdefs.h <<_ACEOF
#define EMACS_PROGNAME "$PROGNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SHEBANG_PROGNAME "${PROGNAME}-script"
_ACEOF
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 configure.ac
--- a/configure.ac Sun Jan 20 13:09:58 2008 +0100
+++ b/configure.ac Sun Jan 20 19:53:54 2008 +0100
@@ -1219,12 +1219,16 @@ if test "$with_infodock" = "yes"; then
AC_DEFINE_UNQUOTED(INFODOCK_BUILD_VERSION, $infodock_build_version)
version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
PROGNAME=infodock
+ SHEBANG_PROGNAME=infodock-script
CPPFLAGS="$CPPFLAGS -DINFODOCK"
else
PROGNAME=xemacs
+ SHEBANG_PROGNAME=xemacs-script
fi
AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME")
+
+AC_DEFINE_UNQUOTED(SHEBANG_PROGNAME, "${PROGNAME}-script")
dnl ----------------------------------
dnl Error checking and debugging flags
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/lisp/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,10 @@ 2008-01-17 Mike Sperber <mike(a)xemacs.o
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * startup.el (command-line-do-script): New.
+ (command-switch-alist): Use command-line-do-script.
+ New argument, compatible with GNU; --script or -script says "treat
+ the following argument as a file to load in batch mode".
+
2008-01-17 Mike Sperber <mike(a)xemacs.org>
* files.el (insert-directory): Bind `coding-system-for-read' to
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 lisp/startup.el
--- a/lisp/startup.el Sun Jan 20 13:09:58 2008 +0100
+++ b/lisp/startup.el Sun Jan 20 19:53:54 2008 +0100
@@ -234,6 +234,8 @@ after, and will not be true at any time
("-eval" . command-line-do-eval)
("-load" . command-line-do-load)
("-l" . command-line-do-load)
+ ("--script" . command-line-do-script)
+ ("-script" . command-line-do-script)
("-insert" . command-line-do-insert)
("-i" . command-line-do-insert)
("-kill" . command-line-do-kill)
@@ -436,6 +438,12 @@ Type ^H^H^H (Control-h Control-h Control
(if (file-exists-p (expand-file-name file))
(setq file (expand-file-name file)))
(load file nil t)))
+
+(defun command-line-do-script (arg)
+ "Load the named file of Lisp code into XEmacs.
+<file>"
+ (let ((file (pop command-line-args-left)))
+ (load file nil t t)))
(defun command-line-do-insert (arg)
"Insert file into the current buffer.
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 man/ChangeLog
--- a/man/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/man/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,8 @@ 2007-12-17 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * xemacs/cmdargs.texi (Command Switches):
+ Describe --script, -script.
+
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/strings.texi (Formatting Strings):
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 man/xemacs/cmdargs.texi
--- a/man/xemacs/cmdargs.texi Sun Jan 20 13:09:58 2008 +0100
+++ b/man/xemacs/cmdargs.texi Sun Jan 20 19:53:54 2008 +0100
@@ -171,6 +171,27 @@ Do not process early packages. (For mor
Do not process early packages. (For more information on startup issues
concerning the package system, @xref{Startup Paths}.)
+@item -script @var{file}
+@item --script @var{file}
+Load @var{file} as a (compiled or interpreted) Lisp file; do not load
+any window-system or TTY code, do not load the user init file, the site
+file, or the early packages. This is comparable to running
+@samp{xemacs} @samp{-batch} @samp{-l} @var{file}.
+
+You can also specify this flag implicitly by calling the XEmacs binary
+with a value for @samp{argv[0]} of @samp{xemacs-script}, normally by
+means of a symbolic link. On a POSIX system, this means that adding the
+line:
+
+@example
+#!/usr/bin/env xemacs-script
+@end example
+
+at the start of an XEmacs Lisp file, and changing that file's
+permissions to executable, creates a script that can be invoked by
+typing the path to the file. XEmacs has logic to ignore the #! line at
+the start of the script, so that won't cause an error.
+
@item -vanilla
This is equivalent to @samp{-q -no-site-file -no-early-packages}.
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 src/ChangeLog
--- a/src/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/src/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,15 @@ 2007-12-26 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * config.h.in: Add SHEBANG_PROGNAME.
+ * emacs.c (main_1):
+ If we've been called using SHEBANG_PROGNAME, rewrite our arguments
+ to add a --script argument.
+ Also, handle the --script argument by setting noninteractive and
+ vanilla.
+ * lread.c (Fload_internal):
+ If the first two characters of a file are #!, replace them with ;!
+ before they get to the Lisp reader.
+
2007-12-26 Aidan Kehoe <kehoea(a)parhasard.net>
* casetab.c:
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 src/config.h.in
--- a/src/config.h.in Sun Jan 20 13:09:58 2008 +0100
+++ b/src/config.h.in Sun Jan 20 19:53:54 2008 +0100
@@ -90,6 +90,9 @@ things are arranged in config.h.in. In
/* Program name */
#undef EMACS_PROGNAME
+
+/* Name of the link to the program to be used with #! scripts */
+#undef SHEBANG_PROGNAME
/* Allow s&m files to differentiate OS versions without having
multiple files to maintain. */
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 src/emacs.c
--- a/src/emacs.c Sun Jan 20 13:09:58 2008 +0100
+++ b/src/emacs.c Sun Jan 20 19:53:54 2008 +0100
@@ -955,6 +955,42 @@ main_1 (int argc, Wexttext **argv, Wextt
init_free_hook ();
#endif
+#define SHEBANG_PROGNAME_LENGTH \
+ (int)((sizeof (WEXTSTRING (SHEBANG_PROGNAME)) - sizeof (WEXTSTRING (""))))
+#define SHEBANG_EXE_PROGNAME_LENGTH \
+ (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME ".exe")) \
+ - sizeof (WEXTSTRING ("")))
+
+ {
+ int progname_len = wext_strlen (argv[0]);
+ if (progname_len >= SHEBANG_PROGNAME_LENGTH)
+ {
+ if (!wext_strcmp_ascii (argv[0] +
+ (progname_len - SHEBANG_PROGNAME_LENGTH),
+ SHEBANG_PROGNAME)
+ /* Allow trailing .exe. Don't check it, it could also be
+ .com. */
+ || (progname_len >= SHEBANG_EXE_PROGNAME_LENGTH &&
+ !wext_strncmp_ascii
+ (argv[0] + (progname_len - SHEBANG_EXE_PROGNAME_LENGTH),
+ SHEBANG_PROGNAME,
+ SHEBANG_PROGNAME_LENGTH)))
+ {
+ Wexttext **newarr = alloca_array (Wexttext *, argc + 2);
+ int j;
+
+ newarr[0] = argv[0];
+ newarr[1] = WEXTSTRING ("--script");
+ for (j = 1; j < argc; ++j)
+ {
+ newarr[j + 1] = argv[j];
+ }
+ argv = newarr;
+ argc++;
+ }
+ }
+ }
+
sort_args (argc, argv);
#if 0 /* defined (_SCO_DS)
@@ -1048,6 +1084,20 @@ main_1 (int argc, Wexttext **argv, Wextt
noninteractive = 1;
}
+ {
+ int count_before = skip_args;
+ /* Handle the -script switch, which implies batch and vanilla. The -l
+ part of its functionality is implemented in Lisp. */
+ if (argmatch (argv, argc, "-script", "--script", 0, NULL,
+ &skip_args))
+ {
+ noninteractive = 1;
+ vanilla_inhibiting = 1;
+ }
+
+ /* Don't actually discard this argument. */
+ skip_args = count_before;
+ }
#ifdef WIN32_NATIVE
{
/* Since we aren't a console application, we can't easily be terminated
@@ -2690,6 +2740,7 @@ static const struct standard_args standa
{ "-sd", "--show-dump-id", 105, 0 },
{ "-nd", "--no-dump-file", 95, 0 },
{ "-batch", "--batch", 88, 0 },
+ { "-script", "--script", 89, 1 },
#ifdef WIN32_NATIVE
{ "-mswindows-termination-handle", 0, 84, 1 },
{ "-nuni", "--no-unicode-lib-calls", 83, 0 },
diff -r 8bbabcab2c42 -r fd8a9a4d81d9 src/lread.c
--- a/src/lread.c Sun Jan 20 13:09:58 2008 +0100
+++ b/src/lread.c Sun Jan 20 19:53:54 2008 +0100
@@ -743,6 +743,25 @@ do { \
/* set it to nil; a call to #'domain will set it. */
internal_bind_lisp_object (&Vfile_domain, Qnil);
#endif
+
+ /* Is there a #!? If so, read it, and unread ;!.
+
+ GNU implement this by treating any #! anywhere in the source text as
+ commenting out the whole line. */
+ {
+ char shebangp[2];
+ int num_read;
+
+ num_read = Lstream_read (XLSTREAM (lispstream), shebangp,
+ sizeof(shebangp));
+ if (sizeof(shebangp) == num_read
+ && 0 == strncmp("#!", shebangp, sizeof(shebangp)))
+ {
+ shebangp[0] = ';';
+ }
+
+ Lstream_unread (XLSTREAM (lispstream), shebangp, num_read);
+ }
/* Now determine what sort of ELC file we're reading in. */
internal_bind_int (&load_byte_code_version, load_byte_code_version);
--
¿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: [Q] commit: Automated merge with ssh://aidan-guest@hg.debian.org//hg/xemacs/xemacs
16 years, 11 months
Aidan Kehoe
Ar an t-ochtú lá déag de mí Eanair, scríobh Michael Sperber:
> Aidan Kehoe <kehoea(a)parhasard.net> writes:
>
> > Certainly; the mail-things-to-xemacs-patches scripts could ignore any commit
> > where the subject starts with "Automated merge with ".
>
> That, and commit messages that are simply "Merge."
Okay, I’ve done that for both the main and the carbon2 repositories. I’m a
little worried because some commits I made that should have provoked mails
haven’t, yet; my local tests of the logic indicate that it’s fine, though,
so I’ll wait four or six hours and then either sigh in relief or start
investigating further.
> BTW, "hg fetch" is essentially just
>
> hg pull; hg merge; hg commit -m 'Automated merge ...'
--
¿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: [Q] Always use boyer_moore in ASCII or Latin-1 buffers with ASCII search strings
16 years, 11 months
Aidan Kehoe
Ar an seachtú lá is fiche de mí na Nollaig, scríobh Stephen J. Turnbull:
> QUERY
>
> Aidan Kehoe writes:
>
> > - /* &&#### needs some 8-bit work here */
>
> Have you talked about this to Ben to confirm that this is the problem
> he had in mind?
Ben, this is in reference to
http://mid.gmane.org/18290.33287.387191.561174@parhasard.net , which cleaned
up all the non-ASCII logic I could find in search.c . Do you remember what
exactly you meant with that comment?
> > + if (ch > 0x7F && buffer_entirely_one_byte_p)
> > + continue;
> > +
> > + if (ch > 0xFF && buffer_nothing_greater_than_0xff)
> > + continue;
>
> At least in the leading case of case-insensitive search, these should
> be asserts for the sake of debugging. Are you sure they can't be?
They shouldn’t be; we allow non-ASCII characters to be case variants of
ASCII characters, as Unicode specifies.
(I’ve committed this change, by the way.)
--
¿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: Always use boyer_moore in ASCII or Latin-1 buffers with ASCII search strings.
16 years, 11 months
Aidan Kehoe
changeset: 4407:4ee73bbe4f8e814fb02c11cb586a6ea3e539e720
parent: 4356:cc293ef846d240af187a523bb32eb5e26a083531
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed Dec 26 17:30:16 2007 +0100
files: src/ChangeLog src/casetab.c src/search.c
description:
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 cc293ef846d240af187a523bb32eb5e26a083531 -r 4ee73bbe4f8e814fb02c11cb586a6ea3e539e720 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 cc293ef846d240af187a523bb32eb5e26a083531 -r 4ee73bbe4f8e814fb02c11cb586a6ea3e539e720 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.
-
- `canon' is used when doing case-insensitive comparisons. `equiv' is
+ 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:
+
+ (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 cc293ef846d240af187a523bb32eb5e26a083531 -r 4ee73bbe4f8e814fb02c11cb586a6ea3e539e720 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;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Use debug version of Intel's math library when debugging.
16 years, 11 months
Aidan Kehoe
changeset: 4420:4b62544f513970f4d9a12c1723dc145bfe6cde84
user: Vin Shelton <acs(a)xemacs.org>
date: Fri Jan 18 22:06:01 2008 -0500
files: nt/ChangeLog nt/xemacs.mak
description:
Use debug version of Intel's math library when debugging.
diff -r 80e07b006f9c32715be50f894640af03293ae544 -r 4b62544f513970f4d9a12c1723dc145bfe6cde84 nt/ChangeLog
--- a/nt/ChangeLog Fri Jan 18 16:12:31 2008 -0700
+++ b/nt/ChangeLog Fri Jan 18 22:06:01 2008 -0500
@@ -1,3 +1,7 @@ 2008-01-17 Vin Shelton <acs(a)xemacs.org
+2008-01-18 Vin Shelton <acs(a)xemacs.org>
+
+ * xemacs.mak: Use debug version of Intel's libm, if appropriate.
+
2008-01-17 Vin Shelton <acs(a)xemacs.org>
* config.inc.samp: Added USE_INTEL_COMPILER to support the Intel
diff -r 80e07b006f9c32715be50f894640af03293ae544 -r 4b62544f513970f4d9a12c1723dc145bfe6cde84 nt/xemacs.mak
--- a/nt/xemacs.mak Fri Jan 18 16:12:31 2008 -0700
+++ b/nt/xemacs.mak Fri Jan 18 22:06:01 2008 -0500
@@ -195,8 +195,11 @@ DEBUG_XEMACS=0
!if !defined(SUPPORT_EDIT_AND_CONTINUE)
SUPPORT_EDIT_AND_CONTINUE=0
!endif
-
-!if !defined(BUILD_FOR_SETUP_KIT) || "$(BUILD_FOR_SETUP_KIT)" == "0"
+!if !defined(BUILD_FOR_SETUP_KIT)
+BUILD_FOR_SETUP_KIT=0
+!endif
+
+!if !$(BUILD_FOR_SETUP_KIT)
OK_TO_USE_MSVCRTD=1
!else
OK_TO_USE_MSVCRTD=0
@@ -250,11 +253,6 @@ USE_MINITAR=$(HAVE_ZLIB)
# NOTE: The various graphics libraries are generally compiled to use
# MSVCRT.DLL (the same that we use in USE_CRTDLL, more or less), so using
# this is a good thing.
-
-!if $(USE_INTEL_COMPILER)
-CC=icl
-INTEL_LIBS=libirc.lib libmmt.lib
-!endif
!if !defined(USE_SYSTEM_MALLOC)
USE_SYSTEM_MALLOC=$(USE_PORTABLE_DUMPER)
@@ -661,6 +659,16 @@ OPT_DEFINES=$(OPT_DEFINES) -DGNU_MALLOC
OPT_DEFINES=$(OPT_DEFINES) -DGNU_MALLOC
OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\free-hook.obj $(OUTDIR)\gmalloc.obj \
$(OUTDIR)\ntheap.obj $(OUTDIR)\vm-limit.obj
+!endif
+
+!if $(USE_INTEL_COMPILER)
+CC=icl
+# Use static library if possible
+INTEL_LIBS=libircmt.lib libmmt.lib
+# Debugging requires DLL version of libm
+!if $(DEBUG_XEMACS)
+INTEL_LIBS=libircmt.lib libmmd.lib
+!endif
!endif
########################### Process options related to compilation.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches