commit: Provide %b in #'format; use it for converting between ints and bit vectors.
17 years
Aidan Kehoe
changeset: 4330:d9eb5ea14f657b33158d624cf55ebb3ff1185b49
parent: 4328:dfd878799ef0724973cd47b1bbfc3aa3db777fdc
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Mon Dec 17 08:44:14 2007 +0100
files: lisp/ChangeLog lisp/subr.el man/ChangeLog man/lispref/strings.texi src/ChangeLog src/doprnt.c src/editfns.c src/lisp.h src/lread.c src/print.c
description:
Provide %b in #'format; use it for converting between ints and bit vectors.
lisp/ChangeLog addition:
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (integer-to-bit-vector): New.
* subr.el (bit-vector-to-integer): New.
Provide naive implementations using the Lisp reader for these.
src/ChangeLog addition:
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* doprnt.c (emacs_doprnt_1):
Add support for formatted printing of both longs and bignums as
base 2.
* editfns.c (Fformat):
Document the new %b escape for #'format.
* lisp.h:
Make ulong_to_bit_string available beside long_to_string.
* lread.c:
Fix a bug where the integer base was being ignored in certain
contexts; thank you Sebastian Freundt. This is necessary for
correct behaviour of #'integer-to-bit-vector and
#'bit-vector-to-integer, just added to subr.el
* print.c (ulong_to_bit_string): New.
Analagous to long_to_string, but used all the time when %b is
encountered, since we can't pass that to sprintf.
man/ChangeLog addition:
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/strings.texi (Formatting Strings):
Document %b for binary output.
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 lisp/ChangeLog
--- a/lisp/ChangeLog Fri Dec 14 14:25:04 2007 +0100
+++ b/lisp/ChangeLog Mon Dec 17 08:44:14 2007 +0100
@@ -1,3 +1,9 @@ 2007-12-14 Aidan Kehoe <kehoea@parhasa
+2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * subr.el (integer-to-bit-vector): New.
+ * subr.el (bit-vector-to-integer): New.
+ Provide naive implementations using the Lisp reader for these.
+
2007-12-14 Aidan Kehoe <kehoea(a)parhasard.net>
* process.el (substitute-env-vars):
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 lisp/subr.el
--- a/lisp/subr.el Fri Dec 14 14:25:04 2007 +0100
+++ b/lisp/subr.el Mon Dec 17 08:44:14 2007 +0100
@@ -912,6 +912,26 @@ See also `equalp'."
;; foo-to-bar naming scheme, but CLtL2 has them, so they stay.
(define-function 'char-int 'char-to-int)
(define-function 'int-char 'int-to-char)
+
+;; XEmacs addition.
+(defun integer-to-bit-vector (integer &optional minlength)
+ "Return INTEGER converted to a bit vector.
+Optional argument MINLENGTH gives a minimum length for the returned vector.
+If MINLENGTH is not given, zero high-order bits will be ignored."
+ (check-argument-type #'integerp integer)
+ (setq minlength (or minlength 0))
+ (check-nonnegative-number minlength)
+ (read (format (format "#*%%0%db" minlength) integer)))
+
+;; XEmacs addition.
+(defun bit-vector-to-integer (bit-vector)
+ "Return BIT-VECTOR converted to an integer.
+If bignum support is available, BIT-VECTOR's length is unlimited.
+Otherwise the limit is the number of value bits in an Lisp integer. "
+ (check-argument-type #'bit-vector-p bit-vector)
+ (setq bit-vector (prin1-to-string bit-vector))
+ (aset bit-vector 1 ?b)
+ (read bit-vector))
(defun string-width (string)
"Return number of columns STRING occupies when displayed.
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 man/ChangeLog
--- a/man/ChangeLog Fri Dec 14 14:25:04 2007 +0100
+++ b/man/ChangeLog Mon Dec 17 08:44:14 2007 +0100
@@ -1,3 +1,8 @@ 2007-12-10 Ville Skyttä <scop(a)xemacs.o
+2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/strings.texi (Formatting Strings):
+ Document %b for binary output.
+
2007-12-10 Ville Skyttä <scop(a)xemacs.org>
* internals/internals.texi: Spelling fixes.
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 man/lispref/strings.texi
--- a/man/lispref/strings.texi Fri Dec 14 14:25:04 2007 +0100
+++ b/man/lispref/strings.texi Mon Dec 17 08:44:14 2007 +0100
@@ -714,6 +714,11 @@ integer, using lowercase letters.
@cindex integer to hexadecimal
Replace the specification with the base-sixteen representation of an
integer, using uppercase letters.
+
+@item %b
+@cindex integer to binary
+Replace the specification with the base-two representation of an
+integer.
@item %c
Replace the specification with the character which is the value given.
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 src/ChangeLog
--- a/src/ChangeLog Fri Dec 14 14:25:04 2007 +0100
+++ b/src/ChangeLog Mon Dec 17 08:44:14 2007 +0100
@@ -1,3 +1,21 @@ 2007-12-12 Aidan Kehoe <kehoea@parhasa
+2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doprnt.c (emacs_doprnt_1):
+ Add support for formatted printing of both longs and bignums as
+ base 2.
+ * editfns.c (Fformat):
+ Document the new %b escape for #'format.
+ * lisp.h:
+ Make ulong_to_bit_string available beside long_to_string.
+ * lread.c:
+ Fix a bug where the integer base was being ignored in certain
+ contexts; thank you Sebastian Freundt. This is necessary for
+ correct behaviour of #'integer-to-bit-vector and
+ #'bit-vector-to-integer, just added to subr.el
+ * print.c (ulong_to_bit_string): New.
+ Analagous to long_to_string, but used all the time when %b is
+ encountered, since we can't pass that to sprintf.
+
2007-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 src/doprnt.c
--- a/src/doprnt.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/doprnt.c Mon Dec 17 08:44:14 2007 +0100
@@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "lstream.h"
static const char * const valid_flags = "-+ #0";
-static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS"
+static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS" "b"
#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO)
"npyY"
#endif
@@ -43,11 +43,11 @@ static const char * const valid_converte
#endif
;
static const char * const int_converters = "dic";
-static const char * const unsigned_int_converters = "ouxX";
+static const char * const unsigned_int_converters = "ouxXb";
static const char * const double_converters = "feEgG";
static const char * const string_converters = "sS";
#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO)
-static const char * const bignum_converters = "npyY";
+static const char * const bignum_converters = "npyY\337";
#endif
#ifdef HAVE_BIGFLOAT
static const char * const bigfloat_converters = "FhHkK";
@@ -665,6 +665,7 @@ emacs_doprnt_1 (Lisp_Object stream, cons
case 'o': ch = 'p'; break;
case 'x': ch = 'y'; break;
case 'X': ch = 'Y'; break;
+ case 'b': ch = 'b'; break;
default: /* ch == 'u' */
if (strchr (unsigned_int_converters, ch) &&
ratio_sign (XRATIO_DATA (obj)) < 0)
@@ -684,6 +685,7 @@ emacs_doprnt_1 (Lisp_Object stream, cons
case 'o': ch = 'p'; break;
case 'x': ch = 'y'; break;
case 'X': ch = 'Y'; break;
+ case 'b': ch = '\337'; break;
default: /* ch == 'u' */
if (strchr (unsigned_int_converters, ch) &&
bignum_sign (XBIGNUM_DATA (obj)) < 0)
@@ -733,13 +735,22 @@ emacs_doprnt_1 (Lisp_Object stream, cons
#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO)
else if (strchr (bignum_converters, ch))
{
+ int base = 16;
+
+ if (ch == 'n')
+ base = 10;
+ else if (ch == 'p')
+ base = 8;
+ else if (ch == '\337')
+ base = 2;
+
#ifdef HAVE_BIGNUM
if (BIGNUMP (arg.obj))
{
+ bignum *d = XBIGNUM_DATA (arg.obj);
Ibyte *text_to_print =
(Ibyte *) bignum_to_string (XBIGNUM_DATA (arg.obj),
- ch == 'n' ? 10 :
- (ch == 'p' ? 8 : 16));
+ base);
doprnt_2 (stream, text_to_print,
strlen ((const char *) text_to_print),
spec->minwidth, -1, spec->minus_flag,
@@ -751,9 +762,7 @@ emacs_doprnt_1 (Lisp_Object stream, cons
if (RATIOP (arg.obj))
{
Ibyte *text_to_print =
- (Ibyte *) ratio_to_string (XRATIO_DATA (arg.obj),
- ch == 'n' ? 10 :
- (ch == 'p' ? 8 : 16));
+ (Ibyte *) ratio_to_string (XRATIO_DATA (arg.obj), base);
doprnt_2 (stream, text_to_print,
strlen ((const char *) text_to_print),
spec->minwidth, -1, spec->minus_flag,
@@ -774,6 +783,15 @@ emacs_doprnt_1 (Lisp_Object stream, cons
xfree (text_to_print, Ibyte *);
}
#endif /* HAVE_BIGFLOAT */
+ else if (ch == 'b')
+ {
+ Ascbyte *text_to_print = alloca_array (char, SIZEOF_LONG * 8 + 1);
+
+ ulong_to_bit_string (text_to_print, arg.ul);
+ doprnt_2 (stream, (Ibyte *)text_to_print,
+ qxestrlen ((Ibyte *)text_to_print),
+ spec->minwidth, -1, spec->minus_flag, spec->zero_flag);
+ }
else
{
Ascbyte *text_to_print;
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 src/editfns.c
--- a/src/editfns.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/editfns.c Mon Dec 17 08:44:14 2007 +0100
@@ -2155,7 +2155,7 @@ It may contain %-sequences meaning to su
%s means print all objects as-is, using `princ'.
%S means print all objects as s-expressions, using `prin1'.
%d or %i means print as an integer in decimal (%o octal, %x lowercase hex,
- %X uppercase hex).
+ %X uppercase hex, %b binary).
%c means print as a single character.
%f means print as a floating-point number in fixed notation (e.g. 785.200).
%e or %E means print as a floating-point number in scientific notation
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 src/lisp.h
--- a/src/lisp.h Fri Dec 14 14:25:04 2007 +0100
+++ b/src/lisp.h Mon Dec 17 08:44:14 2007 +0100
@@ -4982,6 +4982,7 @@ void print_float (Lisp_Object, Lisp_Obje
#define DECIMAL_PRINT_SIZE(integral_type) \
(((2410824 * sizeof (integral_type)) / 1000000) + 3)
void long_to_string (char *, long);
+void ulong_to_bit_string (char *, unsigned long);
extern int print_escape_newlines;
extern MODULE_API int print_readably;
Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object,
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 src/lread.c
--- a/src/lread.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/lread.c Mon Dec 17 08:44:14 2007 +0100
@@ -2029,7 +2029,7 @@ parse_integer (const Ibyte *buf, Bytecou
overflow:
#ifdef HAVE_BIGNUM
{
- bignum_set_string (scratch_bignum, (const char *) buf, 0);
+ bignum_set_string (scratch_bignum, (const char *) buf, base);
return make_bignum_bg (scratch_bignum);
}
#else
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r d9eb5ea14f657b33158d624cf55ebb3ff1185b49 src/print.c
--- a/src/print.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/print.c Mon Dec 17 08:44:14 2007 +0100
@@ -1269,6 +1269,29 @@ long_to_string (char *buffer, long numbe
#undef DIGITS_18
#undef DIGITS_19
+void
+ulong_to_bit_string (char *p, unsigned long number)
+{
+ int i, seen_high_order = 0;;
+
+ for (i = ((SIZEOF_LONG * 8) - 1); i >= 0; --i)
+ {
+ if (number & (unsigned long)1 << i)
+ {
+ seen_high_order = 1;
+ *p++ = '1';
+ }
+ else
+ {
+ if (seen_high_order)
+ {
+ *p++ = '0';
+ }
+ }
+ }
+ *p = '\0';
+}
+
static void
print_vector_internal (const char *start, const char *end,
Lisp_Object obj,
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Make Mercurial ignore many generated files.
17 years
Michael Sperber
changeset: 4329:8a38eea09ab5a1e5a81fde551283d0418a8fa821
tag: tip
user: Mike Sperber <sperber(a)deinprogramm.de>
date: Tue Dec 18 15:05:21 2007 +0100
files: .hgignore
description:
Make Mercurial ignore many generated files.
diff -r dfd878799ef0724973cd47b1bbfc3aa3db777fdc -r 8a38eea09ab5a1e5a81fde551283d0418a8fa821 .hgignore
--- a/.hgignore Fri Dec 14 14:25:04 2007 +0100
+++ b/.hgignore Tue Dec 18 15:05:21 2007 +0100
@@ -1,3 +1,44 @@
(^|/)CVS($|/)
(^|/)\.hg($|/)
(^|/)\.hgtags($|/)
+\.o$
+\.elc$
+~$
+\.orig$
+info/.*\.info(-[0-9]+)?$
+^GNUmakefile$
+^Installation$
+^Makefile$
+^Makefile\.in$
+^autom4te\.cache
+^config\.(log|status)$
+^lib-src/DOC$
+^lib-src/(GNUmakefile|Makefile(\.in)?)$
+^lib-src/config\.values$
+^lib-src/(b2m|ctags|cvtmail|digest-doc|ellcc|etags|fakemail|gnuclient|gnuserv|hexl|insert-data-in-exec|make-docfile|make-dump-id|make-path|mmencode|movemail|ootags|profile|sorted-doc|wakeup|yow)$
+^lib-src/ellcc\.h$
+^lisp/(auto-autoloads|custom-load|finder-inf)\.el$
+^lisp/mule/(auto-autoloads|custom-load)\.el$
+^lwlib/(GNUmakefile|Makefile(\.in)?)$
+^lwlib/liblw\.a$
+^lwlib/config\.h$
+^modules/auto-autoloads\.el$
+^modules/ldap/(GNUmakefile|Makefile(\.in)?)$
+^modules/ldap/eldap\.ell$
+^modules/ldap/eldap_i\.c$
+^(xemacs|mule)-packages
+^etc/PROBLEMS$
+^src/(.dbxrc|.gdbinit)(\.in)?$
+^src/(GNUmakefile|Makefile(\.in)?)$
+^src/NEEDTODUMP$
+^src/config\.h$
+^src/dump-id\.c$
+^src/dump-size$
+^src/paths\.h$
+^src/sheap-adjust\.h$
+^src/temacs$
+^src/xemacs$
+^src/xemacs\.def(\.in)?$
+^src/xemacs\.dmp$
+^src/Emacs\.ad\.h$
+
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Fix autoloads issue
17 years
Michael Sperber
Semantic has this file semantic-alias.el that has only immediate
autoloads, which makes autoloads.el believe, to some extent, that there
aren't any autoloads at all. This makes the placement of the
semantic-alias autoloads quite random, as they don't get a section
header. I don't know if they function names in the section header are
used in a way where an <immediate> entry would hurt. Thus, I'm waiting
until Thursday with committing unless somebody objects.
2007-12-18 Mike Sperber <mike(a)xemacs.org>
* autoload.el (process-one-lisp-autoload): Insert <immediate> into
the section header for immediate autoloads, to make sure the
upstream doesn't think there aren't any autoloads at all.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
diff --git a/lisp/autoload.el b/lisp/autoload.el
--- a/lisp/autoload.el
+++ b/lisp/autoload.el
@@ -516,7 +516,8 @@ Updates AUTOLOADS-DONE and returns the n
(let ((begin (point)))
(forward-sexp)
(forward-line 1)
- (princ (buffer-substring begin (point)) outbuf)))
+ (princ (buffer-substring begin (point)) outbuf))
+ (setq autoloads-done (cons '<immediate> autoloads-done)))
(t
(princ (buffer-substring
(progn
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] Typo fix in enriched.doc
17 years
Michael Sperber
Flushing out an ages-old e-mail. (Absolutely no need to do a package
release because of this.)
2007-12-18 Mike Sperber <mike(a)xemacs.org>
* etc/enriched.doc: Fix trivial typo.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: etc/enriched.doc
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/etc/enriched.doc,v
retrieving revision 1.2
diff -u -r1.2 enriched.doc
--- etc/enriched.doc 12 Aug 1998 10:28:25 -0000 1.2
+++ etc/enriched.doc 18 Dec 2007 10:38:05 -0000
@@ -1,7 +1,7 @@
Content-Type: text/enriched
Text-Width: 80
-<x-bg-color><param>blue</param><x-color><param>white</param><bold><fixed><bigger><center>enriched.el:</center></bigger></fixed></bold></x-color></x-bg-color><center>
+<x-bg-color><param>blue</param><x-color><param>white</param><bold><fixed><center>enriched.el:</center></fixed></bold></x-color></x-bg-color><center>
<x-bg-color><param>blue</param><bold>WYSIWYG rich text editing for GNU Emacs</bold></x-bg-color>
</center><bold><x-bg-color><param>blue</param><x-color><param>white</param>INTRODUCTION
@@ -44,8 +44,8 @@
<bold>Faces:</bold> default, <bold>bold</bold>, <italic>italic</italic>, <underline>underline</underline>, <fixed>fixed</fixed>, etc.
<bold>Colors:</bold> <x-color><param>red</param><x-bg-color><param>DarkSlateGray</param>any</x-bg-color></x-color><x-bg-color><param>DarkSlateGray</param><x-color><param>orange</param>thing</x-color> <x-color><param>yellow</param>your</x-color><x-color><param>green</param> screen</x-color><x-color><param>blue</param> </x-color><x-color><param>light blue</param>can</x-color><x-color><param>violet</param> display...</x-color></x-bg-color>
-<bold>Sizes:</bold> things can get <bigger>larger</bigger>, <smaller>smaller</smaller>, <bigger><bigger><bigger><bigger><bigger>much larger</bigger></bigger></bigger></bigger></bigger>, and <smaller><smaller><smaller><smaller><smaller>much
- smaller</smaller></smaller></smaller></smaller></smaller>.
+<bold>Sizes:</bold> things can get larger, smaller, much larger, and much
+ smaller.
<bold>Newlines:</bold> <indent>Which ones are real ("hard") newlines, and which can be
changed to fit lines into the ma</indent>rgins.
@@ -135,12 +135,12 @@
</flushboth></indent><x-bg-color><param>blue</param><x-color><param>white</param><bold>EXCERPTS
</bold></x-color></x-bg-color>
-<indent><excerpt>This is an example of an excerpt. You can use them for quoted
+<excerpt><indent>This is an example of an excerpt. You can use them for quoted
parts of other people's email messages and the like. It is just a
-face, which is the same as the `italic' face by default.</excerpt></indent>
+face, which is the same as the `italic' face by default.</indent></excerpt>
<x-bg-color><param>blue</param><x-color><param>white</param><bold>THE FILE FORMAT<indent>
</indent></bold></x-color></x-bg-color><indent>
-Enriched-mode docuemnts are saved in an extended version of a
+Enriched-mode documents are saved in an extended version of a
format called <italic>text/enriched</italic>, which is defined as part of the MIME
standard. This means that your documents are transportable (even
through email) to many</indent> <indent>other systems. In the future other file
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] xemacsweb: Suppress genpage dummy-dots using -q
17 years
Adrian Aichner
COMMIT
Testing broken website update.
sourceforge-commit seems to get rejected.
Yep, as expected ...
The workaround is to execute the aliases named web-update manually as xemacweb(a)www.xemacs.org and xemacs(a)shell.sourceforge.net.
Adrian
**** Access allowed: Personal Karma exceeds Environmental Karma.
Checking in ChangeLog;
/pack/xemacscvs/XEmacs/xemacsweb/ChangeLog,v <-- ChangeLog
new revision: 1.279; previous revision: 1.278
done
Checking in Makefile;
/pack/xemacscvs/XEmacs/xemacsweb/Makefile,v <-- Makefile
new revision: 1.57; previous revision: 1.56
done
Processing log script arguments...
Mailing the commit message to xemacs-cvs(a)xemacs.org (from xemacs-cvs(a)xemacs.org)
Updating website as xemacs(a)sunsite.dk ...
Updating website as xemacs(a)xemacs.sourceforge.net ...
Permission denied, please try again.
Permission denied, please try again.
Permission denied.
Updating website as xemacweb(a)www.xemacs.org ...
Permission denied, please try again.
Permission denied, please try again.
Permission denied.
xemacsweb ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/ChangeLog,v
retrieving revision 1.278
diff -u -U0 -r1.278 ChangeLog
--- ChangeLog 3 Dec 2007 21:05:10 -0000 1.278
+++ ChangeLog 17 Dec 2007 23:15:48 -0000
@@ -0,0 +1,5 @@
+2007-12-18 Adrian Aichner <adrian(a)xemacs.org>
+
+ * Makefile (htdocs-time-stamp): Suppress genpage dummy-dots using
+ -q.
+
xemacsweb source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: Makefile
===================================================================
RCS
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/Makefile,v
retrieving revision 1.56
diff -u -w -r1.56 Makefile
--- Makefile 2 Oct 2007 18:38:49 -0000 1.56
+++ Makefile 17 Dec 2007 23:15:22 -0000
@@ -84,7 +84,7 @@
Download/win32/netinstall-win32.txt \
Download/win32/innosetup-win32.txt \
Download/win32/installshield-win32.txt
- perl ./genpage/bin/genpage -p $(GENPAGE_CONF) -o "."
+ perl ./genpage/bin/genpage -q -p $(GENPAGE_CONF) -o "."
touch htdocs-time-stamp
# APA: Validate only files younger than time-stamp file created by
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] Dired 7.15
17 years
Michael Sperber
I've just committed Dired 7.15. Its only change over 7.14 is a
one-character diff to make it work on Mac OS X Leopard.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] Fix another igrep configuration issue
17 years
Michael Sperber
2007-12-17 Mike Sperber <mike(a)xemacs.org>
* igrep.el (igrep-find-use-xargs): Cater to the case where we have
GNU find, but no xargs -e. (Mac OS X, for example.)
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: igrep.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/igrep/igrep.el,v
retrieving revision 1.13
diff -u -r1.13 igrep.el
--- igrep.el 21 Aug 2007 15:14:04 -0000 1.13
+++ igrep.el 17 Dec 2007 12:17:14 -0000
@@ -447,11 +447,13 @@
see `igrep-find'.")
(defvar igrep-find-use-xargs
- (cond ((equal (call-process igrep-find-program nil nil nil
- igrep-null-device "-print0")
+ (cond ((not (equal (call-process "xargs" nil nil nil "-e") 0))
+ nil)
+ ((equal (call-process igrep-find-program nil nil nil
+ igrep-null-device "-print0")
0)
'gnu)
- ((equal (call-process "xargs" nil nil nil "-e") 0)))
+ (t t))
"Whether `\\[igrep-find]' uses the `xargs` program or not.
If `gnu', it executes
`find ... -print0 | xargs -0 -e grep ...`;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Provide %b in #'format; use it for converting between ints and bit vectors
17 years
Aidan Kehoe
10 files changed, 106 insertions(+), 10 deletions(-)
lisp/ChangeLog | 6 ++++++
lisp/subr.el | 20 ++++++++++++++++++++
man/ChangeLog | 5 +++++
man/lispref/strings.texi | 5 +++++
src/ChangeLog | 18 ++++++++++++++++++
src/doprnt.c | 34 ++++++++++++++++++++++++++--------
src/editfns.c | 2 +-
src/lisp.h | 1 +
src/lread.c | 2 +-
src/print.c | 23 +++++++++++++++++++++++
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1197877454 -3600
# Node ID d9eb5ea14f657b33158d624cf55ebb3ff1185b49
# Parent dfd878799ef0724973cd47b1bbfc3aa3db777fdc
Provide %b in #'format; use it for converting between ints and bit vectors.
lisp/ChangeLog addition:
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (integer-to-bit-vector): New.
* subr.el (bit-vector-to-integer): New.
Provide naive implementations using the Lisp reader for these.
src/ChangeLog addition:
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* doprnt.c (emacs_doprnt_1):
Add support for formatted printing of both longs and bignums as
base 2.
* editfns.c (Fformat):
Document the new %b escape for #'format.
* lisp.h:
Make ulong_to_bit_string available beside long_to_string.
* lread.c:
Fix a bug where the integer base was being ignored in certain
contexts; thank you Sebastian Freundt. This is necessary for
correct behaviour of #'integer-to-bit-vector and
#'bit-vector-to-integer, just added to subr.el
* print.c (ulong_to_bit_string): New.
Analagous to long_to_string, but used all the time when %b is
encountered, since we can't pass that to sprintf.
man/ChangeLog addition:
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/strings.texi (Formatting Strings):
Document %b for binary output.
diff -r dfd878799ef0 -r d9eb5ea14f65 lisp/ChangeLog
--- a/lisp/ChangeLog Fri Dec 14 14:25:04 2007 +0100
+++ b/lisp/ChangeLog Mon Dec 17 08:44:14 2007 +0100
@@ -1,3 +1,9 @@ 2007-12-14 Aidan Kehoe <kehoea@parhasa
+2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * subr.el (integer-to-bit-vector): New.
+ * subr.el (bit-vector-to-integer): New.
+ Provide naive implementations using the Lisp reader for these.
+
2007-12-14 Aidan Kehoe <kehoea(a)parhasard.net>
* process.el (substitute-env-vars):
diff -r dfd878799ef0 -r d9eb5ea14f65 lisp/subr.el
--- a/lisp/subr.el Fri Dec 14 14:25:04 2007 +0100
+++ b/lisp/subr.el Mon Dec 17 08:44:14 2007 +0100
@@ -912,6 +912,26 @@ See also `equalp'."
;; foo-to-bar naming scheme, but CLtL2 has them, so they stay.
(define-function 'char-int 'char-to-int)
(define-function 'int-char 'int-to-char)
+
+;; XEmacs addition.
+(defun integer-to-bit-vector (integer &optional minlength)
+ "Return INTEGER converted to a bit vector.
+Optional argument MINLENGTH gives a minimum length for the returned vector.
+If MINLENGTH is not given, zero high-order bits will be ignored."
+ (check-argument-type #'integerp integer)
+ (setq minlength (or minlength 0))
+ (check-nonnegative-number minlength)
+ (read (format (format "#*%%0%db" minlength) integer)))
+
+;; XEmacs addition.
+(defun bit-vector-to-integer (bit-vector)
+ "Return BIT-VECTOR converted to an integer.
+If bignum support is available, BIT-VECTOR's length is unlimited.
+Otherwise the limit is the number of value bits in an Lisp integer. "
+ (check-argument-type #'bit-vector-p bit-vector)
+ (setq bit-vector (prin1-to-string bit-vector))
+ (aset bit-vector 1 ?b)
+ (read bit-vector))
(defun string-width (string)
"Return number of columns STRING occupies when displayed.
diff -r dfd878799ef0 -r d9eb5ea14f65 man/ChangeLog
--- a/man/ChangeLog Fri Dec 14 14:25:04 2007 +0100
+++ b/man/ChangeLog Mon Dec 17 08:44:14 2007 +0100
@@ -1,3 +1,8 @@ 2007-12-10 Ville Skyttä <scop(a)xemacs.o
+2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/strings.texi (Formatting Strings):
+ Document %b for binary output.
+
2007-12-10 Ville Skyttä <scop(a)xemacs.org>
* internals/internals.texi: Spelling fixes.
diff -r dfd878799ef0 -r d9eb5ea14f65 man/lispref/strings.texi
--- a/man/lispref/strings.texi Fri Dec 14 14:25:04 2007 +0100
+++ b/man/lispref/strings.texi Mon Dec 17 08:44:14 2007 +0100
@@ -715,6 +715,11 @@ Replace the specification with the base-
Replace the specification with the base-sixteen representation of an
integer, using uppercase letters.
+@item %b
+@cindex integer to binary
+Replace the specification with the base-two representation of an
+integer.
+
@item %c
Replace the specification with the character which is the value given.
diff -r dfd878799ef0 -r d9eb5ea14f65 src/ChangeLog
--- a/src/ChangeLog Fri Dec 14 14:25:04 2007 +0100
+++ b/src/ChangeLog Mon Dec 17 08:44:14 2007 +0100
@@ -1,3 +1,21 @@ 2007-12-12 Aidan Kehoe <kehoea@parhasa
+2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doprnt.c (emacs_doprnt_1):
+ Add support for formatted printing of both longs and bignums as
+ base 2.
+ * editfns.c (Fformat):
+ Document the new %b escape for #'format.
+ * lisp.h:
+ Make ulong_to_bit_string available beside long_to_string.
+ * lread.c:
+ Fix a bug where the integer base was being ignored in certain
+ contexts; thank you Sebastian Freundt. This is necessary for
+ correct behaviour of #'integer-to-bit-vector and
+ #'bit-vector-to-integer, just added to subr.el
+ * print.c (ulong_to_bit_string): New.
+ Analagous to long_to_string, but used all the time when %b is
+ encountered, since we can't pass that to sprintf.
+
2007-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
diff -r dfd878799ef0 -r d9eb5ea14f65 src/doprnt.c
--- a/src/doprnt.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/doprnt.c Mon Dec 17 08:44:14 2007 +0100
@@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "lstream.h"
static const char * const valid_flags = "-+ #0";
-static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS"
+static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS" "b"
#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO)
"npyY"
#endif
@@ -43,11 +43,11 @@ static const char * const valid_converte
#endif
;
static const char * const int_converters = "dic";
-static const char * const unsigned_int_converters = "ouxX";
+static const char * const unsigned_int_converters = "ouxXb";
static const char * const double_converters = "feEgG";
static const char * const string_converters = "sS";
#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO)
-static const char * const bignum_converters = "npyY";
+static const char * const bignum_converters = "npyY\337";
#endif
#ifdef HAVE_BIGFLOAT
static const char * const bigfloat_converters = "FhHkK";
@@ -665,6 +665,7 @@ emacs_doprnt_1 (Lisp_Object stream, cons
case 'o': ch = 'p'; break;
case 'x': ch = 'y'; break;
case 'X': ch = 'Y'; break;
+ case 'b': ch = 'b'; break;
default: /* ch == 'u' */
if (strchr (unsigned_int_converters, ch) &&
ratio_sign (XRATIO_DATA (obj)) < 0)
@@ -684,6 +685,7 @@ emacs_doprnt_1 (Lisp_Object stream, cons
case 'o': ch = 'p'; break;
case 'x': ch = 'y'; break;
case 'X': ch = 'Y'; break;
+ case 'b': ch = '\337'; break;
default: /* ch == 'u' */
if (strchr (unsigned_int_converters, ch) &&
bignum_sign (XBIGNUM_DATA (obj)) < 0)
@@ -733,13 +735,22 @@ emacs_doprnt_1 (Lisp_Object stream, cons
#if defined(HAVE_BIGNUM) || defined(HAVE_RATIO)
else if (strchr (bignum_converters, ch))
{
+ int base = 16;
+
+ if (ch == 'n')
+ base = 10;
+ else if (ch == 'p')
+ base = 8;
+ else if (ch == '\337')
+ base = 2;
+
#ifdef HAVE_BIGNUM
if (BIGNUMP (arg.obj))
{
+ bignum *d = XBIGNUM_DATA (arg.obj);
Ibyte *text_to_print =
(Ibyte *) bignum_to_string (XBIGNUM_DATA (arg.obj),
- ch == 'n' ? 10 :
- (ch == 'p' ? 8 : 16));
+ base);
doprnt_2 (stream, text_to_print,
strlen ((const char *) text_to_print),
spec->minwidth, -1, spec->minus_flag,
@@ -751,9 +762,7 @@ emacs_doprnt_1 (Lisp_Object stream, cons
if (RATIOP (arg.obj))
{
Ibyte *text_to_print =
- (Ibyte *) ratio_to_string (XRATIO_DATA (arg.obj),
- ch == 'n' ? 10 :
- (ch == 'p' ? 8 : 16));
+ (Ibyte *) ratio_to_string (XRATIO_DATA (arg.obj), base);
doprnt_2 (stream, text_to_print,
strlen ((const char *) text_to_print),
spec->minwidth, -1, spec->minus_flag,
@@ -774,6 +783,15 @@ emacs_doprnt_1 (Lisp_Object stream, cons
xfree (text_to_print, Ibyte *);
}
#endif /* HAVE_BIGFLOAT */
+ else if (ch == 'b')
+ {
+ Ascbyte *text_to_print = alloca_array (char, SIZEOF_LONG * 8 + 1);
+
+ ulong_to_bit_string (text_to_print, arg.ul);
+ doprnt_2 (stream, (Ibyte *)text_to_print,
+ qxestrlen ((Ibyte *)text_to_print),
+ spec->minwidth, -1, spec->minus_flag, spec->zero_flag);
+ }
else
{
Ascbyte *text_to_print;
diff -r dfd878799ef0 -r d9eb5ea14f65 src/editfns.c
--- a/src/editfns.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/editfns.c Mon Dec 17 08:44:14 2007 +0100
@@ -2155,7 +2155,7 @@ It may contain %-sequences meaning to su
%s means print all objects as-is, using `princ'.
%S means print all objects as s-expressions, using `prin1'.
%d or %i means print as an integer in decimal (%o octal, %x lowercase hex,
- %X uppercase hex).
+ %X uppercase hex, %b binary).
%c means print as a single character.
%f means print as a floating-point number in fixed notation (e.g. 785.200).
%e or %E means print as a floating-point number in scientific notation
diff -r dfd878799ef0 -r d9eb5ea14f65 src/lisp.h
--- a/src/lisp.h Fri Dec 14 14:25:04 2007 +0100
+++ b/src/lisp.h Mon Dec 17 08:44:14 2007 +0100
@@ -4982,6 +4982,7 @@ void print_float (Lisp_Object, Lisp_Obje
#define DECIMAL_PRINT_SIZE(integral_type) \
(((2410824 * sizeof (integral_type)) / 1000000) + 3)
void long_to_string (char *, long);
+void ulong_to_bit_string (char *, unsigned long);
extern int print_escape_newlines;
extern MODULE_API int print_readably;
Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object,
diff -r dfd878799ef0 -r d9eb5ea14f65 src/lread.c
--- a/src/lread.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/lread.c Mon Dec 17 08:44:14 2007 +0100
@@ -2029,7 +2029,7 @@ parse_integer (const Ibyte *buf, Bytecou
overflow:
#ifdef HAVE_BIGNUM
{
- bignum_set_string (scratch_bignum, (const char *) buf, 0);
+ bignum_set_string (scratch_bignum, (const char *) buf, base);
return make_bignum_bg (scratch_bignum);
}
#else
diff -r dfd878799ef0 -r d9eb5ea14f65 src/print.c
--- a/src/print.c Fri Dec 14 14:25:04 2007 +0100
+++ b/src/print.c Mon Dec 17 08:44:14 2007 +0100
@@ -1269,6 +1269,29 @@ long_to_string (char *buffer, long numbe
#undef DIGITS_18
#undef DIGITS_19
+void
+ulong_to_bit_string (char *p, unsigned long number)
+{
+ int i, seen_high_order = 0;;
+
+ for (i = ((SIZEOF_LONG * 8) - 1); i >= 0; --i)
+ {
+ if (number & (unsigned long)1 << i)
+ {
+ seen_high_order = 1;
+ *p++ = '1';
+ }
+ else
+ {
+ if (seen_high_order)
+ {
+ *p++ = '0';
+ }
+ }
+ }
+ *p = '\0';
+}
+
static void
print_vector_internal (const char *start, const char *end,
Lisp_Object obj,
--
¿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
XEmacs Committers' Guide
17 years
Michael Sperber
Here are some guidelines the review board has worked out for people who
commit to the XEmacs Mercurial repository on Alioth.
Repository Access
=================
The maintainers will update this repository as changesets pass
through the review process and are approved.
Commit access for all developers is available via this URL:
ssh://<user>@hg.debian.org//hg/xemacs/xemacs
(The double slash in the path part is required syntax.)
Access to the testing version for the folks on xemacs-beta is available
via this URL:
http://hg.debian.org/hg/xemacs/xemacs-beta
NO ONE SHOULD COMMIT TO "xemacs-beta" EXCEPT AS PART OF THE REVIEW AND
MERGE PROCESS. Developers can make urgent fixes immediately available
via the normal process of committing to "xemacs". Testers who are
sticking to "xemacs-beta" have the option of cherrying-picking those
fixes or reverting to a more stable version of the tree.
If you currently have commit access to the XEmacs CVS, but don't have
commit access to the Mercurial repository yet, go to:
http://alioth.debian.org/account/register.php
There, sign up as a user and send me your account name. I'll get you
set up.
The commit notices mailing list is filtered for posts by non-members.
To avoid delays in posting of your commit notices, subscribe your Alioth
user to the "xemacs-patches" mailing list and set it to no-mail in the
Mailman user interface at calypso.tux.org. (If you don't, the list
admin will catch it, and do it for you. You can save us some work by
doing it yourself. Thanks in advance!)
Getting Mercurial
=================
Mercurial itself is available here:
http://www.selenic.com/mercurial/wiki/
This online book on Mercurial is a highly recommended resource:
http://hgbook.red-bean.com/hgbook.html
Commit policy
=============
As a developer, you should work on the "xemacs" repository. Don't lump
unrelated changes into a single changeset---these will be vetoed.
Mercurial gives you a number of tools to help you separate unrelated
changes, among them the possibility to keep several repositories around,
as well as the Mercurial Queues extension.
The "xemacs-beta" repository will slightly lag "xemacs"---selected
developers will push changes from "xemacs" to "xemacs-beta" with a delay
of at least 48 hours, and only to the point where there aren't any
immediate serious problems with the changes to be pushed (such as a
review veto or a broken build). Authors of patches that are vetoed are
expected to back them out (via "hg backout").
To facilitate this process, every commit to "xemacs" will trigger an
e-mail to be sent to xemacs-patches(a)xemacs.org, where it can be reviewed
and discussed. These automatic e-mails replace the manual e-mails we
have now. To make sure they fulfill the same purpose, committers are
asked to provide informative ChangeLog entries and commit messsages.
Commit messages may be identical to the ChangeLog entry, except for the
first line (see below).
Users without commit access will continue to send patches to
xemacs-patches as currently. Anybody who wishes their patch to receive
review before committing is also welcome to send a patch to
xemacs-patches for discussion.
Log messages
============
Every commit should be accompanied by an informative log message. This
should consist of the ChangeLog entries (which you should have written
as part of your change) and a first line with an informative summary.
The first line has somewhat special status in Mercurial, in that it will
be the only line from the log message displayed by a regular "hg log".
(The rest will only be displayed via "hg log -v".) So make sure you
provide a self-contained summary in the first line.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: [PATCH] Avoid syntax complaints in #'substitute-in-file-name
17 years
Aidan Kehoe
Ar an dara lá déag de mí na Nollaig, scríobh Stephen J. Turnbull:
> QUERY
>
> Aren't we being altogether too smart for our own good at C level?
Yes.
> If you're going to try to second-guess a luser, do it in Lisp. If you
> really think you need to do this here, I question whether
> substitute-in-file-name isn't being called in the wrong place or with
> insufficient protection.
It’s called when determining the user’s home directory at startup; also from
load-internal. I don’t think making use of #'substitute-in-file-name’s
features at dump time is a particularly good idea, so it might be a better
idea to move the function to Lisp and only call it from both places if it’s
bound.
--
¿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