[PATCH] Make GC dependent on % of total memory consed
19 years, 6 months
Ben Wing
This one I'm not committing quite yet, as it is a (somewhat) user-visible
change. I'm interested in comments. With this change, GC will not happen
until at least 40% (a random guess) of current Lisp-object memory has been
allocated. The purpose of this is to make GC time be a constant amortized
percentage of total run time, regardless of how big XEmacs is. (Currently,
GC time will become a progressively larger percent of total time as the
size of XEmacs increases.) Note that the lower bound …
[View More]in gc-cons-threshold
(500K) still applies.
ben
src/ChangeLog addition:
2005-09-27 Ben Wing <ben(a)xemacs.org>
* alloc.c (garbage_collect_1):
Avoid use of reserved C++ `catch'.
* alloc.c:
* alloc.c (gc_plist_hack):
* alloc.c (HACK_O_MATIC):
* alloc.c (Fgarbage_collect):
* alloc.c (Ftotal_memory_usage):
* alloc.c (Flisp_object_memory_usage):
* alloc.c (recompute_need_to_garbage_collect):
* alloc.c (common_init_alloc_early):
* alloc.c (syms_of_alloc):
* alloc.c (vars_of_alloc):
Rename underused `memory-usage' to `total-memory-usage'.
Add `lisp-object-memory-usage'. Reimplement `gc-cons-percentage'
to be a percentage of total Lisp object allocation (not total
memory of all sorts, which is hard to calculate in any case) and
give it a preliminary value of 40%. Use EMACS_INT instead of
int in a couple of places.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/alloc.c
Tue Sep 27 00:52:23 CDT 2005
Index: src/alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v
retrieving revision 1.113
diff -u -p -r1.113 alloc.c
--- src/alloc.c 2005/05/15 16:38:11 1.113
+++ src/alloc.c 2005/09/27 05:52:48
@@ -1,7 +1,7 @@
/* Storage allocation and gc for XEmacs Lisp interpreter.
Copyright (C) 1985-1998 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004 Ben Wing.
+ Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -94,6 +94,8 @@ static Fixnum debug_allocation_backtrace
/* Number of bytes of consing done since the last gc */
static EMACS_INT consing_since_gc;
EMACS_UINT total_consing;
+EMACS_INT total_gc_usage;
+int total_gc_usage_set;
int need_to_garbage_collect;
int need_to_check_c_alloca;
@@ -5525,13 +5527,13 @@ garbage_collect_1 (void)
}
{
- struct catchtag *catch;
- for (catch = catchlist; catch; catch = catch->next)
+ struct catchtag *c;
+ for (c = catchlist; c; c = c->next)
{
- mark_object (catch->tag);
- mark_object (catch->val);
- mark_object (catch->actual_tag);
- mark_object (catch->backtrace);
+ mark_object (c->tag);
+ mark_object (c->val);
+ mark_object (c->actual_tag);
+ mark_object (c->backtrace);
}
}
@@ -5769,7 +5771,7 @@ Garbage collection happens automatically
/* Debugging aids. */
static Lisp_Object
-gc_plist_hack (const Ascbyte *name, int value, Lisp_Object tail)
+gc_plist_hack (const Ascbyte *name, EMACS_INT value, Lisp_Object tail)
{
/* C doesn't have local functions (or closures, or GC, or readable syntax,
or portable numeric datatypes, or bit-vectors, or characters, or
@@ -5778,9 +5780,10 @@ gc_plist_hack (const Ascbyte *name, int
}
#define HACK_O_MATIC(type, name, pl) do { \
- int s = 0; \
+ EMACS_INT s = 0; \
struct type##_block *x = current_##type##_block; \
while (x) { s += sizeof (*x) + MALLOC_OVERHEAD; x = x->prev; } \
+ object_usage += s; \
(pl) = gc_plist_hack ((name), s, (pl)); \
} while (0)
@@ -5800,8 +5803,11 @@ Garbage collection happens automatically
Lisp_Object pl = Qnil;
int i;
int gc_count_vector_total_size = 0;
+ EMACS_INT object_usage = 0;
+
garbage_collect_1 ();
+
for (i = 0; i < lrecord_type_count; i++)
{
if (lcrecord_stats[i].bytes_in_use != 0
@@ -5818,6 +5824,7 @@ Garbage collection happens automatically
sprintf (buf, "%s-storage", name);
pl = gc_plist_hack (buf, lcrecord_stats[i].bytes_in_use, pl);
+ object_usage += lcrecord_stats[i].bytes_in_use;
/* Okay, simple pluralization check for `symbol-value-varalias' */
if (name[len-1] == 's')
sprintf (buf, "%ses-freed", name);
@@ -5895,6 +5902,10 @@ Garbage collection happens automatically
pl = gc_plist_hack ("conses-free", gc_count_num_cons_freelist, pl);
pl = gc_plist_hack ("conses-used", gc_count_num_cons_in_use, pl);
+ /* Record total usage for purposes of determining next GC */
+ total_gc_usage = object_usage;
+ total_gc_usage_set = 1;
+
/* The things we do for backwards-compatibility */
return
list6 (Fcons (make_int (gc_count_num_cons_in_use),
@@ -5934,15 +5945,29 @@ The value is divided by 1024 to make sur
}
#endif
-DEFUN ("memory-usage", Fmemory_usage, 0, 0, 0, /*
+DEFUN ("total-memory-usage", Ftotal_memory_usage, 0, 0, 0, /*
Return the total number of bytes used by the data segment in XEmacs.
This may be helpful in debugging XEmacs's memory usage.
+NOTE: This may or may not be accurate! It is hard to determine this
+value in a system-independent fashion.
*/
())
{
return make_int (total_data_usage ());
}
+DEFUN ("lisp-object-memory-usage", Flisp_object_memory_usage, 0, 0, 0, /*
+Return the total number of bytes used for object storage in XEmacs.
+This may be helpful in debugging XEmacs's memory usage.
+This value is only recomputed when garbage collection happens; thus, a
+better value of the real number of bytes used is
+ (+ (lisp-object-memory-usage) (consing-since-gc))
+*/
+ ())
+{
+ return make_int (total_gc_usage);
+}
+
void
recompute_funcall_allocation_flag (void)
{
@@ -5961,11 +5986,15 @@ recompute_need_to_garbage_collect (void)
else
need_to_garbage_collect =
(consing_since_gc > gc_cons_threshold
-#if 0 /* #### implement this better */
&&
+#if 0 /* #### implement this better */
(100 * consing_since_gc) / total_data_usage () >=
gc_cons_percentage
-#endif /* 0 */
+#else
+ (!total_gc_usage_set ||
+ (100 * consing_since_gc) / total_gc_usage >=
+ gc_cons_percentage)
+#endif
);
recompute_funcall_allocation_flag ();
}
@@ -6220,9 +6249,8 @@ common_init_alloc_early (void)
#else
gc_cons_threshold = 15000; /* debugging */
#endif
- gc_cons_percentage = 0; /* #### 20; Don't have an accurate measure of
- memory usage on Windows; not verified on other
- systems */
+ gc_cons_percentage = 40; /* #### what is optimal? */
+ total_gc_usage_set = 0;
lrecord_uid_counter = 259;
#ifndef MC_ALLOC
debug_string_purity = 0;
@@ -6354,7 +6382,8 @@ syms_of_alloc (void)
#if 0
DEFSUBR (Fmemory_limit);
#endif
- DEFSUBR (Fmemory_usage);
+ DEFSUBR (Ftotal_memory_usage);
+ DEFSUBR (Flisp_object_memory_usage);
DEFSUBR (Fconsing_since_gc);
}
@@ -6386,26 +6415,22 @@ effective way to check GCPRO problems, b
will be unusable! You almost certainly won't have the patience to wait
long enough to be able to set it back.
-See also `consing-since-gc'.
+See also `consing-since-gc' and `gc-cons-percentage'.
*/ );
DEFVAR_INT ("gc-cons-percentage", &gc_cons_percentage /*
*Percentage of memory allocated between garbage collections.
Garbage collection will happen if this percentage of the total amount of
-memory used for data has been allocated since the last garbage collection.
-However, it will not happen if less than `gc-cons-threshold' bytes have
-been allocated -- this sets an absolute minimum in case very little data
-has been allocated or the percentage is set very low. Set this to 0 to
-have garbage collection always happen after `gc-cons-threshold' bytes have
-been allocated, regardless of current memory usage.
-
-Garbage collection happens automatically when `eval' or `funcall' are
-called. (Note that `funcall' is called implicitly as part of evaluation.)
-By binding this temporarily to a large number, you can effectively
-prevent garbage collection during a part of the program.
+memory used for data (see `lisp-object-memory-usage') has been allocated
+since the last garbage collection. However, it will not happen if less
+than `gc-cons-threshold' bytes have been allocated -- this sets an absolute
+minimum in case very little data has been allocated or the percentage is
+set very low. Set this to 0 to have garbage collection always happen after
+`gc-cons-threshold' bytes have been allocated, regardless of current memory
+usage.
-See also `consing-since-gc'.
+See also `consing-since-gc' and `gc-cons-threshold'.
*/ );
#ifdef DEBUG_XEMACS
[View Less]
[AC] Fix parsing bug in xml.el
19 years, 6 months
Steve Youngs
APPROVE COMMIT
Thanks very much, David. I've committed this.
2005-10-01 Steve Youngs <steve(a)sxemacs.org>
* xml.el (xml-parse-region):
* xml.el (xml-parse-tag):
Fix bug where an empty element written as <foo/> incorrectly has a
list of children.
From: David Aspinall <David.Aspinall(a)ed.ac.uk>
Index: xml.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/net-utils/xml.el,v
retrieving …
[View More]revision 1.2
diff -u -p -r1.2 xml.el
--- xml.el 3 Dec 2003 01:35:17 -0000 1.2
+++ xml.el 30 Sep 2005 22:45:45 -0000
@@ -1,5 +1,8 @@
;;; xml.el --- XML parser
+;;; !!! This version has been modified from the version distributed with
+;;; XEmacs to fix a bug parsing empty elements, for Proof General. !!!
+
;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
;; Author: Emmanuel Briot <briot(a)gnat.com>
@@ -169,8 +172,8 @@ and returned as the first element of the
(error "XML files can have only one toplevel tag")))
(goto-char end)))
(if parse-dtd
- (cons dtd (reverse xml))
- (reverse xml)))))
+ (cons dtd (nreverse xml))
+ (nreverse xml)))))
(defun xml-parse-tag (end &optional parse-dtd)
@@ -225,7 +228,7 @@ Returns one of:
(if (looking-at "/>")
(progn
(forward-char 2)
- (nreverse (cons '("") children)))
+ (nreverse children))
;; is this a valid start tag ?
(if (eq (char-after) ?>)
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| I am Dyslexic of Borg. |
| Fusistance is retile. Your arse will be laminated. |
|------------------------------------<steve(a)sxemacs.org>---|
[View Less]
[COMMIT] fix --disable-debug error
19 years, 6 months
Ben Wing
NOTE: This patch has been committed.
src/ChangeLog addition:
2005-09-29 Ben Wing <ben(a)xemacs.org>
* alloca.c (xemacs_c_alloca):
Don't declare a variable `register' when it can be passed to
xfree(), which may take its address.
new -> new_.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/alloca.c
Index: src/alloca.c
===================================================================
RCS file: /pack/xemacscvs/…
[View More]XEmacs/xemacs/src/alloca.c,v
retrieving revision 1.9
diff -u -p -r1.9 alloca.c
--- src/alloca.c 2005/01/24 23:33:46 1.9
+++ src/alloca.c 2005/09/30 02:03:28
@@ -143,7 +143,7 @@ xemacs_c_alloca (unsigned int size)
was allocated from deeper in the stack than currently. */
{
- register header *hp; /* Traverses linked list. */
+ header *hp; /* Traverses linked list. */
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
@@ -177,20 +177,20 @@ xemacs_c_alloca (unsigned int size)
{
#ifdef emacs
- register pointer new = xmalloc (sizeof (header) + size);
+ register pointer new_ = xmalloc (sizeof (header) + size);
#else
- register pointer new = malloc (sizeof (header) + size);
+ register pointer new_ = malloc (sizeof (header) + size);
#endif
/* Address of header. */
- ((header *) new)->h.next = last_alloca_header;
- ((header *) new)->h.deep = depth;
+ ((header *) new_)->h.next = last_alloca_header;
+ ((header *) new_)->h.deep = depth;
- last_alloca_header = (header *) new;
+ last_alloca_header = (header *) new_;
/* User storage begins just after header. */
- return (pointer) ((char *) new + sizeof (header));
+ return (pointer) ((char *) new_ + sizeof (header));
}
}
[View Less]
[AC21.4R21.5] Email truncation bug begone!
19 years, 6 months
Jerry James
APPROVE COMMIT 21.5 RECOMMEND 21.4
David,
I took much too long to process this. I can only claim extreme busyness
with some Real Life stuff over the last several weeks. Thank you so
much for analyzing the problem and coming up with a fix. I'm going to
give credit where credit is due (although I did tweak your patch very
slightly in a couple of ways). The 21.5 patch, which I am committing,
is first, followed by the 21.4 version of the patch. Both have the same
ChangeLog entry.
See the …
[View More]discussion rooted here for more information:
http://list-archive.xemacs.org/xemacs-beta/200412/msg00128.html
src/ChangeLog addition:
2005-02-03 David Evers <extsw(a)appliedgenerics.com>
* process-unix.c (unix_send_process): Flush the last chunk, even
when the pipe is blocked.
xemacs-21.5 source patch:
Diff command: cvs -q diff -uN
Files affected: src/process-unix.c
Index: src/process-unix.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v
retrieving revision 1.56
diff -d -u -r1.56 process-unix.c
--- src/process-unix.c 2005/01/24 23:34:05 1.56
+++ src/process-unix.c 2005/02/04 03:53:40
@@ -1511,30 +1511,38 @@
Ibyte chunkbuf[512];
Bytecount chunklen;
- while (1)
+ do
{
int writeret;
chunklen = Lstream_read (lstream, chunkbuf, 512);
- if (chunklen <= 0)
- break; /* perhaps should ABORT() if < 0?
- This should never happen. */
old_sigpipe =
(SIGTYPE (*) (int)) EMACS_SIGNAL (SIGPIPE, send_process_trap);
- /* Lstream_write() will never successfully write less than
- the amount sent in. In the worst case, it just buffers
- the unwritten data. */
- writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM (p)), chunkbuf,
- chunklen);
- {
- int save_errno = errno;
- EMACS_SIGNAL (SIGPIPE, old_sigpipe);
- errno = save_errno;
- if (writeret < 0)
- /* This is a real error. Blocking errors are handled
- specially inside of the filedesc stream. */
- report_process_error ("writing to process", proc);
- }
+ if (chunklen > 0)
+ {
+ int save_errno;
+
+ /* Lstream_write() will never successfully write less than
+ the amount sent in. In the worst case, it just buffers
+ the unwritten data. */
+ writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf,
+ chunklen);
+ save_errno = errno;
+ EMACS_SIGNAL (SIGPIPE, old_sigpipe);
+ errno = save_errno;
+ if (writeret < 0)
+ /* This is a real error. Blocking errors are handled
+ specially inside of the filedesc stream. */
+ report_file_error ("writing to process", list1 (proc));
+ }
+ else
+ {
+ /* Need to make sure that everything up to and including the
+ last chunk is flushed, even when the pipe is currently
+ blocked. */
+ Lstream_flush (XLSTREAM (DATA_OUTSTREAM(p)));
+ EMACS_SIGNAL (SIGPIPE, old_sigpipe);
+ }
while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream)))
{
/* Buffer is full. Wait, accepting input;
@@ -1549,7 +1557,9 @@
Lstream_flush (XLSTREAM (p->pipe_outstream));
EMACS_SIGNAL (SIGPIPE, old_sigpipe);
}
+ /* Perhaps should ABORT() if < 0? This should never happen. */
}
+ while (chunklen > 0);
}
else
{ /* We got here from a longjmp() from the SIGPIPE handler */
Index: src/process-unix.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v
retrieving revision 1.20.2.8
diff -d -u -r1.20.2.8 process-unix.c
--- src/process-unix.c 2005/01/31 02:55:26 1.20.2.8
+++ src/process-unix.c 2005/02/04 03:31:08
@@ -1293,26 +1293,38 @@
Bufbyte chunkbuf[512];
Bytecount chunklen;
- while (1)
+ do
{
Lstream_data_count writeret;
chunklen = Lstream_read (lstream, chunkbuf, 512);
- if (chunklen <= 0)
- break; /* perhaps should ABORT() if < 0?
- This should never happen. */
old_sigpipe =
(SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap);
- /* Lstream_write() will never successfully write less than
- the amount sent in. In the worst case, it just buffers
- the unwritten data. */
- writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf,
- chunklen);
- signal (SIGPIPE, old_sigpipe);
- if (writeret < 0)
- /* This is a real error. Blocking errors are handled
- specially inside of the filedesc stream. */
- report_file_error ("writing to process", list1 (proc));
+ if (chunklen > 0)
+ {
+ int save_errno;
+
+ /* Lstream_write() will never successfully write less than
+ the amount sent in. In the worst case, it just buffers
+ the unwritten data. */
+ writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf,
+ chunklen);
+ save_errno = errno;
+ signal (SIGPIPE, old_sigpipe);
+ errno = save_errno;
+ if (writeret < 0)
+ /* This is a real error. Blocking errors are handled
+ specially inside of the filedesc stream. */
+ report_file_error ("writing to process", list1 (proc));
+ }
+ else
+ {
+ /* Need to make sure that everything up to and including the
+ last chunk is flushed, even when the pipe is currently
+ blocked. */
+ Lstream_flush (XLSTREAM (DATA_OUTSTREAM(p)));
+ signal (SIGPIPE, old_sigpipe);
+ }
while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream)))
{
/* Buffer is full. Wait, accepting input;
@@ -1327,7 +1339,9 @@
Lstream_flush (XLSTREAM (p->pipe_outstream));
signal (SIGPIPE, old_sigpipe);
}
+ /* Perhaps should abort() if < 0? This should never happen. */
}
+ while (chunklen > 0);
}
else
{ /* We got here from a longjmp() from the SIGPIPE handler */
--
Jerry James
http://www.ittc.ku.edu/~james/
[View Less]
[PATCH] fix MC_ALLOC module support
19 years, 6 months
Marcus Crestani
I'll commit this in the next few days, unless somebody objects.
src/ChangeLog addition:
2005-09-26 Marcus Crestani <crestani(a)xemacs.org>
* symbols.c (check_module_subr): Fix new allocator's module
support: remove duplicating the subr.
xemacs-21.5 source patch:
Diff command: cvs -q diff -u
Files affected: src/symbols.c
Index: src/symbols.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symbols.c,v
retrieving …
[View More]revision 1.50
diff -u -r1.50 symbols.c
--- src/symbols.c 15 May 2005 16:38:14 -0000 1.50
+++ src/symbols.c 26 Sep 2005 06:24:39 -0000
@@ -3474,6 +3474,7 @@
#endif
#ifdef HAVE_SHLIB
+#ifndef MC_ALLOC
/*
* If we are not in a pure undumped Emacs, we need to make a duplicate of
* the subr. This is because the only time this function will be called
@@ -3533,6 +3534,45 @@
subr = newsubr; \
} \
} while (0)
+#else /* MC_ALLOC */
+/*
+ * If we have the new allocator enabled, we do not need to make a
+ * duplicate of the subr. The new allocator already does allocate all
+ * subrs in Lisp-accessible memory rather than have it in the static
+ * subr struct.
+ *
+ * NOTE: The DOC pointer is not set here as described above.
+ */
+#define check_module_subr(subr) \
+do { \
+ if (initialized) { \
+ Lisp_Object f; \
+ \
+ if (subr->min_args < 0) \
+ signal_ferror (Qdll_error, "%s min_args (%hd) too small", \
+ subr_name (subr), subr->min_args); \
+ if (subr->min_args > SUBR_MAX_ARGS) \
+ signal_ferror (Qdll_error, "%s min_args (%hd) too big (max = %d)", \
+ subr_name (subr), subr->min_args, SUBR_MAX_ARGS); \
+ \
+ if (subr->max_args != MANY && \
+ subr->max_args != UNEVALLED) \
+ { \
+ /* Need to fix lisp.h and eval.c if SUBR_MAX_ARGS too small */ \
+ if (subr->max_args > SUBR_MAX_ARGS) \
+ signal_ferror (Qdll_error, "%s max_args (%hd) too big (max = %d)", \
+ subr_name (subr), subr->max_args, SUBR_MAX_ARGS); \
+ if (subr->min_args > subr->max_args) \
+ signal_ferror (Qdll_error, "%s min_args (%hd) > max_args (%hd)", \
+ subr_name (subr), subr->min_args, subr->max_args); \
+ } \
+ \
+ f = XSYMBOL (sym)->function; \
+ if (!UNBOUNDP (f) && (!CONSP (f) || !EQ (XCAR (f), Qautoload))) \
+ signal_ferror (Qdll_error, "Attempt to redefine %s", subr_name (subr)); \
+ } \
+} while (0)
+#endif /* MC_ALLOC */
#else /* ! HAVE_SHLIB */
#define check_module_subr(subr)
#endif
--
Marcus
[View Less]
[C] xemacs-21.5-clean: address stephen's query about my compile.texi fix
19 years, 6 months
Adrian Aichner
COMMIT
Thanks for the review, Stephen.
Adrian
xemacs-21.5-clean ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: man/ChangeLog
Index: man/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/ChangeLog,v
retrieving revision 1.313
diff -u -U0 -r1.313 ChangeLog
--- man/ChangeLog 26 Sep 2005 22:18:59 -0000 1.313
+++ man/ChangeLog 27 Sep 2005 21:42:34 -0000
@@ -2,0 +3,6 @@
+ * lispref/compile.texi (Compilation …
[View More]Options): Lowercase SYMBOL
+ argument in `byte-compile-print-gensym' documentation, as
+ suggested by Stephen.
+
+2005-09-27 Adrian Aichner <adrian(a)xemacs.org>
+
xemacs-21.5-clean source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: man/lispref/compile.texi
Index: man/lispref/compile.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/compile.texi,v
retrieving revision 1.7
diff -u -w -r1.7 compile.texi
--- man/lispref/compile.texi 25 Sep 2005 21:40:19 -0000 1.7
+++ man/lispref/compile.texi 27 Sep 2005 21:38:55 -0000
@@ -503,7 +503,7 @@
@defvar byte-compile-print-gensym
When non-@code{nil}, the compiler may generate code that creates unique
symbols at run-time. This is achieved by printing uninterned symbols
-using the @code{#:@var{SYMBOL}} notation, so that they will be read
+using the @code{#:@var{symbol}} notation, so that they will be read
uninterned when run.
With this feature, code that uses uninterned symbols in macros will
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
[View Less]
[C] xemacs-21.5-clean: Getting texinfmt.el to compile core .texi again
19 years, 6 months
Adrian Aichner
COMMIT
Ben, Stephen, please review this.
These are my final changes to get all of XEmacs/xemacs/man/ .texi
files compile again with my updated texinfmt.el (Thanks, viteno, for
already generating a texinfo pre-release!).
Best regards,
Adrian
xemacs-21.5-clean ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: man/ChangeLog
Index: man/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/ChangeLog,v
…
[View More]retrieving revision 1.312
diff -u -U0 -r1.312 ChangeLog
--- man/ChangeLog 26 Sep 2005 08:41:45 -0000 1.312
+++ man/ChangeLog 26 Sep 2005 22:16:58 -0000
@@ -0,0 +1,20 @@
+2005-09-27 Adrian Aichner <adrian(a)xemacs.org>
+
+ * lispref/packaging.texi: Get file to compile with teinfmt.el.
+ * lispref/packaging.texi (Packaging): Ditto.
+ * lispref/packaging.texi (Package Overview): Ditto.
+ * lispref/packaging.texi (The User View): Ditto.
+ * lispref/packaging.texi (The Library Maintainer View): Ditto.
+ * lispref/packaging.texi (Infrastructure): Ditto.
+ * lispref/packaging.texi (Obtaining): Ditto.
+ * lispref/packaging.texi (Local.rules File): Ditto.
+ * lispref/packaging.texi (package-info.in): Ditto.
+ * lispref/packaging.texi (Makefile): Ditto.
+ * lispref/packaging.texi (Documenting Packages): Ditto.
+
+2005-09-27 Adrian Aichner <adrian(a)xemacs.org>
+
+ * internals/internals.texi (A Summary of the Various XEmacs
+ Modules): Get file to compile with texinfmt.el.
+ * internals/internals.texi (Windows Build Flags): Ditto.
+
xemacs-21.5-clean source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: man/lispref/packaging.texi man/internals/internals.texi
Index: man/internals/internals.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/internals/internals.texi,v
retrieving revision 1.67
diff -u -w -r1.67 internals.texi
--- man/internals/internals.texi 26 Jun 2005 18:04:56 -0000 1.67
+++ man/internals/internals.texi 26 Sep 2005 22:04:40 -0000
@@ -2774,7 +2774,8 @@
The following table contains cross-references from each module in XEmacs
21.5 to the section (if any) describing it.
-@multitable {(a)file{intl-auto-encap-win32.c}} {@ref{Modules for Other Aspects of the Lisp Interpreter and Object System}}
+@multitable @columnfractions .25 .75
+@item @file{intl-auto-encap-win32.c} @tab @ref{Modules for Other Aspects of the Lisp Interpreter and Object System}.
@item @file{Emacs.ad.h} @tab @ref{Modules for Interfacing with X Windows}.
@item @file{EmacsFrame.c} @tab @ref{Modules for Interfacing with X Windows}.
@item @file{EmacsFrame.h} @tab @ref{Modules for Interfacing with X Windows}.
@@ -17504,7 +17505,7 @@
@c @multitable {Old Constant} {determine whether this code is really specific to MS-DOS (and not Windows -- e.g. DJGPP code}
@multitable @columnfractions .25 .75
@item Old Constant @tab New Constant
-@item ----------------------------------------------------------------
+@item ---------------------------------------------------------------- @tab
@item @code{WINDOWSNT}
@tab @code{WIN32_NATIVE}
@item @code{WIN32}
Index: man/lispref/packaging.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/packaging.texi,v
retrieving revision 1.11
diff -u -w -r1.11 packaging.texi
--- man/lispref/packaging.texi 10 Oct 2003 12:39:34 -0000 1.11
+++ man/lispref/packaging.texi 26 Sep 2005 22:05:03 -0000
@@ -8,18 +8,14 @@
@c Macro to make formatting of the XEmacs pms name consistent.
@c Maybe @sc looks OK in HTML? If so, condition on Info.
@iftex
-@macro xpms
-XE@sc{macs} Packaging System
-@end macro
+@set xpms XE@sc{macs} Packaging System
@end iftex
@ifnottex
-@macro xpms
-XEmacs Packaging System
-@end macro
+@set xpms XEmacs Packaging System
@end ifnottex
@node Packaging, Lisp Data Types, Introduction, Top
-@chapter The @xpms{}
+@chapter The @value{xpms}
@cindex package
@cindex packaging
@@ -32,7 +28,7 @@
installation for local needs with safe removal of unnecessary code.
This chapter describes how to package Lisp libraries for use with the
-@xpms{}.
+@value{xpms}.
@emph{Please note carefully} that the term @dfn{package} as used in
XEmacs refers to an aggregation of Lisp code and/or data distributed as
@@ -50,13 +46,13 @@
* Package Terminology:: Basic stuff.
* Building Packages:: Turn packaged source into a tarball.
* Makefile Targets:: Package @file{Makefile} targets
-* Local.rules File:: Tell the @xpms{} about your host.
-* Creating Packages:: Tell the @xpms{} about your package.
+* Local.rules File:: Tell the @value{xpms} about your host.
+* Creating Packages:: Tell the @value{xpms} about your package.
* Documenting Packages:: Explain your package to users and hackers.
-@c * History:: History of the @xpms{}
-@c * Installation:: Installing the @xpms{} with your (X)Emacs.
-@c * Configuration:: Configuring the @xpms{} for use.
-@c * Usage:: An overview of the operation of the @xpms{}.
+@c * History:: History of the @value{xpms}
+@c * Installation:: Installing the @value{xpms} with your (X)Emacs.
+@c * Configuration:: Configuring the @value{xpms} for use.
+@c * Usage:: An overview of the operation of the @value{xpms}.
@c * Bug Reports:: Reporting Bugs and Problems
@c * Frequently Asked Questions:: Questions and answers from the mailing list.
@@ -65,9 +61,9 @@
@end menu
@node Package Overview, Package Terminology, , Packaging
-@chapter An overview of the @xpms{}
+@chapter An overview of the @value{xpms}
-The @xpms{} is a system for administering the installation, upgrade, and
+The @value{xpms} is a system for administering the installation, upgrade, and
removal of Lisp libraries. For the end user, it provides facilities for
determining availability of packages and which versions at remote
sites. It will download and automatically install a package, ensuring
@@ -92,10 +88,10 @@
Meeting these requirements, as well as simply providing the
auto-autoloads and the information about availability and so on does
-impose some costs on the library maintainer. The @xpms{} also provides
+impose some costs on the library maintainer. The @value{xpms} also provides
structure and utilities to the library maintainer to make these tasks
easier. This manual documents the requirements and the tools that the
-@xpms{} provides to ensure that a package satisfies them.
+@value{xpms} provides to ensure that a package satisfies them.
@menu
* The User View::
@@ -122,7 +118,7 @@
is basically an image of a classic Emacs ``run-in-place'' tree, with
@file{lisp}, @file{etc}, @file{info}, @file{man}, @file{lib-src}, and
@file{pkginfo} subdirectories of the top. The @file{pkginfo}
-subdirectory is for use by the @xpms{} administration tools, and
+subdirectory is for use by the @value{xpms} administration tools, and
currently contains a @file{MANIFEST.@var{package-name}} file for each
package to ensure that no cruft remains when a package is removed or
updated. The @file{lisp}, @file{etc}, and @file{lib-src} subdirectories
@@ -242,7 +238,7 @@
@node The Library Maintainer View, The Package Release Engineer View, The User View, Package Overview
@section The Library Maintainer View
-From the library maintainer's viewpoint, the advantages to the @xpms{}
+From the library maintainer's viewpoint, the advantages to the @value{xpms}
stem from the convenience to the user of installation and upgrade.
Since an installed package automatically registers its entry points via
autoload and its configuration variables with the Customize system,
@@ -252,14 +248,14 @@
This comes at some cost, as the library maintainer needs to arrange that
the package be installed in a directory structure that satisfies the
-requirements of the @xpms{}. Autoload cookies and defcustoms must also
-be added to existing libraries. The @xpms{} provides infrastructure to
+requirements of the @value{xpms}. Autoload cookies and defcustoms must also
+be added to existing libraries. The @value{xpms} provides infrastructure to
assure that all of these annoyances need only be dealt with once. The
autoload cookies and defcustoms are beyond the scope of this chapter, but
most maintainers of modern packages are already familiar with these
mechanisms.
-The @xpms{} may be divided into the @dfn{infrastructure} common to all
+The @value{xpms} may be divided into the @dfn{infrastructure} common to all
packages, and the package-specific @dfn{control files}. The
infrastructure supports global builds, installation, and generation of
the ``sumo'' bundles of packages, as well as generation of individual
@@ -269,13 +265,13 @@
@menu
* Infrastructure:: Global Makefiles and common rules.
* Control Files:: Package-specific Makefiles and administrative files.
-* Obtaining:: Obtaining the @xpms{} and required utilities.
+* Obtaining:: Obtaining the @value{xpms} and required utilities.
@end menu
@node Infrastructure, Control Files, , The Library Maintainer View
@subsection Infrastructure
-In order to get the greatest benefit from the @xpms{}, a library
+In order to get the greatest benefit from the @value{xpms}, a library
maintainer should place the package sources in an appropriate place in
the XEmacs source package hierarchy, and arrange to have the source
package imported into the XEmacs CVS repository.
@@ -412,14 +408,14 @@
@node Obtaining, , Control Files, The Library Maintainer View
-@subsection Obtaining the @xpms{} and Required Utilities
+@subsection Obtaining the @value{xpms} and Required Utilities
Currently both the infrastructure for creating XEmacs packages and the
package sources themselves are available only by CVS. See
@uref{http://www.xemacs.org/Develop/cvsaccess.html} for more
intformation.
-The @xpms{} currently requires GNU @file{make}, and XEmacs, to build
+The @value{xpms} currently requires GNU @file{make}, and XEmacs, to build
packages.
@@ -617,7 +613,7 @@
@comment node-name, next, previous, up
@cindex local.rules
@heading The Local.rules File:
-This file in @file{packages} provides the @xpms{} with information about
+This file in @file{packages} provides the @value{xpms} with information about
the local configuration and environment. To create @file{Local.rules},
simply copy @file{Local.rules.template} from that directory to
@file{Local.rules} and edit it to suit your needs.
@@ -905,7 +901,7 @@
packages. The is also provision for @samp{unsupported} in this field
which would be for packages that XEmacs.org do not distribute.
-(a)strong{N.B.} As yet, the @xpms{} does @emph{not} support this type of
+(a)strong{N.B.} As yet, the @value{xpms} does @emph{not} support this type of
package. It will in the future.
@item dump
@@ -983,7 +979,7 @@
some cases the @samp{PRELOADS} (autoloads used in libraries mentioned
in @samp{PRELOADS}).
-There isn't much to an @xpms{} @file{Makefile}, basically it just
+There isn't much to an @value{xpms} @file{Makefile}, basically it just
contains a few @file{Makefile} variables and that's it. See the
example.
@@ -1040,11 +1036,11 @@
for.
@subheading @file{Makefile} Variables Explained:
-A number of @file{make} variables are defined by the @xpms{}. Some are
+A number of @file{make} variables are defined by the @value{xpms}. Some are
required, others are optional. Of course your @file{Makefile} may
define other variables for private use, but you should be careful not to
choose names that conflict with variables defined and used by the
-@xpms{}.
+@value{xpms}.
The required variables are described in the table below.
The corresponding field names for @file{package-info.in}, where
@@ -1280,7 +1276,7 @@
@section @file{package-compile.el}
@cindex package-compile.el
@cindex compiling packages
-The @xpms{} does not automatically become aware of your package simply
+The @value{xpms} does not automatically become aware of your package simply
because there is a new subtree. If any package, including your own,
requires any of your files, it must be explicitly added to the compile
environment or loads/requires that search load-path will fail. The
@@ -1288,7 +1284,7 @@
@table @strong
@item an entry in @code{package-directory-map}
-This tells the @xpms{} which distribution (currently
+This tells the @value{xpms} which distribution (currently
@samp{xemacs-packages} or @samp{mule-packages}) your package is found
in. It then looks in the distribution subdirectory whose name is the
same as the package's.
@@ -1300,13 +1296,13 @@
@end table
This only needs to be done once, when the package is first added to the
-@xpms{}. (Well, when you randomly change the subdirectory layout, too.)
+@value{xpms}. (Well, when you randomly change the subdirectory layout, too.)
Your changes to @file{package-compile.el} must be cleared and checked in
by the XEmacs Package Release Engineer before your package will build
correctly from a fresh checkout.
This is unfortunate; it works pretty well once set up, but can cause
-confusion when first building a package in the @xpms{} context. In
+confusion when first building a package in the @value{xpms} context. In
particular, if the @code{package-directory-map} entry for a required
package, including the package itself, is not found, the necessary
requires will not be executed by @file{package-compile.el}. If
@@ -1333,7 +1329,7 @@
Do write a Texinfo file. It's not that hard to do basically, and even
using the more advanced features of Texinfo soon become natural. For a
start, just grab the template @file{Samples/package.texi} from the
-@xpms{} source tree, and drop your current README into the Top node. At
+@value{xpms} source tree, and drop your current README into the Top node. At
least this way your documentation will be accessible from the standard
Info readers. Next, try to add lots of cross-referencing and logical
markup, and then node structure.
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
[View Less]
Xft branch - code cut error in font.el
19 years, 6 months
Clemens Fruhwirth
There is a small error in font.el of the Xft branch leading to a
malfunctioning font-default-font-for-device.
Have a look at
http://cvs.xemacs.org/viewcvs.cgi/XEmacs/xemacs/lisp/font.el.diff?r1=1.16...
Obviously the else path has not been removed when the if statement for
font-running-xemacs was removed.
The "patch" below removes the remains.
Stephen: The patch from Daniel Pittman
http://list-archive.xemacs.org/xemacs-patches/200507/msg00058.html
gives a nice speed gain. He hasn't …
[View More]merged the patch himself yet. Would
you like to do that, while you're at the code? :)
Thanks for your work!
--- lisp/font.el 2005-09-07 13:41:16.000000000 +0200
+++ lisp/font.el 2005-09-07 13:41:19.000000000 +0200
@@ -637,11 +637,7 @@
(or device (setq device (selected-device)))
(font-truename
(make-font-specifier
- (face-font-name 'default device)))
- (let ((font (cdr-safe (assq 'font (frame-parameters device)))))
- (if (and (fboundp 'fontsetp) (fontsetp font))
- (aref (get-font-info (aref (cdr (get-fontset-info font)) 0)) 2)
- font)))
+ (face-font-name 'default device))))
;;;###autoload
(defun font-default-object-for-device (&optional device)
[View Less]
[sjt-xft] Give USE_XFT_MENUBARS priroty over USE_MOTIF
19 years, 6 months
Olivier Galibert
Otherwise this:
Using Lucid menubars.
- Using Xft to render antialiased fonts in menubars.
WARNING: This feature will be replaced with a face.
Using Lucid scrollbars.
Using Motif dialog boxes.
Using Motif native widgets.
- Using Xft to render antialiased fonts in tab controls.
WARNING: This feature will be replaced with a face.
- Using Xft to render antialiased fonts in progress bars.
WARNING: This feature will be replaced with a face.
WARNING: This …
[View More]feature not yet implemented; setting ignored.
blows in xlwmenu.c. I felt undefining USE_MOTIF potentially dangerous
long-term (side effects on structs in includes), so I used the
"&& !defined(xft)" way instead.
OG.
2005-09-26 Olivier Galibert <galibert(a)xemacs.org>
* xlwmenu.c:
* xlwmenuP.h:
Give USE_XFT_MENUBARS priority over USE_MOTIF.
[View Less]
[COMMIT] [21.4] Fix bugs in nt.c, sysdep.c
19 years, 6 months
Ben Wing
NOTE: This patch has been committed.
src/ChangeLog addition:
2005-09-27 Ben Wing <ben(a)xemacs.org>
* sysdep.c (emacs_set_tty):
* sysdep.c (qxe_link):
* sysdep.c (qxe_rename):
* sysdep.c (dup2):
Fix bit-rotted dup2 code. Also new -> new_.
* nt.c:
* nt.c (mswindows_closedir):
* nt.c (mswindows_link):
Fix possible use of uninitialized var. Also new -> new_.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/…
[View More]nt.c src/sysdep.c
Tue Sep 27 00:30:33 CDT 2005
Index: src/sysdep.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v
retrieving revision 1.82
diff -u -p -r1.82 sysdep.c
--- src/sysdep.c 2005/06/26 18:05:05 1.82
+++ src/sysdep.c 2005/09/27 05:30:57
@@ -1458,19 +1458,19 @@ emacs_set_tty (int fd, struct emacs_tty
}
else
{
- struct termios new;
+ struct termios new_;
/* Get the current settings, and see if they're what we asked for. */
- tcgetattr (fd, &new);
+ tcgetattr (fd, &new_);
/* We cannot use memcmp on the whole structure here because under
* aix386 the termios structure has some reserved field that may
* not be filled in.
*/
- if ( new.c_iflag == settings->main.c_iflag
- && new.c_oflag == settings->main.c_oflag
- && new.c_cflag == settings->main.c_cflag
- && new.c_lflag == settings->main.c_lflag
- && memcmp(new.c_cc, settings->main.c_cc, NCCS) == 0)
+ if ( new_.c_iflag == settings->main.c_iflag
+ && new_.c_oflag == settings->main.c_oflag
+ && new_.c_cflag == settings->main.c_cflag
+ && new_.c_lflag == settings->main.c_lflag
+ && memcmp(new_.c_cc, settings->main.c_cc, NCCS) == 0)
break;
else
continue;
@@ -3293,28 +3293,28 @@ qxe_chmod (const Ibyte *path, mode_t mod
#if defined (HAVE_LINK)
int
-qxe_link (const Ibyte *existing, const Ibyte *new)
+qxe_link (const Ibyte *existing, const Ibyte *new_)
{
#ifdef WIN32_NATIVE
- return mswindows_link (existing, new);
+ return mswindows_link (existing, new_);
#else /* not WIN32_NATIVE */
Extbyte *existingout, *newout;
PATHNAME_CONVERT_OUT (existing, existingout);
- PATHNAME_CONVERT_OUT (new, newout);
+ PATHNAME_CONVERT_OUT (new_, newout);
return link (existingout, newout);
#endif /* WIN32_NATIVE */
}
#endif /* defined (HAVE_LINK) */
int
-qxe_rename (const Ibyte *old, const Ibyte *new)
+qxe_rename (const Ibyte *old, const Ibyte *new_)
{
#ifdef WIN32_NATIVE
- return mswindows_rename (old, new);
+ return mswindows_rename (old, new_);
#else /* not WIN32_NATIVE */
Extbyte *oldout, *newout;
PATHNAME_CONVERT_OUT (old, oldout);
- PATHNAME_CONVERT_OUT (new, newout);
+ PATHNAME_CONVERT_OUT (new_, newout);
return rename (oldout, newout);
#endif /* WIN32_NATIVE */
}
@@ -3594,12 +3594,12 @@ dup2 (int oldd, int newd)
signal_ferror_with_frob (Qfile_error, lisp_strerror (errno),
"can't dup2 (%i, %i)", oldd, newd);
#else
- fd = dup (old);
+ fd = dup (oldd);
if (fd == -1)
return -1;
- if (fd == new)
- return new;
- ret = dup2 (old, new);
+ if (fd == newd)
+ return newd;
+ ret = dup2 (oldd, newd);
retry_close (fd);
return ret;
#endif /* F_DUPFD */
Index: src/nt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/nt.c,v
retrieving revision 1.46
diff -u -p -r1.46 nt.c
--- src/nt.c 2005/01/28 02:36:25 1.46
+++ src/nt.c 2005/09/27 05:30:59
@@ -1,6 +1,6 @@
/* Utility and Unix shadow routines under MS Windows (WIN32_NATIVE defined).
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
- Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -834,7 +834,7 @@ mswindows_opendir (const Ibyte *filename
int
mswindows_closedir (DIR *dirp)
{
- int retval;
+ int retval = -1;
/* If we have a find-handle open, close it. */
if (dir_find_handle != INVALID_HANDLE_VALUE)
@@ -1081,13 +1081,13 @@ mswindows_access (const Ibyte *path, int
/* #### NT 5.0 has a function CreateHardLink to do this directly,
and it may do more things. */
int
-mswindows_link (const Ibyte *old, const Ibyte *new)
+mswindows_link (const Ibyte *old, const Ibyte *new_)
{
HANDLE fileh;
int result = -1;
Extbyte *oldext;
- if (old == NULL || new == NULL)
+ if (old == NULL || new_ == NULL)
{
errno = ENOENT;
return -1;
@@ -1114,7 +1114,7 @@ mswindows_link (const Ibyte *old, const
WCHAR wbuffer[_MAX_PATH]; /* extra space for link name */
} data;
- TO_EXTERNAL_FORMAT (C_STRING, new,
+ TO_EXTERNAL_FORMAT (C_STRING, new_,
ALLOCA, (newuni, wlen), Qmswindows_unicode);
if (wlen / sizeof (WCHAR) < _MAX_PATH)
{
[View Less]