[21.5] Rename Lstream_pseudo_close to Lstream_flush_safely
12 years, 11 months
Stephen J. Turnbull
21.5
Will commit after a couple days if no objections.
The name "Lstream_pseudo_close" has annoyed me for a decade (it's
nothing of the kind), and it's time to swat this gnat. :-) It's a
static function, called in two places (and one of those is `#if 0'ed
out:-), so it shouldn't bother anything but somebody's sense of
aesthetics.
diff -r 2dbefd79b3d3 -r 52de3c8a7f41 src/ChangeLog
--- a/src/ChangeLog Sat Oct 29 01:10:32 2011 +0900
+++ b/src/ChangeLog Sat Oct 29 01:39:55 2011 +0900
@@ -1,3 +1,8 @@
+2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * lstream.c (Lstream_flush_safely): Renamed from Lstream_pseudo_close.
+ (disksave_lstream, Lstream_close): Fix calls.
+
2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
Prevent SIGPIPEs in deactivate_process().
diff -r 2dbefd79b3d3 -r 52de3c8a7f41 src/lstream.c
--- a/src/lstream.c Sat Oct 29 01:10:32 2011 +0900
+++ b/src/lstream.c Sat Oct 29 01:39:55 2011 +0900
@@ -86,7 +86,7 @@
Lstream *lstr = XLSTREAM (lstream);
#if 0 /* this may cause weird Broken Pipes? */
- Lstream_pseudo_close (lstr);
+ Lstream_flush_safely (lstr);
return;
#endif
if ((lstr->flags & LSTREAM_FL_IS_OPEN) &&
@@ -782,7 +782,7 @@
}
static int
-Lstream_pseudo_close (Lstream *lstr)
+Lstream_flush_safely (Lstream *lstr)
{
if (! (lstr->flags & LSTREAM_FL_IS_OPEN))
Lstream_internal_error ("lstream is not open", lstr);
@@ -844,7 +844,7 @@
if (lstr->flags & LSTREAM_FL_IS_OPEN)
{
- rc = Lstream_pseudo_close (lstr);
+ rc = Lstream_flush_safely (lstr);
/*
* We used to return immediately if the closer method reported
* failure, leaving the stream open. But this is no good, for
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: stephen_at_xemacs: Prevent SIGPIPEs in deactivate_process().
12 years, 11 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/2dbefd79b3d3/
changeset: 2dbefd79b3d3
user: stephen_at_xemacs
date: 2011-10-28 18:10:32
summary: Prevent SIGPIPEs in deactivate_process().
* process.c (deactivate_process):
Use Lstream_close_noflush on output pipe instead of Lstream_close.
* lstream.c (Lstream_close_noflush):
New. Factored out of Lstream_close.
(Lstream_close): Use Lstream_close_noflush.
* lstream.h (Lstream_close_noflush): Declare it.
affected #: 4 files
diff -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f -r 2dbefd79b3d3713ac08021ff1a8ce6efd034d607 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
+2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Prevent SIGPIPEs in deactivate_process().
+
+ * process.c (deactivate_process):
+ Use Lstream_close_noflush on output pipe instead of Lstream_close.
+
+ * lstream.c (Lstream_close_noflush):
+ New. Factored out of Lstream_close.
+ (Lstream_close): Use Lstream_close_noflush.
+
+ * lstream.h (Lstream_close_noflush): Declare it.
+
2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
diff -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f -r 2dbefd79b3d3713ac08021ff1a8ce6efd034d607 src/lstream.c
--- a/src/lstream.c
+++ b/src/lstream.c
@@ -791,6 +791,45 @@
return Lstream_flush (lstr);
}
+/* Close the stream without flushing buffers.
+ In current practice, this is only useful when a subprocess terminates
+ unexpectedly, and the OS closes its pipes without warning. In that case,
+ we do not want to flush our output buffers, as there is no longer a pipe
+ to write to.
+ This nomenclature may deserve review if XEmacs starts getting called as
+ a subprocess. */
+
+int
+Lstream_close_noflush (Lstream *lstr)
+{
+ lstr->flags &= ~LSTREAM_FL_IS_OPEN;
+ lstr->byte_count = 0;
+ /* Note that Lstream_flush() reset all the buffer indices. That way,
+ the next call to Lstream_putc(), Lstream_getc(), or Lstream_ungetc()
+ on a closed stream will call into the function equivalents, which will
+ cause an error. */
+
+ /* We set the pointers to 0 so that we don't lose when this function
+ is called more than once on the same object */
+ if (lstr->out_buffer)
+ {
+ xfree (lstr->out_buffer);
+ lstr->out_buffer = 0;
+ }
+ if (lstr->in_buffer)
+ {
+ xfree (lstr->in_buffer);
+ lstr->in_buffer = 0;
+ }
+ if (lstr->unget_buffer)
+ {
+ xfree (lstr->unget_buffer);
+ lstr->unget_buffer = 0;
+ }
+
+ return 0;
+}
+
/* Close the stream. All data will be flushed out. If the stream is
already closed, nothing happens. Note that, even if all data has
already been flushed out, the act of closing a stream may generate more
@@ -838,30 +877,7 @@
rc = -1;
}
- lstr->flags &= ~LSTREAM_FL_IS_OPEN;
- lstr->byte_count = 0;
- /* Note that Lstream_flush() reset all the buffer indices. That way,
- the next call to Lstream_putc(), Lstream_getc(), or Lstream_ungetc()
- on a closed stream will call into the function equivalents, which will
- cause an error. */
-
- /* We set the pointers to 0 so that we don't lose when this function
- is called more than once on the same object */
- if (lstr->out_buffer)
- {
- xfree (lstr->out_buffer);
- lstr->out_buffer = 0;
- }
- if (lstr->in_buffer)
- {
- xfree (lstr->in_buffer);
- lstr->in_buffer = 0;
- }
- if (lstr->unget_buffer)
- {
- xfree (lstr->unget_buffer);
- lstr->unget_buffer = 0;
- }
+ Lstream_close_noflush (lstr);
return rc;
}
diff -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f -r 2dbefd79b3d3713ac08021ff1a8ce6efd034d607 src/lstream.h
--- a/src/lstream.h
+++ b/src/lstream.h
@@ -306,6 +306,7 @@
int Lstream_rewind (Lstream *lstr);
int Lstream_seekable_p (Lstream *lstr);
int Lstream_close (Lstream *lstr);
+int Lstream_close_noflush (Lstream *lstr);
void Lstream_delete (Lstream *lstr);
void Lstream_set_character_mode (Lstream *str);
diff -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f -r 2dbefd79b3d3713ac08021ff1a8ce6efd034d607 src/process.c
--- a/src/process.c
+++ b/src/process.c
@@ -2150,8 +2150,20 @@
/* Must call this before setting the streams to nil */
event_stream_unselect_process (p, 1, 1);
+ /* We can get here in case of a crash in the external process, and then
+ the Lstream_close on output will cause a SIGPIPE, which we're not ready
+ for here. It looks to me like all cases where this function is called
+ we know the process has exited (but I'm not 100% sure for the call in
+ execute_internal_event (event-stream.c)), so it should be OK to use
+ Lstream_close_noflush.
+
+ #### The layering here needs a rethink. We should just be able
+ to call Lstream_close, and let the Lstream's implementation decide
+ if it can flush safely or not. The immediate problem is that the
+ Lstream needs to know the process's status, but I don't think it has
+ a handle to the process. */
if (!NILP (DATA_OUTSTREAM (p)))
- Lstream_close (XLSTREAM (DATA_OUTSTREAM (p)));
+ Lstream_close_noflush (XLSTREAM (DATA_OUTSTREAM (p)));
if (!NILP (DATA_INSTREAM (p)))
Lstream_close (XLSTREAM (DATA_INSTREAM (p)));
if (!NILP (DATA_ERRSTREAM (p)))
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: stephen_at_xemacs: Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
12 years, 11 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/3fde0e346ad7/
changeset: 3fde0e346ad7
user: stephen_at_xemacs
date: 2011-10-28 17:35:33
summary: Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
* frame.c (Fmake_frame): Ensure that reset_glyph_cachels gets called.
(setup_minibuffer_frame): Improve header comment.
* redisplay.c (redisplay_window): Update comment.
Remove code checking for uninitialized face_cachels and glyph_cachels.
Can't happen in theory, and guarded by asserts in practice.
* window.c (allocate_window): Update comment on reset_*_cachels.
affected #: 4 files
diff -r d8a11d5ebc9fd44f07ba43e58876aaf83122264d -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
+2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
+
+ * frame.c (Fmake_frame): Ensure that reset_glyph_cachels gets called.
+ (setup_minibuffer_frame): Improve header comment.
+
+ * redisplay.c (redisplay_window): Update comment.
+ Remove code checking for uninitialized face_cachels and glyph_cachels.
+ Can't happen in theory, and guarded by asserts in practice.
+
+ * window.c (allocate_window): Update comment on reset_*_cachels.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (remassoc_no_quit):
diff -r d8a11d5ebc9fd44f07ba43e58876aaf83122264d -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f src/frame.c
--- a/src/frame.c
+++ b/src/frame.c
@@ -793,7 +793,8 @@
f->minibuffer_window = Qnil;
}
-/* Make a frame containing only a minibuffer window. */
+/* Make a frame containing only a minibuffer window.
+ The minibuffer window is also the root window. */
static void
setup_minibuffer_frame (struct frame *f)
@@ -957,8 +958,12 @@
if (initialized && !DEVICE_STREAM_P (d))
{
if (!NILP (f->minibuffer_window))
- reset_face_cachels (XWINDOW (f->minibuffer_window));
+ {
+ reset_face_cachels (XWINDOW (f->minibuffer_window));
+ reset_glyph_cachels (XWINDOW (f->minibuffer_window));
+ }
reset_face_cachels (XWINDOW (f->root_window));
+ reset_glyph_cachels (XWINDOW (f->root_window));
}
/* If no frames on this device formerly existed, say this is the
diff -r d8a11d5ebc9fd44f07ba43e58876aaf83122264d -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f src/redisplay.c
--- a/src/redisplay.c
+++ b/src/redisplay.c
@@ -6306,18 +6306,19 @@
because we initialized them at startup and the only way to reduce
their number is through calling reset_face_cachels() or
reset_glyph_cachels(), which as a side effect sets up a number of
- standard entries */
+ standard entries
+ 2011-10-29 -- We were managing to hit the glyph_cachels assert in certain
+ contexts where VM was creating a lot of frames. I don't have a full
+ analysis, but I suspect that we were failing to setup the glyph_cachels
+ at about l. 961 of frame.c, and a message was being sent to the echo area
+ before the initialization was complete. This triggered a redisplay of
+ the minibuffer window (this part is confirmed), and thus this assert. */
assert (Dynarr_length (w->face_cachels));
assert (Dynarr_length (w->glyph_cachels));
/* If the buffer has changed we have to invalidate all of our face
cache elements. */
if ((!echo_active && b != window_display_buffer (w))
-#if 0
- /* #### Delete this code sometime later than 2-1-10 when we're sure it's
- not needed */
- || !Dynarr_length (w->face_cachels)
-#endif
|| f->faces_changed)
reset_face_cachels (w);
else
@@ -6327,11 +6328,6 @@
the cache purely because glyphs have changed - this is now
handled by the dirty flag.*/
if ((!echo_active && b != window_display_buffer (w))
-#if 0
- /* #### Delete this code sometime later than 2-1-10 when we're sure it's
- not needed */
- || !Dynarr_length (w->glyph_cachels)
-#endif
|| f->faces_changed)
reset_glyph_cachels (w);
else
diff -r d8a11d5ebc9fd44f07ba43e58876aaf83122264d -r 3fde0e346ad710f69d233e5bc8d47defef4ea53f src/window.c
--- a/src/window.c
+++ b/src/window.c
@@ -383,7 +383,10 @@
All callers of allocate_window should therefore call
reset_face_cachels on the created window. We can't do it
here because the window must have its frame pointer set or
- reset_face_cachels will fail. */
+ reset_face_cachels will fail.
+ A similar requirement holds for reset_glyph_cachels. We *could* do
+ that here (there's no reference to the frame pointer in that function),
+ but we may as well have the same discipline. */
Lisp_Object
allocate_window (void)
{
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[AC21.5] Avoid assert (l.6311 frame.c) from uninitialized glyph_cachels
12 years, 11 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
I don't think this patch is relevant to 21.4, and it certainly won't
apply. Let me know if you want me to check more carefully, Vin.
This patch fixes the assert described above by initializing (struct
window).glyph_cachels everywhere (struct window).face_cachels is
initialized. I believe that the assert was triggered by a redisplay
caused by attempting to write to the echo area in the process of frame
creation. I'm not sure how that can happen (the context where I
observed it is a rapid series of make-frames by VM in creating a
virtual folder with lots of source folders, which also triggered a
suicide-by-SIGPIPE!), but I'm pretty sure that it was not possible to
exist Fmake_frame() with the glyph_cachels before this patch.
Nevertheless, the patch helps. :-/
I also removed some unneeded code and improved comments related to
initialization of glyph_cachels.
diff -r d8a11d5ebc9f -r 3fde0e346ad7 src/ChangeLog
--- a/src/ChangeLog Fri Oct 28 23:52:26 2011 +0900
+++ b/src/ChangeLog Sat Oct 29 00:35:33 2011 +0900
@@ -1,3 +1,16 @@
+2011-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Prevent assert at frame.c, l. 6311 by initializing glyph cachels.
+
+ * frame.c (Fmake_frame): Ensure that reset_glyph_cachels gets called.
+ (setup_minibuffer_frame): Improve header comment.
+
+ * redisplay.c (redisplay_window): Update comment.
+ Remove code checking for uninitialized face_cachels and glyph_cachels.
+ Can't happen in theory, and guarded by asserts in practice.
+
+ * window.c (allocate_window): Update comment on reset_*_cachels.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (remassoc_no_quit):
diff -r d8a11d5ebc9f -r 3fde0e346ad7 src/frame.c
--- a/src/frame.c Fri Oct 28 23:52:26 2011 +0900
+++ b/src/frame.c Sat Oct 29 00:35:33 2011 +0900
@@ -793,7 +793,8 @@
f->minibuffer_window = Qnil;
}
-/* Make a frame containing only a minibuffer window. */
+/* Make a frame containing only a minibuffer window.
+ The minibuffer window is also the root window. */
static void
setup_minibuffer_frame (struct frame *f)
@@ -957,8 +958,12 @@
if (initialized && !DEVICE_STREAM_P (d))
{
if (!NILP (f->minibuffer_window))
- reset_face_cachels (XWINDOW (f->minibuffer_window));
+ {
+ reset_face_cachels (XWINDOW (f->minibuffer_window));
+ reset_glyph_cachels (XWINDOW (f->minibuffer_window));
+ }
reset_face_cachels (XWINDOW (f->root_window));
+ reset_glyph_cachels (XWINDOW (f->root_window));
}
/* If no frames on this device formerly existed, say this is the
diff -r d8a11d5ebc9f -r 3fde0e346ad7 src/redisplay.c
--- a/src/redisplay.c Fri Oct 28 23:52:26 2011 +0900
+++ b/src/redisplay.c Sat Oct 29 00:35:33 2011 +0900
@@ -6306,18 +6306,19 @@
because we initialized them at startup and the only way to reduce
their number is through calling reset_face_cachels() or
reset_glyph_cachels(), which as a side effect sets up a number of
- standard entries */
+ standard entries
+ 2011-10-29 -- We were managing to hit the glyph_cachels assert in certain
+ contexts where VM was creating a lot of frames. I don't have a full
+ analysis, but I suspect that we were failing to setup the glyph_cachels
+ at about l. 961 of frame.c, and a message was being sent to the echo area
+ before the initialization was complete. This triggered a redisplay of
+ the minibuffer window (this part is confirmed), and thus this assert. */
assert (Dynarr_length (w->face_cachels));
assert (Dynarr_length (w->glyph_cachels));
/* If the buffer has changed we have to invalidate all of our face
cache elements. */
if ((!echo_active && b != window_display_buffer (w))
-#if 0
- /* #### Delete this code sometime later than 2-1-10 when we're sure it's
- not needed */
- || !Dynarr_length (w->face_cachels)
-#endif
|| f->faces_changed)
reset_face_cachels (w);
else
@@ -6327,11 +6328,6 @@
the cache purely because glyphs have changed - this is now
handled by the dirty flag.*/
if ((!echo_active && b != window_display_buffer (w))
-#if 0
- /* #### Delete this code sometime later than 2-1-10 when we're sure it's
- not needed */
- || !Dynarr_length (w->glyph_cachels)
-#endif
|| f->faces_changed)
reset_glyph_cachels (w);
else
diff -r d8a11d5ebc9f -r 3fde0e346ad7 src/window.c
--- a/src/window.c Fri Oct 28 23:52:26 2011 +0900
+++ b/src/window.c Sat Oct 29 00:35:33 2011 +0900
@@ -383,7 +383,10 @@
All callers of allocate_window should therefore call
reset_face_cachels on the created window. We can't do it
here because the window must have its frame pointer set or
- reset_face_cachels will fail. */
+ reset_face_cachels will fail.
+ A similar requirement holds for reset_glyph_cachels. We *could* do
+ that here (there's no reference to the frame pointer in that function),
+ but we may as well have the same discipline. */
Lisp_Object
allocate_window (void)
{
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: 2 new changesets
12 years, 11 months
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/86d6adeb1cf4/
changeset: 86d6adeb1cf4
user: stephen_at_xemacs
date: 2011-10-13 20:54:46
summary: Refactor check for Xaw3d.
affected #: 2 files
diff -r 6c76f5b7e2e3e77d6a7c4a21507032a2adae439e -r 86d6adeb1cf4bcba2289618f1a187d791f08f07a ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.ac (with_athena): Refactor check for Xaw3d.
+
2011-09-05 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac: $machine is intel386, reflecting the file name
diff -r 6c76f5b7e2e3e77d6a7c4a21507032a2adae439e -r 86d6adeb1cf4bcba2289618f1a187d791f08f07a configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -3895,22 +3895,24 @@
*) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
esac
+ athena_3d_function=Xaw3dComputeBottomShadowRGB
+
dnl Search for the Athena library...
if test "$athena_3d" = "no"; then
AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
[
dnl Must not be a 3d library...
- AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB,
+ AC_CHECK_LIB($athena_variant, $athena_3d_function,
[AC_MSG_WARN([Could not find a non-3d Athena widget library.])],
athena_lib=$athena_variant)
],
AC_MSG_WARN([Could not find an Athena widget library.]))
else
dnl The real configuration, need 3d library
- AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB, athena_lib=$athena_variant,
+ AC_CHECK_LIB($athena_variant, $athena_3d_function, athena_lib=$athena_variant,
dnl OK, couldn't find it with a proper name, try the standard Athena lib
dnl If that is 3d, presume the user asked for what they have installed.
- AC_CHECK_LIB(Xaw, XawSme3dComputeTopShadowRGB,
+ AC_CHECK_LIB(Xaw, $athena_3d_function,
[
athena_lib=Xaw;
AC_MSG_WARN([Assuming that libXaw is actually $athena_variant.]);
https://bitbucket.org/xemacs/xemacs/changeset/d8a11d5ebc9f/
changeset: d8a11d5ebc9f
user: stephen_at_xemacs
date: 2011-10-28 16:52:26
summary: Merge refactored Xaw3d configure.ac.
affected #: 2 files
diff -r d469c668462e5b004a23418bd255949613be5608 -r d8a11d5ebc9fd44f07ba43e58876aaf83122264d ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.ac (with_athena): Refactor check for Xaw3d.
+
2011-09-05 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac: $machine is intel386, reflecting the file name
diff -r d469c668462e5b004a23418bd255949613be5608 -r d8a11d5ebc9fd44f07ba43e58876aaf83122264d configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -3895,22 +3895,24 @@
*) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
esac
+ athena_3d_function=Xaw3dComputeBottomShadowRGB
+
dnl Search for the Athena library...
if test "$athena_3d" = "no"; then
AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
[
dnl Must not be a 3d library...
- AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB,
+ AC_CHECK_LIB($athena_variant, $athena_3d_function,
[AC_MSG_WARN([Could not find a non-3d Athena widget library.])],
athena_lib=$athena_variant)
],
AC_MSG_WARN([Could not find an Athena widget library.]))
else
dnl The real configuration, need 3d library
- AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB, athena_lib=$athena_variant,
+ AC_CHECK_LIB($athena_variant, $athena_3d_function, athena_lib=$athena_variant,
dnl OK, couldn't find it with a proper name, try the standard Athena lib
dnl If that is 3d, presume the user asked for what they have installed.
- AC_CHECK_LIB(Xaw, XawSme3dComputeTopShadowRGB,
+ AC_CHECK_LIB(Xaw, $athena_3d_function,
[
athena_lib=Xaw;
AC_MSG_WARN([Assuming that libXaw is actually $athena_variant.]);
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[AC 21.5] Refactor Xaw3d checking
12 years, 11 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
This patch is already in 21.4.
This patch is a slight refactoring inspired by the code in 21.4 and
occasioned by the thread where Giacomo Boffi was having trouble
getting configure to recognize his Xaw3d. That turned out to be some
kind of issue with Debian packaging IMO, so this patch isn't strictly
necessary, but configure.ac is slightly more readable as a result.
diff -r 6c76f5b7e2e3 -r 86d6adeb1cf4 ChangeLog
--- a/ChangeLog Sun Sep 11 16:05:05 2011 +0100
+++ b/ChangeLog Fri Oct 14 03:54:46 2011 +0900
@@ -1,3 +1,7 @@
+2011-10-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.ac (with_athena): Refactor check for Xaw3d.
+
2011-09-05 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac: $machine is intel386, reflecting the file name
diff -r 6c76f5b7e2e3 -r 86d6adeb1cf4 configure.ac
--- a/configure.ac Sun Sep 11 16:05:05 2011 +0100
+++ b/configure.ac Fri Oct 14 03:54:46 2011 +0900
@@ -3895,22 +3895,24 @@
*) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
esac
+ athena_3d_function=Xaw3dComputeBottomShadowRGB
+
dnl Search for the Athena library...
if test "$athena_3d" = "no"; then
AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
[
dnl Must not be a 3d library...
- AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB,
+ AC_CHECK_LIB($athena_variant, $athena_3d_function,
[AC_MSG_WARN([Could not find a non-3d Athena widget library.])],
athena_lib=$athena_variant)
],
AC_MSG_WARN([Could not find an Athena widget library.]))
else
dnl The real configuration, need 3d library
- AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB, athena_lib=$athena_variant,
+ AC_CHECK_LIB($athena_variant, $athena_3d_function, athena_lib=$athena_variant,
dnl OK, couldn't find it with a proper name, try the standard Athena lib
dnl If that is 3d, presume the user asked for what they have installed.
- AC_CHECK_LIB(Xaw, XawSme3dComputeTopShadowRGB,
+ AC_CHECK_LIB(Xaw, $athena_3d_function,
[
athena_lib=Xaw;
AC_MSG_WARN([Assuming that libXaw is actually $athena_variant.]);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] #'load-terminal-library; load term files correctly for gnuclient consoles.
12 years, 11 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1318935816 -3600
# Node ID d469c668462e5b004a23418bd255949613be5608
# Parent 10f179710250e480c3dfaff0838480984d1a0edf
#'load-terminal-library; load term files correctly for gnuclient consoles.
lisp/ChangeLog addition:
2011-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
* startup.el (load-terminal-library):
Don't (getenv "TERM") here, call #'console-tty-terminal-type
instead, different gnuclient consoles can and should have
different terminal type function maps effective.
diff -r 10f179710250 -r d469c668462e lisp/ChangeLog
--- a/lisp/ChangeLog Sun Oct 09 12:55:51 2011 +0100
+++ b/lisp/ChangeLog Tue Oct 18 12:03:36 2011 +0100
@@ -1,3 +1,10 @@
+2011-10-17 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * startup.el (load-terminal-library):
+ Don't (getenv "TERM") here, call #'console-tty-terminal-type
+ instead, different gnuclient consoles can and should have
+ different terminal type function maps effective.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* obsolete.el:
diff -r 10f179710250 -r d469c668462e lisp/startup.el
--- a/lisp/startup.el Sun Oct 09 12:55:51 2011 +0100
+++ b/lisp/startup.el Tue Oct 18 12:03:36 2011 +0100
@@ -796,7 +796,7 @@
(defun load-terminal-library ()
(when term-file-prefix
- (let ((term (getenv "TERM"))
+ (let ((term (console-tty-terminal-type))
hyphend)
(while (and term
(not (load (concat term-file-prefix term) t t)))
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
13 years
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1318161351 -3600
# Node ID 10f179710250e480c3dfaff0838480984d1a0edf
# Parent 873d7425c1ad341dc51994b6f4e1b4f56ecf9923
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (remassoc_no_quit):
* fns.c (remrassq_no_quit):
* fns.c (syms_of_fns):
* fontcolor-tty.c (Fregister_tty_color):
* fontcolor-tty.c (Funregister_tty_color):
* fontcolor-tty.c (Ffind_tty_color):
* lisp.h:
Remove Fremassq, Fremrassq, Fremassoc, Fremrassoc, they're
XEmacs-specific functions and Lisp callers should use (delete*
... :key #'car) anyway. Keep the non-Lisp-visible _no_quit
versions, calling FdeleteX from C with the appropriate arguments
is ungainly.
lisp/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* obsolete.el:
* obsolete.el (assq-delete-all):
* packages.el (package-provide):
* packages.el (package-suppress):
* mule/cyrillic.el ("Cyrillic-KOI8"):
* mule/cyrillic.el (koi8-u):
* mule/general-late.el (posix-charset-to-coding-system-hash):
* mule/latin.el:
* mule/latin.el (for):
* cl-extra.el:
* cl-extra.el (cl-extra):
* loadup.el (load-history):
Change any uses of #'remassq, #'remassoc and friends to calling
#'delete* with an appropriate key argument. Provide compatibility
implementations, mark them obsolete.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/lists.texi (Association Lists):
Don't document #'remassoc, #'remassq and friends in detail;
they're XEmacs-specific and (delete* ... :key #'car) is
preferable.
diff -r 873d7425c1ad -r 10f179710250 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/ChangeLog Sun Oct 09 12:55:51 2011 +0100
@@ -1,3 +1,21 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * obsolete.el:
+ * obsolete.el (assq-delete-all):
+ * packages.el (package-provide):
+ * packages.el (package-suppress):
+ * mule/cyrillic.el ("Cyrillic-KOI8"):
+ * mule/cyrillic.el (koi8-u):
+ * mule/general-late.el (posix-charset-to-coding-system-hash):
+ * mule/latin.el:
+ * mule/latin.el (for):
+ * cl-extra.el:
+ * cl-extra.el (cl-extra):
+ * loadup.el (load-history):
+ Change any uses of #'remassq, #'remassoc and friends to calling
+ #'delete* with an appropriate key argument. Provide compatibility
+ implementations, mark them obsolete.
+
2011-10-08 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el:
diff -r 873d7425c1ad -r 10f179710250 lisp/cl-extra.el
--- a/lisp/cl-extra.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/cl-extra.el Sun Oct 09 12:55:51 2011 +0100
@@ -874,6 +874,30 @@
(-1 (1- (length (format "%b" (- integer)))))
(1 (length (format "%b" integer)))))
+;; These are here because labels and symbol-macrolet are not available in
+;; obsolete.el. They are, however, all marked as obsolete in that file.
+(symbol-macrolet ((not-nil '#:not-nil))
+ (labels ((car-or-not-nil (object)
+ (if (consp object) (car object) not-nil))
+ (cdr-or-not-nil (object)
+ (if (consp object) (cdr object) not-nil)))
+ (defalias 'remassoc
+ #'(lambda (key alist)
+ (delete* key alist :test #'equal
+:key (if key #'car-safe #'car-or-not-nil))))
+ (defalias 'remrassoc
+ #'(lambda (key alist)
+ (delete* key alist :test #'equal
+:key (if key #'cdr-safe #'cdr-or-not-nil))))
+ (defalias 'remrassq
+ #'(lambda (key alist)
+ (delete* key alist :test #'eq
+:key (if key #'cdr-safe #'cdr-or-not-nil))))
+ (defalias 'remassq
+ #'(lambda (key alist)
+ (delete* key alist :test #'eq
+:key (if key #'car-safe #'car-or-not-nil))))))
+
(run-hooks 'cl-extra-load-hook)
;; XEmacs addition
diff -r 873d7425c1ad -r 10f179710250 lisp/loadup.el
--- a/lisp/loadup.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/loadup.el Sun Oct 09 12:55:51 2011 +0100
@@ -225,7 +225,7 @@
(delete*
nil
(mapc #'(lambda (element)
- (remassq 'defun element)
+ (delete* 'defun element :key #'car-safe)
(delete-if
#'(lambda (elt)
(and
diff -r 873d7425c1ad -r 10f179710250 lisp/mule/cyrillic.el
--- a/lisp/mule/cyrillic.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/mule/cyrillic.el Sun Oct 09 12:55:51 2011 +0100
@@ -418,7 +418,7 @@
(set-language-info-alist
"Cyrillic-KOI8"
- (remassq 'locale (copy-list (cdr (assoc "Russian" language-info-alist))))
+ (remove* 'locale (cdr (assoc "Russian" language-info-alist)) :key #'car)
'("Cyrillic"))
;; KOI8-U, for Ukrainian.
diff -r 873d7425c1ad -r 10f179710250 lisp/mule/general-late.el
--- a/lisp/mule/general-late.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/mule/general-late.el Sun Oct 09 12:55:51 2011 +0100
@@ -46,13 +46,13 @@
;; fraction faster for those languages.
language-info-alist
(cons (assoc "Japanese" language-info-alist)
- (remassoc "Japanese" language-info-alist))
+ (delete* "Japanese" language-info-alist :test #'equal :key #'car))
language-info-alist
(cons (assoc "German" language-info-alist)
- (remassoc "German" language-info-alist))
+ (delete* "German" language-info-alist :test #'equal :key #'car))
language-info-alist
(cons (assoc "English" language-info-alist)
- (remassoc "English" language-info-alist))
+ (delete* "English" language-info-alist :test #'equal :key #'car))
;; Make Installation-string actually reflect the environment at
;; byte-compile time. (We can't necessarily decode it when version.el
diff -r 873d7425c1ad -r 10f179710250 lisp/mule/latin.el
--- a/lisp/mule/latin.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/mule/latin.el Sun Oct 09 12:55:51 2011 +0100
@@ -2056,6 +2056,6 @@
(setcar assocked
(upcase (symbol-name coding-system)))
(setcdr assocked
- (remassq 'locale (cdr assocked))))
+ (delete* 'locale (cdr assocked) :key #'car)))
;;; latin.el ends here
diff -r 873d7425c1ad -r 10f179710250 lisp/obsolete.el
--- a/lisp/obsolete.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/obsolete.el Sun Oct 09 12:55:51 2011 +0100
@@ -263,8 +263,8 @@
(define-compatible-function-alias 'interactive-form
'function-interactive) ;GNU 21.1
-(define-compatible-function-alias 'assq-delete-all
- 'remassq) ;GNU 21.1
+(define-function 'assq-delete-all 'remassq) ;GNU 21.1
+(make-compatible 'assq-delete-all "use (delete* ITEM SEQUENCE :key #'car)")
(defun makehash (&optional test)
"Create a new hash table.
@@ -452,5 +452,15 @@
(define-obsolete-variable-alias 'cl-macro-environment
'byte-compile-macro-environment)
+;; Actual implementations of these functions are in cl-extra.el, after
+;; cl-macs is loaded, since those implementations use #'labels and
+;; #'symbol-macrolet. These APIs were always XEmacs-specific, were never
+;; widely used, and it was always more readable and more compatible to use
+;; the CL functions.
+(make-obsolete 'remassoc "use delete* with :test #'equal, :key #'car")
+(make-obsolete 'remassq "use delete* with :test #'eq, :key #'car")
+(make-obsolete 'remrassoc "use delete* with :test #'equal, :key #'cdr")
+(make-obsolete 'remrassq "use delete* with :test #'eq, :key #'cdr")
+
(provide 'obsolete)
;;; obsolete.el ends here
diff -r 873d7425c1ad -r 10f179710250 lisp/packages.el
--- a/lisp/packages.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/packages.el Sun Oct 09 12:55:51 2011 +0100
@@ -111,7 +111,8 @@
(list :version (car attributes))
attributes)))
(setq packages-package-list
- (cons (cons name info) (remassq name packages-package-list)))))
+ (cons (cons name info) (delete* name packages-package-list
+:test #'eq :key #'car)))))
(defun package-suppress (package file form)
"Set up a package-suppress condition FORM for FILE in PACKAGE.
diff -r 873d7425c1ad -r 10f179710250 man/ChangeLog
--- a/man/ChangeLog Sun Oct 09 10:39:09 2011 +0100
+++ b/man/ChangeLog Sun Oct 09 12:55:51 2011 +0100
@@ -1,3 +1,10 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/lists.texi (Association Lists):
+ Don't document #'remassoc, #'remassq and friends in detail;
+ they're XEmacs-specific and (delete* ... :key #'car) is
+ preferable.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* internals/internals.texi (Top):
diff -r 873d7425c1ad -r 10f179710250 man/lispref/lists.texi
--- a/man/lispref/lists.texi Sun Oct 09 10:39:09 2011 +0100
+++ b/man/lispref/lists.texi Sun Oct 09 12:55:51 2011 +0100
@@ -1451,7 +1451,8 @@
In XEmacs Lisp, it is @emph{not} an error if an element of an
association list is not a cons cell. The alist search functions simply
ignore such elements. Many other versions of Lisp signal errors in such
-cases.
+cases, and it is good practice to avoid adding non-cons-cells to association
+lists.
Note that property lists are similar to association lists in several
respects. A property list behaves like an association list in which
@@ -1569,57 +1570,6 @@
@end smallexample
@end defun
-@defun remassoc key alist
-This function deletes by side effect any associations with key @var{key}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{car} is @code{equal} to @var{key}. The modified @var{alist} is
-returned.
-
-If the first member of @var{alist} has a @code{car} that is @code{equal}
-to @var{key}, there is no way to remove it by side effect; therefore,
-write @code{(setq foo (remassoc key foo))} to be sure of changing the
-value of @code{foo}.
-@end defun
-
-@defun remassq key alist
-This function deletes by side effect any associations with key @var{key}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{car} is @code{eq} to @var{key}. The modified @var{alist} is
-returned.
-
-This function is exactly like @code{remassoc}, but comparisons between
-@var{key} and keys in @var{alist} are done using @code{eq} instead of
-@code{equal}.
-@end defun
-
-@defun remrassoc value alist
-This function deletes by side effect any associations with value @var{value}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{cdr} is @code{equal} to @var{value}. The modified @var{alist} is
-returned.
-
-If the first member of @var{alist} has a @code{car} that is @code{equal}
-to @var{value}, there is no way to remove it by side effect; therefore,
-write @code{(setq foo (remassoc value foo))} to be sure of changing the
-value of @code{foo}.
-
-@code{remrassoc} is like @code{remassoc} except that it compares the
-@sc{cdr} of each @var{alist} association instead of the @sc{car}. You
-can think of this as ``reverse @code{remassoc}'', removing an association
-based on its value instead of its key.
-@end defun
-
-@defun remrassq value alist
-This function deletes by side effect any associations with value @var{value}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{cdr} is @code{eq} to @var{value}. The modified @var{alist} is
-returned.
-
-This function is exactly like @code{remrassoc}, but comparisons between
-@var{value} and values in @var{alist} are done using @code{eq} instead of
-@code{equal}.
-@end defun
-
@defun copy-alist alist
@cindex copying alists
This function returns a two-level deep copy of @var{alist}: it creates a
@@ -1671,6 +1621,14 @@
@end smallexample
@end defun
+For removing elements from alists, use @code{remove*} or @code{delete*} with
+appropriate @code{:key} arguments. If it is necessary that XEmacs not error
+on encountering a non-cons in such a list, there are XEmacs-specific functions
+@code{remassq}, @code{remrassq}, @code{remassoc}, and @code{remrassoc} with
+this behavior, but they are neither available under GNU Emacs nor Common Lisp.
+They are marked as obsolete, and it is preferable to fix your code to avoid
+adding non-cons objects to alists.
+
@node Property Lists
@section Property Lists
@cindex property list
diff -r 873d7425c1ad -r 10f179710250 src/ChangeLog
--- a/src/ChangeLog Sun Oct 09 10:39:09 2011 +0100
+++ b/src/ChangeLog Sun Oct 09 12:55:51 2011 +0100
@@ -1,3 +1,18 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fns.c (remassoc_no_quit):
+ * fns.c (remrassq_no_quit):
+ * fns.c (syms_of_fns):
+ * fontcolor-tty.c (Fregister_tty_color):
+ * fontcolor-tty.c (Funregister_tty_color):
+ * fontcolor-tty.c (Ffind_tty_color):
+ * lisp.h:
+ Remove Fremassq, Fremrassq, Fremassoc, Fremrassoc, they're
+ XEmacs-specific functions and Lisp callers should use (delete*
+ ... :key #'car) anyway. Keep the non-Lisp-visible _no_quit
+ versions, calling FdeleteX from C with the appropriate arguments
+ is ungainly.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
Do a couple of non-mechanical things that would otherwise have
diff -r 873d7425c1ad -r 10f179710250 src/fns.c
--- a/src/fns.c Sun Oct 09 10:39:09 2011 +0100
+++ b/src/fns.c Sun Oct 09 12:55:51 2011 +0100
@@ -3642,41 +3642,12 @@
return sequence;
}
-DEFUN ("remassoc", Fremassoc, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose car is `equal' to KEY.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `equal' to KEY, there is no way to remove it by side effect;
-therefore, write `(setq foo (remassoc key foo))' to be sure of changing
-the value of `foo'.
-*/
- (key, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- internal_equal (key, XCAR (elt), 0)));
- return alist;
-}
-
Lisp_Object
remassoc_no_quit (Lisp_Object key, Lisp_Object alist)
{
- int speccount = specpdl_depth ();
- specbind (Qinhibit_quit, Qt);
- return unbind_to_1 (speccount, Fremassoc (key, alist));
-}
-
-DEFUN ("remassq", Fremassq, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose car is `eq' to KEY.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `eq' to KEY, there is no way to remove it by side effect;
-therefore, write `(setq foo (remassq key foo))' to be sure of changing
-the value of `foo'.
-*/
- (key, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- EQ_WITH_EBOLA_NOTICE (key, XCAR (elt))));
+ LIST_LOOP_DELETE_IF (elt, alist,
+ (CONSP (elt) &&
+ internal_equal (key, XCAR (elt), 0)));
return alist;
}
@@ -3691,36 +3662,6 @@
return alist;
}
-DEFUN ("remrassoc", Fremrassoc, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose cdr is `equal' to VALUE.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `equal' to VALUE, there is no way to remove it by side effect;
-therefore, write `(setq foo (remrassoc value foo))' to be sure of changing
-the value of `foo'.
-*/
- (value, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- internal_equal (value, XCDR (elt), 0)));
- return alist;
-}
-
-DEFUN ("remrassq", Fremrassq, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose cdr is `eq' to VALUE.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `eq' to VALUE, there is no way to remove it by side effect;
-therefore, write `(setq foo (remrassq value foo))' to be sure of changing
-the value of `foo'.
-*/
- (value, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- EQ_WITH_EBOLA_NOTICE (value, XCDR (elt))));
- return alist;
-}
-
/* Like Fremrassq, fast and unsafe; be careful */
Lisp_Object
remrassq_no_quit (Lisp_Object value, Lisp_Object alist)
@@ -11771,10 +11712,6 @@
DEFSUBR (FdeleteX);
DEFSUBR (FremoveX);
- DEFSUBR (Fremassoc);
- DEFSUBR (Fremassq);
- DEFSUBR (Fremrassoc);
- DEFSUBR (Fremrassq);
DEFSUBR (Fdelete_duplicates);
DEFSUBR (Fremove_duplicates);
DEFSUBR (Fnreverse);
diff -r 873d7425c1ad -r 10f179710250 src/fontcolor-tty.c
--- a/src/fontcolor-tty.c Sun Oct 09 10:39:09 2011 +0100
+++ b/src/fontcolor-tty.c Sun Oct 09 12:55:51 2011 +0100
@@ -80,7 +80,7 @@
CHECK_STRING (bg_string);
color = Fintern (color, Qnil);
- Vtty_color_alist = Fremassq (color, Vtty_color_alist);
+ Vtty_color_alist = remassq_no_quit (color, Vtty_color_alist);
Vtty_color_alist = Fcons (Fcons (color, Fcons (fg_string, bg_string)),
Vtty_color_alist);
@@ -95,7 +95,7 @@
CHECK_STRING (color);
color = Fintern (color, Qnil);
- Vtty_color_alist = Fremassq (color, Vtty_color_alist);
+ Vtty_color_alist = remassq_no_quit (color, Vtty_color_alist);
return Qnil;
}
@@ -111,7 +111,7 @@
CHECK_STRING (color);
- result = Fassq (Fintern (color, Qnil), Vtty_color_alist);
+ result = assq_no_quit (Fintern (color, Qnil), Vtty_color_alist);
if (!NILP (result))
return list2 (Fcar (Fcdr (result)), Fcdr (Fcdr (result)));
else
diff -r 873d7425c1ad -r 10f179710250 src/lisp.h
--- a/src/lisp.h Sun Oct 09 10:39:09 2011 +0100
+++ b/src/lisp.h Sun Oct 09 12:55:51 2011 +0100
@@ -5286,7 +5286,6 @@
MODULE_API EXFUN (Fprovide, 1);
MODULE_API EXFUN (Fput, 3);
EXFUN (Frassq, 2);
-EXFUN (Fremassq, 2);
EXFUN (Freplace_list, 2);
MODULE_API EXFUN (Freverse, 1);
EXFUN (Fsafe_length, 1);
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
13 years
Aidan Kehoe
changeset: 5583:10f179710250
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Oct 09 12:55:51 2011 +0100
files: lisp/ChangeLog lisp/cl-extra.el lisp/loadup.el lisp/mule/cyrillic.el lisp/mule/general-late.el lisp/mule/latin.el lisp/obsolete.el lisp/packages.el man/ChangeLog man/lispref/lists.texi src/ChangeLog src/fns.c src/fontcolor-tty.c src/lisp.h
description:
Deprecate #'remassoc, #'remassq, #'remrassoc, #'remrassq.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (remassoc_no_quit):
* fns.c (remrassq_no_quit):
* fns.c (syms_of_fns):
* fontcolor-tty.c (Fregister_tty_color):
* fontcolor-tty.c (Funregister_tty_color):
* fontcolor-tty.c (Ffind_tty_color):
* lisp.h:
Remove Fremassq, Fremrassq, Fremassoc, Fremrassoc, they're
XEmacs-specific functions and Lisp callers should use (delete*
... :key #'car) anyway. Keep the non-Lisp-visible _no_quit
versions, calling FdeleteX from C with the appropriate arguments
is ungainly.
lisp/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* obsolete.el:
* obsolete.el (assq-delete-all):
* packages.el (package-provide):
* packages.el (package-suppress):
* mule/cyrillic.el ("Cyrillic-KOI8"):
* mule/cyrillic.el (koi8-u):
* mule/general-late.el (posix-charset-to-coding-system-hash):
* mule/latin.el:
* mule/latin.el (for):
* cl-extra.el:
* cl-extra.el (cl-extra):
* loadup.el (load-history):
Change any uses of #'remassq, #'remassoc and friends to calling
#'delete* with an appropriate key argument. Provide compatibility
implementations, mark them obsolete.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/lists.texi (Association Lists):
Don't document #'remassoc, #'remassq and friends in detail;
they're XEmacs-specific and (delete* ... :key #'car) is
preferable.
diff -r 873d7425c1ad -r 10f179710250 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/ChangeLog Sun Oct 09 12:55:51 2011 +0100
@@ -1,3 +1,21 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * obsolete.el:
+ * obsolete.el (assq-delete-all):
+ * packages.el (package-provide):
+ * packages.el (package-suppress):
+ * mule/cyrillic.el ("Cyrillic-KOI8"):
+ * mule/cyrillic.el (koi8-u):
+ * mule/general-late.el (posix-charset-to-coding-system-hash):
+ * mule/latin.el:
+ * mule/latin.el (for):
+ * cl-extra.el:
+ * cl-extra.el (cl-extra):
+ * loadup.el (load-history):
+ Change any uses of #'remassq, #'remassoc and friends to calling
+ #'delete* with an appropriate key argument. Provide compatibility
+ implementations, mark them obsolete.
+
2011-10-08 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el:
diff -r 873d7425c1ad -r 10f179710250 lisp/cl-extra.el
--- a/lisp/cl-extra.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/cl-extra.el Sun Oct 09 12:55:51 2011 +0100
@@ -874,6 +874,30 @@
(-1 (1- (length (format "%b" (- integer)))))
(1 (length (format "%b" integer)))))
+;; These are here because labels and symbol-macrolet are not available in
+;; obsolete.el. They are, however, all marked as obsolete in that file.
+(symbol-macrolet ((not-nil '#:not-nil))
+ (labels ((car-or-not-nil (object)
+ (if (consp object) (car object) not-nil))
+ (cdr-or-not-nil (object)
+ (if (consp object) (cdr object) not-nil)))
+ (defalias 'remassoc
+ #'(lambda (key alist)
+ (delete* key alist :test #'equal
+:key (if key #'car-safe #'car-or-not-nil))))
+ (defalias 'remrassoc
+ #'(lambda (key alist)
+ (delete* key alist :test #'equal
+:key (if key #'cdr-safe #'cdr-or-not-nil))))
+ (defalias 'remrassq
+ #'(lambda (key alist)
+ (delete* key alist :test #'eq
+:key (if key #'cdr-safe #'cdr-or-not-nil))))
+ (defalias 'remassq
+ #'(lambda (key alist)
+ (delete* key alist :test #'eq
+:key (if key #'car-safe #'car-or-not-nil))))))
+
(run-hooks 'cl-extra-load-hook)
;; XEmacs addition
diff -r 873d7425c1ad -r 10f179710250 lisp/loadup.el
--- a/lisp/loadup.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/loadup.el Sun Oct 09 12:55:51 2011 +0100
@@ -225,7 +225,7 @@
(delete*
nil
(mapc #'(lambda (element)
- (remassq 'defun element)
+ (delete* 'defun element :key #'car-safe)
(delete-if
#'(lambda (elt)
(and
diff -r 873d7425c1ad -r 10f179710250 lisp/mule/cyrillic.el
--- a/lisp/mule/cyrillic.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/mule/cyrillic.el Sun Oct 09 12:55:51 2011 +0100
@@ -418,7 +418,7 @@
(set-language-info-alist
"Cyrillic-KOI8"
- (remassq 'locale (copy-list (cdr (assoc "Russian" language-info-alist))))
+ (remove* 'locale (cdr (assoc "Russian" language-info-alist)) :key #'car)
'("Cyrillic"))
;; KOI8-U, for Ukrainian.
diff -r 873d7425c1ad -r 10f179710250 lisp/mule/general-late.el
--- a/lisp/mule/general-late.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/mule/general-late.el Sun Oct 09 12:55:51 2011 +0100
@@ -46,13 +46,13 @@
;; fraction faster for those languages.
language-info-alist
(cons (assoc "Japanese" language-info-alist)
- (remassoc "Japanese" language-info-alist))
+ (delete* "Japanese" language-info-alist :test #'equal :key #'car))
language-info-alist
(cons (assoc "German" language-info-alist)
- (remassoc "German" language-info-alist))
+ (delete* "German" language-info-alist :test #'equal :key #'car))
language-info-alist
(cons (assoc "English" language-info-alist)
- (remassoc "English" language-info-alist))
+ (delete* "English" language-info-alist :test #'equal :key #'car))
;; Make Installation-string actually reflect the environment at
;; byte-compile time. (We can't necessarily decode it when version.el
diff -r 873d7425c1ad -r 10f179710250 lisp/mule/latin.el
--- a/lisp/mule/latin.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/mule/latin.el Sun Oct 09 12:55:51 2011 +0100
@@ -2056,6 +2056,6 @@
(setcar assocked
(upcase (symbol-name coding-system)))
(setcdr assocked
- (remassq 'locale (cdr assocked))))
+ (delete* 'locale (cdr assocked) :key #'car)))
;;; latin.el ends here
diff -r 873d7425c1ad -r 10f179710250 lisp/obsolete.el
--- a/lisp/obsolete.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/obsolete.el Sun Oct 09 12:55:51 2011 +0100
@@ -263,8 +263,8 @@
(define-compatible-function-alias 'interactive-form
'function-interactive) ;GNU 21.1
-(define-compatible-function-alias 'assq-delete-all
- 'remassq) ;GNU 21.1
+(define-function 'assq-delete-all 'remassq) ;GNU 21.1
+(make-compatible 'assq-delete-all "use (delete* ITEM SEQUENCE :key #'car)")
(defun makehash (&optional test)
"Create a new hash table.
@@ -452,5 +452,15 @@
(define-obsolete-variable-alias 'cl-macro-environment
'byte-compile-macro-environment)
+;; Actual implementations of these functions are in cl-extra.el, after
+;; cl-macs is loaded, since those implementations use #'labels and
+;; #'symbol-macrolet. These APIs were always XEmacs-specific, were never
+;; widely used, and it was always more readable and more compatible to use
+;; the CL functions.
+(make-obsolete 'remassoc "use delete* with :test #'equal, :key #'car")
+(make-obsolete 'remassq "use delete* with :test #'eq, :key #'car")
+(make-obsolete 'remrassoc "use delete* with :test #'equal, :key #'cdr")
+(make-obsolete 'remrassq "use delete* with :test #'eq, :key #'cdr")
+
(provide 'obsolete)
;;; obsolete.el ends here
diff -r 873d7425c1ad -r 10f179710250 lisp/packages.el
--- a/lisp/packages.el Sun Oct 09 10:39:09 2011 +0100
+++ b/lisp/packages.el Sun Oct 09 12:55:51 2011 +0100
@@ -111,7 +111,8 @@
(list :version (car attributes))
attributes)))
(setq packages-package-list
- (cons (cons name info) (remassq name packages-package-list)))))
+ (cons (cons name info) (delete* name packages-package-list
+:test #'eq :key #'car)))))
(defun package-suppress (package file form)
"Set up a package-suppress condition FORM for FILE in PACKAGE.
diff -r 873d7425c1ad -r 10f179710250 man/ChangeLog
--- a/man/ChangeLog Sun Oct 09 10:39:09 2011 +0100
+++ b/man/ChangeLog Sun Oct 09 12:55:51 2011 +0100
@@ -1,3 +1,10 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/lists.texi (Association Lists):
+ Don't document #'remassoc, #'remassq and friends in detail;
+ they're XEmacs-specific and (delete* ... :key #'car) is
+ preferable.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* internals/internals.texi (Top):
diff -r 873d7425c1ad -r 10f179710250 man/lispref/lists.texi
--- a/man/lispref/lists.texi Sun Oct 09 10:39:09 2011 +0100
+++ b/man/lispref/lists.texi Sun Oct 09 12:55:51 2011 +0100
@@ -1451,7 +1451,8 @@
In XEmacs Lisp, it is @emph{not} an error if an element of an
association list is not a cons cell. The alist search functions simply
ignore such elements. Many other versions of Lisp signal errors in such
-cases.
+cases, and it is good practice to avoid adding non-cons-cells to association
+lists.
Note that property lists are similar to association lists in several
respects. A property list behaves like an association list in which
@@ -1569,57 +1570,6 @@
@end smallexample
@end defun
-@defun remassoc key alist
-This function deletes by side effect any associations with key @var{key}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{car} is @code{equal} to @var{key}. The modified @var{alist} is
-returned.
-
-If the first member of @var{alist} has a @code{car} that is @code{equal}
-to @var{key}, there is no way to remove it by side effect; therefore,
-write @code{(setq foo (remassoc key foo))} to be sure of changing the
-value of @code{foo}.
-@end defun
-
-@defun remassq key alist
-This function deletes by side effect any associations with key @var{key}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{car} is @code{eq} to @var{key}. The modified @var{alist} is
-returned.
-
-This function is exactly like @code{remassoc}, but comparisons between
-@var{key} and keys in @var{alist} are done using @code{eq} instead of
-@code{equal}.
-@end defun
-
-@defun remrassoc value alist
-This function deletes by side effect any associations with value @var{value}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{cdr} is @code{equal} to @var{value}. The modified @var{alist} is
-returned.
-
-If the first member of @var{alist} has a @code{car} that is @code{equal}
-to @var{value}, there is no way to remove it by side effect; therefore,
-write @code{(setq foo (remassoc value foo))} to be sure of changing the
-value of @code{foo}.
-
-@code{remrassoc} is like @code{remassoc} except that it compares the
-@sc{cdr} of each @var{alist} association instead of the @sc{car}. You
-can think of this as ``reverse @code{remassoc}'', removing an association
-based on its value instead of its key.
-@end defun
-
-@defun remrassq value alist
-This function deletes by side effect any associations with value @var{value}
-in @var{alist}---i.e. it removes any elements from @var{alist} whose
-@code{cdr} is @code{eq} to @var{value}. The modified @var{alist} is
-returned.
-
-This function is exactly like @code{remrassoc}, but comparisons between
-@var{value} and values in @var{alist} are done using @code{eq} instead of
-@code{equal}.
-@end defun
-
@defun copy-alist alist
@cindex copying alists
This function returns a two-level deep copy of @var{alist}: it creates a
@@ -1671,6 +1621,14 @@
@end smallexample
@end defun
+For removing elements from alists, use @code{remove*} or @code{delete*} with
+appropriate @code{:key} arguments. If it is necessary that XEmacs not error
+on encountering a non-cons in such a list, there are XEmacs-specific functions
+@code{remassq}, @code{remrassq}, @code{remassoc}, and @code{remrassoc} with
+this behavior, but they are neither available under GNU Emacs nor Common Lisp.
+They are marked as obsolete, and it is preferable to fix your code to avoid
+adding non-cons objects to alists.
+
@node Property Lists
@section Property Lists
@cindex property list
diff -r 873d7425c1ad -r 10f179710250 src/ChangeLog
--- a/src/ChangeLog Sun Oct 09 10:39:09 2011 +0100
+++ b/src/ChangeLog Sun Oct 09 12:55:51 2011 +0100
@@ -1,3 +1,18 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fns.c (remassoc_no_quit):
+ * fns.c (remrassq_no_quit):
+ * fns.c (syms_of_fns):
+ * fontcolor-tty.c (Fregister_tty_color):
+ * fontcolor-tty.c (Funregister_tty_color):
+ * fontcolor-tty.c (Ffind_tty_color):
+ * lisp.h:
+ Remove Fremassq, Fremrassq, Fremassoc, Fremrassoc, they're
+ XEmacs-specific functions and Lisp callers should use (delete*
+ ... :key #'car) anyway. Keep the non-Lisp-visible _no_quit
+ versions, calling FdeleteX from C with the appropriate arguments
+ is ungainly.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
Do a couple of non-mechanical things that would otherwise have
diff -r 873d7425c1ad -r 10f179710250 src/fns.c
--- a/src/fns.c Sun Oct 09 10:39:09 2011 +0100
+++ b/src/fns.c Sun Oct 09 12:55:51 2011 +0100
@@ -3642,41 +3642,12 @@
return sequence;
}
-DEFUN ("remassoc", Fremassoc, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose car is `equal' to KEY.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `equal' to KEY, there is no way to remove it by side effect;
-therefore, write `(setq foo (remassoc key foo))' to be sure of changing
-the value of `foo'.
-*/
- (key, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- internal_equal (key, XCAR (elt), 0)));
- return alist;
-}
-
Lisp_Object
remassoc_no_quit (Lisp_Object key, Lisp_Object alist)
{
- int speccount = specpdl_depth ();
- specbind (Qinhibit_quit, Qt);
- return unbind_to_1 (speccount, Fremassoc (key, alist));
-}
-
-DEFUN ("remassq", Fremassq, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose car is `eq' to KEY.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `eq' to KEY, there is no way to remove it by side effect;
-therefore, write `(setq foo (remassq key foo))' to be sure of changing
-the value of `foo'.
-*/
- (key, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- EQ_WITH_EBOLA_NOTICE (key, XCAR (elt))));
+ LIST_LOOP_DELETE_IF (elt, alist,
+ (CONSP (elt) &&
+ internal_equal (key, XCAR (elt), 0)));
return alist;
}
@@ -3691,36 +3662,6 @@
return alist;
}
-DEFUN ("remrassoc", Fremrassoc, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose cdr is `equal' to VALUE.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `equal' to VALUE, there is no way to remove it by side effect;
-therefore, write `(setq foo (remrassoc value foo))' to be sure of changing
-the value of `foo'.
-*/
- (value, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- internal_equal (value, XCDR (elt), 0)));
- return alist;
-}
-
-DEFUN ("remrassq", Fremrassq, 2, 2, 0, /*
-Delete by side effect any elements of ALIST whose cdr is `eq' to VALUE.
-The modified ALIST is returned. If the first member of ALIST has a car
-that is `eq' to VALUE, there is no way to remove it by side effect;
-therefore, write `(setq foo (remrassq value foo))' to be sure of changing
-the value of `foo'.
-*/
- (value, alist))
-{
- EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist,
- (CONSP (elt) &&
- EQ_WITH_EBOLA_NOTICE (value, XCDR (elt))));
- return alist;
-}
-
/* Like Fremrassq, fast and unsafe; be careful */
Lisp_Object
remrassq_no_quit (Lisp_Object value, Lisp_Object alist)
@@ -11771,10 +11712,6 @@
DEFSUBR (FdeleteX);
DEFSUBR (FremoveX);
- DEFSUBR (Fremassoc);
- DEFSUBR (Fremassq);
- DEFSUBR (Fremrassoc);
- DEFSUBR (Fremrassq);
DEFSUBR (Fdelete_duplicates);
DEFSUBR (Fremove_duplicates);
DEFSUBR (Fnreverse);
diff -r 873d7425c1ad -r 10f179710250 src/fontcolor-tty.c
--- a/src/fontcolor-tty.c Sun Oct 09 10:39:09 2011 +0100
+++ b/src/fontcolor-tty.c Sun Oct 09 12:55:51 2011 +0100
@@ -80,7 +80,7 @@
CHECK_STRING (bg_string);
color = Fintern (color, Qnil);
- Vtty_color_alist = Fremassq (color, Vtty_color_alist);
+ Vtty_color_alist = remassq_no_quit (color, Vtty_color_alist);
Vtty_color_alist = Fcons (Fcons (color, Fcons (fg_string, bg_string)),
Vtty_color_alist);
@@ -95,7 +95,7 @@
CHECK_STRING (color);
color = Fintern (color, Qnil);
- Vtty_color_alist = Fremassq (color, Vtty_color_alist);
+ Vtty_color_alist = remassq_no_quit (color, Vtty_color_alist);
return Qnil;
}
@@ -111,7 +111,7 @@
CHECK_STRING (color);
- result = Fassq (Fintern (color, Qnil), Vtty_color_alist);
+ result = assq_no_quit (Fintern (color, Qnil), Vtty_color_alist);
if (!NILP (result))
return list2 (Fcar (Fcdr (result)), Fcdr (Fcdr (result)));
else
diff -r 873d7425c1ad -r 10f179710250 src/lisp.h
--- a/src/lisp.h Sun Oct 09 10:39:09 2011 +0100
+++ b/src/lisp.h Sun Oct 09 12:55:51 2011 +0100
@@ -5286,7 +5286,6 @@
MODULE_API EXFUN (Fprovide, 1);
MODULE_API EXFUN (Fput, 3);
EXFUN (Frassq, 2);
-EXFUN (Fremassq, 2);
EXFUN (Freplace_list, 2);
MODULE_API EXFUN (Freverse, 1);
EXFUN (Fsafe_length, 1);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Change integer to fixnum in a few places where it wasn't possible mechanically.
13 years
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1318153149 -3600
# Node ID 873d7425c1ad341dc51994b6f4e1b4f56ecf9923
# Parent 56144c8593a80889c71a56d00577147d80a66cc1
Change integer to fixnum in a few places where it wasn't possible mechanically.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
Do a couple of non-mechanical things that would otherwise have
been included in the last change.
* data.c:
* data.c (Ftype_of):
Return Qfixnum for fixnums, not Qinteger.
* lisp.h (MOST_POSITIVE_FIXNUM):
Delete an obsolete comment here.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* internals/internals.texi (Top):
* internals/internals.texi (Authorship of XEmacs):
* internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System):
* internals/internals.texi (Introduction to Writing C Code):
* internals/internals.texi (Working with Lisp Objects):
* internals/internals.texi (Adding Global Lisp Variables):
* internals/internals.texi (The XEmacs Object System (Abstractly Speaking)):
* internals/internals.texi (How Lisp Objects Are Represented in C):
* internals/internals.texi (Allocation of Objects in XEmacs Lisp):
* internals/internals.texi (Introduction to Allocation):
* internals/internals.texi (GCPROing):
* internals/internals.texi (mark_object):
* internals/internals.texi (sweep_bit_vectors_1):
* internals/internals.texi (Fixnums and Characters):
* internals/internals.texi (Future Work -- Unicode):
Say fixnum rather than integer when specifically talking about
fixed-width Lisp integers.
diff -r 56144c8593a8 -r 873d7425c1ad man/ChangeLog
--- a/man/ChangeLog Sun Oct 09 09:51:57 2011 +0100
+++ b/man/ChangeLog Sun Oct 09 10:39:09 2011 +0100
@@ -1,3 +1,23 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * internals/internals.texi (Top):
+ * internals/internals.texi (Authorship of XEmacs):
+ * internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System):
+ * internals/internals.texi (Introduction to Writing C Code):
+ * internals/internals.texi (Working with Lisp Objects):
+ * internals/internals.texi (Adding Global Lisp Variables):
+ * internals/internals.texi (The XEmacs Object System (Abstractly Speaking)):
+ * internals/internals.texi (How Lisp Objects Are Represented in C):
+ * internals/internals.texi (Allocation of Objects in XEmacs Lisp):
+ * internals/internals.texi (Introduction to Allocation):
+ * internals/internals.texi (GCPROing):
+ * internals/internals.texi (mark_object):
+ * internals/internals.texi (sweep_bit_vectors_1):
+ * internals/internals.texi (Fixnums and Characters):
+ * internals/internals.texi (Future Work -- Unicode):
+ Say fixnum rather than integer when specifically talking about
+ fixed-width Lisp integers.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* internals/internals.texi (How Lisp Objects Are Represented in C):
diff -r 56144c8593a8 -r 873d7425c1ad man/internals/internals.texi
--- a/man/internals/internals.texi Sun Oct 09 09:51:57 2011 +0100
+++ b/man/internals/internals.texi Sun Oct 09 10:39:09 2011 +0100
@@ -467,7 +467,7 @@
* Garbage Collection::
* GCPROing::
* Garbage Collection - Step by Step::
-* Integers and Characters::
+* Fixnums and Characters::
* Allocation from Frob Blocks::
* lrecords::
* Low-level allocation::
@@ -948,9 +948,9 @@
@item Objects
@itemize @minus
@item
-Conversion from 26-bit to 28-bit pointers and integers, lrecords, lcrecords: Richard Mlynarik, 1994
-@item
-Conversion to 32-bit pointers and 31-bit integers: Kyle Jones, Martin Buchholz
+Conversion from 26-bit to 28-bit pointers and fixnums, lrecords, lcrecords: Richard Mlynarik, 1994
+@item
+Conversion to 32-bit pointers and 31-bit fixnums: Kyle Jones, Martin Buchholz
@item
Portable dumper, object descriptions: Olivier Galibert
@item
@@ -1154,7 +1154,7 @@
@item Kyle Jones
Author of the minimal tag bits support, which allows for 32-bit
-pointers and 31-bit integers.
+pointers and 31-bit fixnums.
@item Olivier Galibert
Author of the portable dumping mechanism.
@@ -1200,9 +1200,9 @@
Steve Baur did some work on the purification and dump time code, and
added Doug Lea Malloc support from Emacs 20.2 circa 1998. Kyle Jones
continued to work done by Mlynarik, reducing the number of primitive
-Lisp types so that there are only three: integer character and pointer
+Lisp types so that there are only three: fixnum, character, and pointer
type, which encompasses all other types. This allows for 31-bit
-integers and 32-bit pointers, although there is potential slowdown in
+fixnums and 32-bit pointers, although there is potential slowdown in
some extra in directions when determining the type of an object, and
some memory increase for the objects that previously were considered to
be the most primitive types. Martin Buchholz has recently (February
@@ -4084,7 +4084,7 @@
@end example
This module implements the @dfn{range table} Lisp object type, which
-provides for a mapping from ranges of integers to arbitrary Lisp
+provides for a mapping from ranges of fixnums to arbitrary Lisp
objects.
@@ -4981,7 +4981,7 @@
@item
No C variables whose value is other than a Lisp_Object should begin
with a capital V. (This includes C variables that forward into
-integer or boolean Lisp variables.)
+fixnums or boolean Lisp variables.)
@item
All global C variables whose value is a struct Lisp_Subr begin with a
capital S. (This only occurs in connection with DEFUN ()).
@@ -5158,7 +5158,7 @@
All Lisp objects are handled indirectly. The @code{Lisp_Object}
type is usually a pointer to a structure, except for a very small number
of types with immediate representations (currently characters and
-integers). However, these types cannot be directly operated on in C
+fixnums). However, these types cannot be directly operated on in C
code, either, so they can also be considered indirect. Types that do
not have an immediate representation always have a C typedef
@code{Lisp_@var{type}} for a corresponding structure.
@@ -5209,7 +5209,7 @@
@strong{Convention}: Global variables whose names begin with @samp{V}
are variables that contain Lisp objects. The convention here is that
all global variables of type @code{Lisp_Object} begin with @samp{V}, and
-no others do (not even integer and boolean variables that have Lisp
+no others do (not even fixnum and boolean variables that have Lisp
equivalents). Most of the time, these variables have equivalents in
Lisp, which are defined via the @samp{DEFVAR} family of macros, but some
don't. Since the variable's value is a @code{Lisp_Object}, it can be
@@ -5722,7 +5722,7 @@
Global variables whose names begin with @samp{V} are variables that
contain Lisp objects. The convention here is that all global variables
of type @code{Lisp_Object} begin with @samp{V}, and all others don't
-(including integer and boolean variables that have Lisp
+(including fixnum and boolean variables that have Lisp
equivalents). Most of the time, these variables have equivalents in
Lisp, but some don't. Those that do are declared this way by a call to
@code{DEFVAR_LISP()} in the @code{vars_of_*()} initializer for the
@@ -7502,8 +7502,8 @@
The basic Lisp objects are
@table @code
-@item integer
-31 bits of precision, or 63 bits on 64-bit machines; the
+@item fixnum
+An integer with 31 bits of precision, or 63 bits on 64-bit machines; the
reason for this is described below when the internal Lisp object
representation is described.
@item char
@@ -7516,22 +7516,16 @@
of the char; this way, if the mapping between chars and integers
changes, which is quite possible for Kanji characters and other extended
characters, the same character will still be created. Note that some
-primitives confuse chars and integers. The worst culprit is @code{eq},
-which makes a special exception and considers a char to be @code{eq} to
-its integer equivalent, even though in no other case are objects of two
-different types @code{eq}. The reason for this monstrosity is
-compatibility with existing code; the separation of char from integer
-came fairly recently.)
+primitives confuse chars and fixnum.
@item float
Same precision as a double in C.
@item bignum
@itemx ratio
@itemx bigfloat
As build-time options, arbitrary-precision numbers are available.
-Bignums are integers, and when available they remove the restriction on
-buffer size. Ratios are non-integral rational numbers. Bigfloats are
-arbitrary-precision floating point numbers, with precision specified at
-runtime.
+Bignums are integers. Ratios are non-integral rational numbers.
+Bigfloats are arbitrary-precision floating point numbers, with
+precision specified at runtime.
@item symbol
An object that contains Lisp objects and is referred to by name;
symbols are used to implement variables and named functions
@@ -7642,7 +7636,7 @@
representation that is optimized to the way characters are represented
as integers.
@item range-table
-An object that maps from ranges of integers to arbitrary Lisp objects.
+An object that maps from ranges of fixnums to arbitrary Lisp objects.
@end table
And some strange special-purpose objects:
@@ -7869,13 +7863,13 @@
[ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ]
<---------------------------------------------------------> <->
- a pointer to a structure, or an integer tag
+ a pointer to a structure, or a fixnum tag
@end example
A tag of 00 is used for all pointer object types, a tag of 10 is used
for characters, and the other two tags 01 and 11 are joined together to
-form the integer object type. This representation gives us 31 bit
-integers and 30 bit characters, while pointers are represented directly
+form the fixnum object type. This representation gives us 31 bit
+fixnums and 30 bit characters, while pointers are represented directly
without any bit masking or shifting. This representation, though,
assumes that pointers to structs are always aligned to multiples of 4,
so the lower 2 bits are always zero.
@@ -7899,7 +7893,7 @@
@code{XSTRING()}, @code{XSYMBOL()}, do any required bit shifting and/or
masking and cast it to the appropriate type. @code{XFIXNUM()} needs to be
a bit tricky so that negative numbers are properly sign-extended. Since
-integers are stored left-shifted, if the right-shift operator does an
+fixnums are stored left-shifted, if the right-shift operator does an
arithmetic shift (i.e. it leaves the most-significant bit as-is rather
than shifting in a zero, so that it mimics a divide-by-two even for
negative numbers) the shift to remove the tag bit is enough. This is
@@ -7918,7 +7912,7 @@
(@var{lvalue}, @var{result})}, i.e. they have to be a statement rather
than just used in an expression. The reason for this is that standard C
doesn't let you ``construct'' a structure (but GCC does). Granted, this
-sometimes isn't too convenient; for the case of integers, at least, you
+sometimes isn't too convenient; for the case of fixnums, at least, you
can use the function @code{make_fixnum()}, which constructs and
@emph{returns} an integer Lisp object. Note that the
@code{XSET@var{TYPE}()} macros are also affected by
@@ -7950,7 +7944,7 @@
* Garbage Collection::
* GCPROing::
* Garbage Collection - Step by Step::
-* Integers and Characters::
+* Fixnums and Characters::
* Allocation from Frob Blocks::
* lrecords::
* Low-level allocation::
@@ -7993,7 +7987,7 @@
@itemize @bullet
@item
(a) Those for whom the value directly represents the contents of the
-Lisp object. Only two types are in this category: integers and
+Lisp object. Only two types are in this category: fixnums and
characters. No special allocation or garbage collection is necessary
for such objects. Lisp objects of these types do not need to be
@code{GCPRO}ed.
@@ -8234,7 +8228,7 @@
it obviates the need for @code{GCPRO}ing, and allows garbage collection
to happen at any point at all, such as during object allocation.
-@node Garbage Collection - Step by Step, Integers and Characters, GCPROing, Allocation of Objects in XEmacs Lisp
+@node Garbage Collection - Step by Step, Fixnums and Characters, GCPROing, Allocation of Objects in XEmacs Lisp
@section Garbage Collection - Step by Step
@cindex garbage collection - step by step
@@ -8504,8 +8498,8 @@
@cindex @code{mark_object}
The first thing that is checked while marking an object is whether the
-object is a real Lisp object @code{Lisp_Type_Record} or just an integer
-or a character. Integers and characters are the only two types that are
+object is a real Lisp object @code{Lisp_Type_Record} or just a fixnum
+or a character. Fixnums and characters are the only two types that are
stored directly - without another level of indirection, and therefore they
don't have to be marked and collected.
@xref{How Lisp Objects Are Represented in C}.
@@ -8730,18 +8724,19 @@
In addition, the bookkeeping information used for garbage
collector's output purposes is updated.
-@node Integers and Characters, Allocation from Frob Blocks, Garbage Collection - Step by Step, Allocation of Objects in XEmacs Lisp
-@section Integers and Characters
+@node Fixnums and Characters, Allocation from Frob Blocks, Garbage Collection - Step by Step, Allocation of Objects in XEmacs Lisp
+@section Fixnums and Characters
@cindex integers and characters
@cindex characters, integers and
-
-Integer and character Lisp objects are created from integers using the
+@cindex fixnum and characters
+
+Fixnum and character Lisp objects are created from C integers using the
functions @code{make_fixnum()} and @code{make_char()}. (These are actually
macros on most systems.) These functions basically just do some moving
of bits around, since the integral value of the object is stored
directly in the @code{Lisp_Object}.
-@node Allocation from Frob Blocks, lrecords, Integers and Characters, Allocation of Objects in XEmacs Lisp
+@node Allocation from Frob Blocks, lrecords, Fixnums and Characters, Allocation of Objects in XEmacs Lisp
@section Allocation from Frob Blocks
@cindex allocation from frob blocks
@cindex frob blocks, allocation from
@@ -26219,10 +26214,10 @@
unicode vector or list of codes charset-offset
@end example
- Establishes a mapping between a unicode codepoint (an integer) and
+ Establishes a mapping between a unicode codepoint (a fixnum) and
one or more chars in a charset. The mapping is automatically
established in both directions. Chars in a charset can be specified
- either with an actual character or a codepoint (i.e. an integer)
+ either with an actual character or a codepoint (i.e. an fixnum)
and the charset it's within. If a sequence of chars or charset
points is given, multiple mappings are established for consecutive
unicode codepoints starting with the given one. Charset codepoints
diff -r 56144c8593a8 -r 873d7425c1ad src/ChangeLog
--- a/src/ChangeLog Sun Oct 09 09:51:57 2011 +0100
+++ b/src/ChangeLog Sun Oct 09 10:39:09 2011 +0100
@@ -1,3 +1,13 @@
+2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Do a couple of non-mechanical things that would otherwise have
+ been included in the last change.
+ * data.c:
+ * data.c (Ftype_of):
+ Return Qfixnum for fixnums, not Qinteger.
+ * lisp.h (MOST_POSITIVE_FIXNUM):
+ Delete an obsolete comment here.
+
2011-10-09 Aidan Kehoe <kehoea(a)parhasard.net>
* EmacsFrame.c (EmacsFrameSetValues):
diff -r 56144c8593a8 -r 873d7425c1ad src/data.c
--- a/src/data.c Sun Oct 09 09:51:57 2011 +0100
+++ b/src/data.c Sun Oct 09 10:39:09 2011 +0100
@@ -564,7 +564,7 @@
case Lisp_Type_Char: return Qcharacter;
- default: return Qinteger;
+ default: return Qfixnum;
}
}
diff -r 56144c8593a8 -r 873d7425c1ad src/lisp.h
--- a/src/lisp.h Sun Oct 09 09:51:57 2011 +0100
+++ b/src/lisp.h Sun Oct 09 10:39:09 2011 +0100
@@ -1677,10 +1677,6 @@
#define FIXNUM_VALBITS (BITS_PER_EMACS_INT - FIXNUM_GCBITS)
#define VALBITS (BITS_PER_EMACS_INT - GCBITS)
-/* This is badly named; it's not the maximum value that an EMACS_INT can
- have, it's the maximum value that a Lisp-visible fixnum can have (half
- the maximum value an EMACS_INT can have) and as such would be better
- called MOST_POSITIVE_FIXNUM. Similarly for MOST_NEGATIVE_FIXNUM. */
#define MOST_POSITIVE_FIXNUM ((EMACS_INT) ((1UL << (FIXNUM_VALBITS - 1)) -1UL))
#define MOST_NEGATIVE_FIXNUM (-(MOST_POSITIVE_FIXNUM) - 1)
/* WARNING: evaluates its arg twice. */
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches