* Package Terminology:: Understanding different kinds of packages.
* Using Packages:: How to install and use packages.
* Building Packages:: Building packages from sources.
+* Creating Packages:: The basics.
* Available Packages:: A brief, out-of-date, directory of packaged LISP.
@end menu
@end enumerate
-@node Building Packages, Available Packages, Using Packages, Packages
+@node Building Packages, Creating Packages, Using Packages, Packages
@comment node-name, next, previous, up
Source packages are available from the @file{packages/source-packages}
of TeXinfo documentation if present.
@item srckit
-Usually aliased to @code{make srckit-std}. This does a @code{make
+Usually aliased to @code{srckit-std}. This does a @code{make
distclean} and creates a package source tarball in the staging
directory. This is generally only of use for package maintainers.
@end table
-@node Available Packages, , Building Packages, Packages
+@node Creating Packages, Available Packages, Building Packages, Packages
+@comment node-name, next, previous, up
+
+Creating a package from an existing Lisp library is not very difficult.
+
+In addition to the Lisp libraries themselves, you need a
+@file{package-info.in} file and a simple @file{Makefile}. The rest is
+done by @file{XEmacs.rules}, part of the packaging system
+infrastructure.
+
+@file{package-info.in} contains a single Lisp form like this:
+
+@example
+(name ; your package's name
+ (standards-version 1.1
+ version VERSION
+ author-version AUTHOR_VERSION
+ date DATE
+ build-date BUILD_DATE
+ maintainer MAINTAINER
+ distribution xemacs ; change to "mule" if MULE is needed
+ priority high
+ category CATEGORY
+ dump nil
+ description "description" ; a one-line description string
+ filename FILENAME
+ md5sum MD5SUM
+ size SIZE
+ provides (feature1 feature2) ; one for every `provides' form
+ requires (REQUIRES)
+ type regular
+))
+@end example
+
+You must fill in the four commented lines. The value of @code{name} is
+the name of your package as an unquoted symbol. Normally it is the name
+of the main Lisp file or principal feature provided. The allowed values
+for distribution are @code{xemacs} and @code{mule}. Write them as
+unquoted symbols. The @code{description} is a quoted Lisp string; use
+the usual conventions. The value for @code{provides} is a list of
+feature symbols (written unquoted). All of the features provided by
+libraries in your package should be elements of this list. Implementing
+an automatic method for generating the @file{provides} line is
+desirable, but as yet undone.
+
+The variables in upper-case are references to variables set in the
+@file{Makefile} or automatically generated. Do not change them; they
+are automatically filled in by the build process.
+
+The remaining lines refer to implementation constants
+(@code{standards-version}), or features that are unimplemented or have
+been removed (@code{priority} and @code{dump}). The @code{type} line is
+not normally relevant to external maintainers; the alternate value is
+@code{single-file}, which refers to packages consed up out of a number
+of single-file libraries that are more or less thematically related. An
+example is @code{prog-modes}. Single-file packages are basically for
+administrative convenience, and new packages should generally be created
+as regular packages.
+
+The @file{Makefile} is quite stylized. The idea is similar to an
+@file{Imakefile} or an @code{automake} file: the complexity is hidden in
+generic rules files, in this case the @file{XEmacs.rules} include file
+in the top directory of the packages hierarchy. Although a number of
+facilities are available for complex libraries, most simple packages'
+@file{Makefile}s contain a copyright notice, a few variable definitions,
+an include for @file{XEmacs.rules}, and a couple of standard targets.
+
+The first few @code{make} variables defined are @code{VERSION},
+@code{AUTHOR_VERSION}, @code{MAINTAINER}, @code{PACKAGE},
+@code{PKG_TYPE}, @code{REQUIRES}, and @code{CATEGORY}. All but one were
+described in the description of @file{package-info.in}. The last is an
+admistrative grouping. Current categories include @code{comm},
+@code{games}, @code{libs}, @code{mule}, @code{oa}, @code{os},
+@code{prog}, and @code{wp}. @ref{Available Packages}, for a list of
+categories.
+
+Next, define the variable @code{ELCS}. This contains the list of the
+byte-compiled Lisp files used by the package. These files and their
+@file{.el} versions will be included in the binary package. If there
+are other files (such as extra Lisp sources or an upstream
+@file{Makefile}) that are normally placed in the installed Lisp
+directory, but not byte-compiled, they can be listed as the value of
+@code{EXTRA_SOURCES}.
+
+The include is simply
+@example
+include ../../XEmacs.rules
+@end example
+
+The standard targets follow. These are
+
+@example
+all:: $(ELCS) auto-autoloads.elc
+
+srckit: srckit-alias
+
+binkit: binkit-alias
+@end example
+
+Other targets (such as Texinfo sources) may need to be added as
+dependencies for the @code{all} target. Dependencies for @code{srckit}
+and @code{binkit} (that is, values for @var{srckit-alias} and
+@var{binkit-alias}) are defined in @file{XEmacs.rules}. The most useful
+of these values are given in the following table.
+
+@table @var
+@item srckit-alias
+Usually set to @code{srckit-std}.
+
+@item binkit-alias
+May be set to @code{binkit-sourceonly}, @code{binkit-sourceinfo},
+@code{binkit-sourcedata}, or
+@code{binkit-sourcedatainfo}. @code{sourceonly} indicates there is
+nothing to install in a data directory or info directory.
+@code{sourceinfo} indicates that source and info files are to be
+installed. @code{sourcedata} indicates that source and etc (data) files
+are to be installed. @code{sourcedatainfo} indicates source, etc
+(data), and info files are to be installed.
+@end table
+
+Data files include things like pixmaps for a package-specific toolbar,
+and are normally installed in @file{etc/@var{PACKAGE_NAME}}. A few
+packages have needs beyond the basic templates. See @file{XEmacs.rules}
+or a future revision of this manual for details.
+
+@node Available Packages, , Creating Packages, Packages
@comment node-name, next, previous, up
This section is surely out-of-date. If you're sure that XEmacs is
+2000-12-31 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.39 is released.
+
2000-12-05 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.38 is released.
+2000-12-31 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.39 is released.
+
+2000-12-29 Andy Piper <andy@xemacs.org>
+
+ * menubar.c (menubar_visible_p_changed): signal the frame changed.
+
+ * glyphs-x.c (x_redisplay_widget): Re-calculate widget offsets if
+ the frame has changed so that we pick up geometry changes such as
+ menubar visibility.
+
+2000-12-28 Andy Piper <andy@xemacs.org>
+
+ * lastfile.c (my_ebss): make a char array so we can pad the
+ bss. Fixes cygwin unexec.
+
+ * unexcw.c: invert BROKEN_GDB to NO_DEBUG.
+
+2000-12-26 Andy Piper <andy@xemacs.org>
+
+ * event-Xt.c (emacs_Xt_force_event_pending): add some verbose
+ comments and try and be more precise about a non-/SIGIO world.
+ (emacs_Xt_event_pending_p): use XtAppPending under cygwin and non
+ SIGIO.
+
+ * redisplay-output.c (redisplay_normalize_glyph_area): make sure
+ we don't normalize to zero width or height.
+
+2000-12-24 Andy Piper <andy@xemacs.org>
+
+ * Makefile.in.in (ldflags): add -mwindows when appropriate.
+
+2000-08-18 Golubev I. N. <gin@mo.msk.ru>
+
+ * s/sco5.h: SCO 5 has pty support.
+
+2000-07-20 Kazuyuki IENAGA <ienaga@xemacs.org>
+
+ * input-method-xlib.c: supports both XIM_XLIB and USE_XFONTSET.
+ input-method-xlib.c contains whole contents of input-method-xfs.c,
+ so we can use input-method-xlib.c's code for USE_XFONTSET
+ using #ifdefs.
+ * input-method-xfs.c: removed.
+
+2000-12-20 Stephen Turnbull <stephen@xemacs.org>
+
+ * file-coding.h (enum coding_category_type): reorder enumerators to
+ make autodetection safer. Make CODING_CATEGORY_LAST an enumerator
+ (now one greater than largest real coding_category_type enumerator).
+ * file-coding.c (coding_category_symbol, coding_category_by_priority,
+ coding_category_system, fcd_descriptihon_1, decode_coding_category,
+ Fcoding_category_list, Fset_coding_priority_list,
+ Fcoding_priority_list, coding_system_from_mask, Fdetect_coding_region,
+ vars_of_file_coding): adjust for change in CODING_CATEGORY_LAST.
+
+2000-12-18 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * redisplay-output.c (redisplay_clear_top_of_window): Remove static.
+ * redisplay-output.c (redisplay_output_window): Clear top of window
+ when face is changed.
+ * redisplay-x.c (x_redraw_exposed_window): Call
+ redisplay_clear_top_of_window.
+ * redisplay.h: Publish redisplay_clear_top_of_window.
+
+2000-12-18 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * buffer.c (Fkill_buffer): Map over all devices.
+ * window.c (window_loop): Remove UNSHOW_BUFFER code.
+ (list_windows): New function.
+ (list_all_windows): Ditto.
+ (Freplace_buffer_in_windows): Use them.
+
+2000-02-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp>
+
+ * database.c (berkdb_subtype): Recognize new subtype `queue'.
+ (Fopen_database): Use `db_create' instead of `db_open'.
+ (syms_of_database): Initialize Qqueue.
+
+2000-12-13 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * buffer.c (common_init_complex_vars_of_buffer): Initialize
+ buffer_local_face_property.
+ * buffer.h (struct buffer): New member buffer_local_face_property.
+ * window.c (Fset_window_buffer): Mark window's face as changed
+ when buffer has buffer local face.
+ * window.h (MARK_WINDOW_FACES_CHANGED): New macro.
+ * objects.c (color_after_change): Set buffer_local_face_property
+ when locale of face specifier is buffer.
+ * objects.c (font_after_change): Ditto.
+ * objects.c (face_boolean_after_change): Ditto.
+ * glyphs.c (image_after_change): Ditto.
+
+2000-12-09 Dan Holmsand <dan@eyebee.com>
+
+ * nt.c (mswindows_fstat): Report file permissions, volume serial
+ number, etc. Code adapted from FSF Emacs 20.7.
+
+2000-12-09 Dan Holmsand <dan@eyebee.com>
+
+ * sysfile.h (lstat): Make lstat an alias for xemacs_stat instead
+ of stat when we don't have symbolic links, to make sure
+ mswindows_stat is called on mswindows.
+
+2000-12-12 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * alloca.c: Define malloc to xmalloc only when built with XEmacs.
+
+2000-12-12 Martin Buchholz <martin@xemacs.org>
+
+ * doprnt.c (emacs_doprnt_1): More printing fixes.
+ Make printing of numbers compatible with libc and FSF Emacs.
+ BUG was: (format "%6.3f" 1.2) ==>"1.200000"
+ Use the system printf to do most of the hard work of formatting,
+ instead of doprnt_1().
+ Calculate memory to allocate for format string.
+ Remove arbitrary limit on precision, e.g. (format "%.1000f" 3.14)
+ (doprnt_1): Cleaner code and documentation.
+
+2000-12-01 Jerry James <james@eecs.ukans.edu>
+
+ * Makefile.in.in: Use the loop variable to install headers.
+
+2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * window.c (Fsplit_window): Don't invalidate face cache.
+
+2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * minibuf.c (Fall_completions): Undo the previous change
+ which removed checking elements start with space.
+
+2000-12-06 Stephen Turnbull <stephen@xemacs.org>
+
+ * mule-canna.c: Didier suppression.
+
+2000-12-06 Stephen Turnbull <stephen@xemacs.org>
+
+ * mule-canna.c: rename static unsigned char buf[] to key_buffer
+ (warning suppression). Add English comment translations.
+
+2000-12-05 Martin Buchholz <martin@xemacs.org>
+
+ * unexelfsgi.c (unexec): Better test for mmap failure.
+
2000-12-05 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.38 is released.
2000-12-05 Martin Buchholz <martin@xemacs.org>
+ * redisplay.c (bar-cursor): Make a user variable.
+
* symsinit.h: Add init_postgresql_from_environment.
2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org>
cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
cflags = $(CFLAGS) $(cppflags)
+#if defined (WIN32_NATIVE) || defined (CYGWIN)
+ldflags = $(LDFLAGS) -mwindows $(ld_switch_all) $(ld_dynamic_link_flags)
+#else
ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
+#endif
#ifdef SOLARIS2
%.o : %.c
cd ${srcdir}; hdrdir2=`pwd`; cd $$hdir; \
test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \
(for thisdir in $$hdir; do \
- cd $$hdir && \
+ cd $$thisdir && \
(hdrtars=; \
for hdrfile in *.h; do \
hdrtars="$$hdrtars $$hdrfile"; \
Callers below should use malloc. */
-#ifndef emacs
+#ifdef emacs
#define malloc xmalloc
#endif
#ifndef WIN32_NATIVE
/* #### This is a problem if this buffer is in a dedicated window.
Need to undedicate any windows of this buffer first (and delete them?)
*/
- Freplace_buffer_in_windows (buf, Qnil, Qnil);
+ GCPRO1 (buf);
+ Freplace_buffer_in_windows (buf, Qnil, Qall);
+ UNGCPRO;
font_lock_buffer_was_killed (b);
defs->auto_save_modified = 0;
defs->auto_save_failure_time = -1;
defs->invisibility_spec = Qt;
+ defs->buffer_local_face_property = 0;
defs->indirect_children = Qnil;
syms->indirect_children = Qnil;
int face_change; /* This is set when a change in how the text should
be displayed (e.g., font, color) is made. */
+ /* Whether buffer specific face is specified. */
+ int buffer_local_face_property;
+
/* change data indicating what portion of the text has changed
since the last time this was reset. Used by redisplay.
Logically we should keep this with the text structure, but
#endif /* DB_VERSION_MAJOR */
Lisp_Object Qberkeley_db;
Lisp_Object Qhash, Qbtree, Qrecno, Qunknown;
+#if DB_VERSION_MAJOR > 2
+Lisp_Object Qqueue;
+#endif
#endif /* HAVE_BERKELEY_DB */
#ifdef HAVE_DBM
case DB_BTREE: return Qbtree;
case DB_HASH: return Qhash;
case DB_RECNO: return Qrecno;
+#if DB_VERSION_MAJOR > 2
+ case DB_QUEUE: return Qqueue;
+#endif
default: return Qunknown;
}
}
real_subtype = DB_BTREE;
else if (EQ (subtype, Qrecno))
real_subtype = DB_RECNO;
+#if DB_VERSION_MAJOR > 2
+ else if (EQ (subtype, Qqueue))
+ real_subtype = DB_QUEUE;
+#endif
else
signal_simple_error ("Unsupported subtype", subtype);
if (strchr (acc, 'r') && !strchr (acc, 'w'))
accessmask |= DB_RDONLY;
}
+#if DB_VERSION_MAJOR == 2
status = db_open (filename, real_subtype, accessmask,
modemask, NULL , NULL, &dbase);
if (status)
return Qnil;
+#else
+ status = db_create (&dbase, NULL, 0);
+ if (status)
+ return Qnil;
+ status = dbase->open (dbase, filename, NULL,
+ real_subtype, accessmask, modemask);
+ if (status)
+ {
+ dbase->close (dbase, 0);
+ return Qnil;
+ }
+#endif /* DB_VERSION_MAJOR > 2 */
+ /* Normalize into system specific file modes. Only for printing */
+ accessmask = accessmask & DB_RDONLY ? O_RDONLY : O_RDWR;
#endif /* DB_VERSION_MAJOR */
db = allocate_database ();
defsymbol (&Qhash, "hash");
defsymbol (&Qbtree, "btree");
defsymbol (&Qrecno, "recno");
+#if DB_VERSION_MAJOR > 2
+ defsymbol (&Qqueue, "queue");
+#endif
defsymbol (&Qunknown, "unknown");
#endif
indent.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h systime.h syswindows.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h
-input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h
keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
+lastfile.o: config.h
libsst.o: $(LISP_H) libsst.h
line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h line-number.h mule-charset.h
linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h
unexalpha.o: config.h
unexapollo.o: config.h
unexconvex.o: config.h getpagesize.h
-unexcw.o: config.h sysfile.h
+unexcw.o: $(LISP_H) sysfile.h
unexec.o: $(LISP_H) getpagesize.h
unexelf.o: config.h
unexelfsgi.o: config.h
Dynarr_declare (union printf_arg);
} printf_arg_dynarr;
-/* Append STRING (of length LEN) to STREAM. MINLEN is the minimum field
- width. If MINUS_FLAG is set, left-justify the string in its field;
- otherwise, right-justify. If ZERO_FLAG is set, pad with 0's; otherwise
- pad with spaces. If MAXLEN is non-negative, the string is first
- truncated to that many character.
+/* Append STRING (of length LEN bytes) to STREAM.
+ MINLEN is the minimum field width.
+ If MINUS_FLAG is set, left-justify the string in its field;
+ otherwise, right-justify.
+ If ZERO_FLAG is set, pad with 0's; otherwise pad with spaces.
+ If MAXLEN is non-negative, the string is first truncated on the
+ right to that many characters.
Note that MINLEN and MAXLEN are Charcounts but LEN is a Bytecount. */
doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len,
Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag)
{
- Charcount cclen;
- Bufbyte pad;
Lstream *lstr = XLSTREAM (stream);
-
- cclen = bytecount_to_charcount (string, len);
-
- if (zero_flag)
- pad = '0';
- else
- pad = ' ';
+ Charcount cclen = bytecount_to_charcount (string, len);
+ int to_add = minlen - cclen;
/* Padding at beginning to right-justify ... */
- if (minlen > cclen && !minus_flag)
- {
- int to_add = minlen - cclen;
- while (to_add > 0)
- {
- Lstream_putc (lstr, pad);
- to_add--;
- }
- }
+ if (!minus_flag)
+ while (to_add-- > 0)
+ Lstream_putc (lstr, zero_flag ? '0' : ' ');
- if (maxlen >= 0)
- len = charcount_to_bytecount (string, min (maxlen, cclen));
+ if (0 <= maxlen && maxlen < cclen)
+ len = charcount_to_bytecount (string, maxlen);
Lstream_write (lstr, string, len);
/* Padding at end to left-justify ... */
- if (minlen > cclen && minus_flag)
- {
- int to_add = minlen - cclen;
- while (to_add > 0)
- {
- Lstream_putc (lstr, pad);
- to_add--;
- }
- }
+ if (minus_flag)
+ while (to_add-- > 0)
+ Lstream_putc (lstr, zero_flag ? '0' : ' ');
}
static const Bufbyte *
}
else
{
- char text_to_print[500];
+ /* ASCII Decimal representation uses 2.4 times as many
+ bits as machine binary. */
+ char *text_to_print =
+ alloca_array (char, 32 +
+ max (spec->minwidth,
+ max (sizeof (double), sizeof (long)) * 3 +
+ max (spec->precision, 0)));
char constructed_spec[100];
char *p = constructed_spec;
- /* Partially reconstruct the spec and use sprintf() to
+ /* Mostly reconstruct the spec and use sprintf() to
format the string. */
- /* Make sure nothing stupid happens */
- /* DO NOT REMOVE THE (int) CAST! Incorrect results will
- follow! */
- spec->precision = min (spec->precision,
- (int) (sizeof (text_to_print) - 50));
-
*p++ = '%';
if (spec->plus_flag) *p++ = '+';
if (spec->space_flag) *p++ = ' ';
if (spec->number_flag) *p++ = '#';
+ if (spec->minus_flag) *p++ = '-';
+ if (spec->zero_flag) *p++ = '0';
- if (spec->precision >= 0 && !spec->minwidth)
+ if (spec->minwidth >= 0)
+ p = long_to_string (p, spec->minwidth);
+ if (spec->precision >= 0)
{
*p++ = '.';
p = long_to_string (p, spec->precision);
}
-
- /* sprintf the mofo */
- /* we have to use separate calls to sprintf(), rather than
- a single big conditional, because of the different types
- of the arguments */
+
if (strchr (double_converters, ch))
{
*p++ = ch;
}
else
{
- if (spec->zero_flag && spec->minwidth)
- sprintf (p, "0%dl%c", spec->minwidth, ch);
- else
- sprintf (p, "l%c", ch);
+ *p++ = 'l'; /* Always use longs with sprintf() */
+ *p++ = ch;
+ *p++ = '\0';
if (strchr (unsigned_int_converters, ch))
sprintf (text_to_print, constructed_spec, arg.ul);
}
doprnt_1 (stream, (Bufbyte *) text_to_print,
- strlen (text_to_print),
- spec->minwidth, -1, spec->minus_flag, spec->zero_flag);
+ strlen (text_to_print), 0, -1, 0, 0);
}
}
}
}
}
+/* #### I'm struggling to understand how the X event loop really works.
+ Here is the problem:
+
+ When widgets get mapped / changed etc the actual display updates
+ are done asynchronously via X events being processed - this
+ normally happens when XtAppProcessEvent() gets called. However, if
+ we are executing lisp code or even doing redisplay we won't
+ necessarily process X events for a very long time. This has the
+ effect of widgets only getting updated when XEmacs only goes into
+ idle, or some other event causes processing of the X event queue.
+
+ XtAppProcessEvent can get called from the following places:
+
+ emacs_Xt_next_event () - this is normal event processing, almost
+ any non-X event will take precedence and this means that we
+ cannot rely on it to do the right thing at the right time for
+ widget display.
+
+ drain_X_queue () - this happens when SIGIO gets tripped,
+ processing the event queue allows C-g to be checked for. It gets
+ called from emacs_Xt_event_pending_p ().
+
+ In order to solve this I have tried introducing a list primitive -
+ dispatch-non-command-events - which forces processing of X events
+ related to display. Unfortunately this has a number of problems,
+ one is that it is possible for event_stream_event_pending_p to
+ block for ever if there isn't actually an event. I guess this can
+ happen if we drop the synthetic event for reason. It also relies on
+ SIGIO processing which makes things rather fragile.
+
+ People have seen behaviour whereby XEmacs blocks until you move the
+ mouse. This seems to indicate that dispatch-non-command-events is
+ blocking. It may be that in a SIGIO world forcing SIGIO processing
+ does the wrong thing.
+*/
static void
emacs_Xt_force_event_pending (struct frame* f)
{
/* Send the drop message */
XSendEvent(dpy, XtWindow (FRAME_X_SHELL_WIDGET (f)),
True, NoEventMask, &event);
- /* Force event pending to check the X queue. */
- quit_check_signal_tick_count++;
+ /* We rely on SIGIO and friends to realise we have generated an
+ event. */
}
static void
/* quit_check_signal_tick_count is volatile so try to avoid race conditions
by using a temporary variable */
tick_count_val = quit_check_signal_tick_count;
- if (last_quit_check_signal_tick_count != tick_count_val)
+ if (last_quit_check_signal_tick_count != tick_count_val
+#if !defined (SIGIO) || defined (CYGWIN)
+ || (XtIMXEvent & XtAppPending (Xt_app_con))
+#endif
+ )
{
last_quit_check_signal_tick_count = tick_count_val;
Lisp_Object Vfile_name_coding_system;
/* Table of symbols identifying each coding category. */
-Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1];
+Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST];
struct file_coding_dump {
/* Coding system currently associated with each coding category. */
- Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1];
+ Lisp_Object coding_category_system[CODING_CATEGORY_LAST];
/* Table of all coding categories in decreasing order of priority.
This describes a permutation of the possible coding categories. */
- int coding_category_by_priority[CODING_CATEGORY_LAST + 1];
+ int coding_category_by_priority[CODING_CATEGORY_LAST];
#ifdef MULE
Lisp_Object ucs_to_mule_table[65536];
} *fcd;
static const struct lrecord_description fcd_description_1[] = {
- { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST + 1 },
+ { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST },
#ifdef MULE
{ XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), countof (fcd->ucs_to_mule_table) },
#endif
int i;
CHECK_SYMBOL (symbol);
- for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+ for (i = 0; i < CODING_CATEGORY_LAST; i++)
if (EQ (coding_category_symbol[i], symbol))
return i;
int i;
Lisp_Object list = Qnil;
- for (i = CODING_CATEGORY_LAST; i >= 0; i--)
+ for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--)
list = Fcons (coding_category_symbol[i], list);
return list;
}
*/
(list))
{
- int category_to_priority[CODING_CATEGORY_LAST + 1];
+ int category_to_priority[CODING_CATEGORY_LAST];
int i, j;
Lisp_Object rest;
/* First generate a list that maps coding categories to priorities. */
- for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+ for (i = 0; i < CODING_CATEGORY_LAST; i++)
category_to_priority[i] = -1;
/* Highest priority comes from the specified list. */
/* Now go through the existing categories by priority to retrieve
the categories not yet specified and preserve their priority
order. */
- for (j = 0; j <= CODING_CATEGORY_LAST; j++)
+ for (j = 0; j < CODING_CATEGORY_LAST; j++)
{
int cat = fcd->coding_category_by_priority[j];
if (category_to_priority[cat] < 0)
/* Now we need to construct the inverse of the mapping we just
constructed. */
- for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+ for (i = 0; i < CODING_CATEGORY_LAST; i++)
fcd->coding_category_by_priority[category_to_priority[i]] = i;
/* Phew! That was confusing. */
int i;
Lisp_Object list = Qnil;
- for (i = CODING_CATEGORY_LAST; i >= 0; i--)
+ for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--)
list = Fcons (coding_category_symbol[fcd->coding_category_by_priority[i]],
list);
return list;
#endif
/* Look through the coding categories by priority and find
the first one that is allowed. */
- for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+ for (i = 0; i < CODING_CATEGORY_LAST; i++)
{
cat = fcd->coding_category_by_priority[i];
if ((mask & (1 << cat)) &&
#ifdef MULE
decst.mask = postprocess_iso2022_mask (decst.mask);
#endif
- for (i = CODING_CATEGORY_LAST; i >= 0; i--)
+ for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--)
{
int sys = fcd->coding_category_by_priority[i];
if (decst.mask & (1 << sys))
If CHECK_INVALID_CHARSETS is non-zero, check for designation
or invocation of an invalid character set and treat that as
- an unrecognized escape sequence. */
+ an unrecognized escape sequence.
+
+ ********************************************************************
+
+ #### Strategies for error annotation and coding orthogonalization
+
+ We really want to separate out a number of things. Conceptually,
+ there is a nested syntax.
+
+ At the top level is the ISO 2022 extension syntax, including charset
+ designation and invocation, and certain auxiliary controls such as the
+ ISO 6429 direction specification. These are octet-oriented, with the
+ single exception (AFAIK) of the "exit Unicode" sequence which uses the
+ UTF's natural width (1 byte for UTF-7 and UTF-8, 2 bytes for UCS-2 and
+ UTF-16, and 4 bytes for UCS-4 and UTF-32). This will be treated as a
+ (deprecated) special case in Unicode processing.
+
+ The middle layer is ISO 2022 character interpretation. This will depend
+ on the current state of the ISO 2022 registers, and assembles octets
+ into the character's internal representation.
+
+ The lowest level is translating system control conventions. At present
+ this is restricted to newline translation, but one could imagine doing
+ tab conversion or line wrapping here. "Escape from Unicode" processing
+ would be done at this level.
+
+ At each level the parser will verify the syntax. In the case of a
+ syntax error or warning (such as a redundant escape sequence that affects
+ no characters), the parser will take some action, typically inserting the
+ erroneous octets directly into the output and creating an annotation
+ which can be used by higher level I/O to mark the affected region.
+
+ This should make it possible to do something sensible about separating
+ newline convention processing from character construction, and about
+ preventing ISO 2022 escape sequences from being recognized
+ inappropriately.
+
+ The basic strategy will be to have octet classification tables, and
+ switch processing according to the table entry.
+
+ It's possible that, by doing the processing with tables of functions or
+ the like, the parser can be used for both detection and translation. */
static int
parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso,
dumpstruct (&fcd, &fcd_description);
/* Initialize to something reasonable ... */
- for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+ for (i = 0; i < CODING_CATEGORY_LAST; i++)
{
fcd->coding_category_system[i] = Qnil;
fcd->coding_category_by_priority[i] = i;
#define ISO_CODE_CSI 0x9B /* control-sequence-introduce */
#endif /* MULE */
-/* For detecting the encoding of text */
+/* Distinguishable categories of encodings.
+
+ This list determines the initial priority of the categories.
+
+ For better or worse, currently Mule files are encoded in 7-bit ISO 2022.
+ For this reason, under Mule ISO_7 gets highest priority.
+
+ Putting NO_CONVERSION second prevents "binary corruption" in the
+ default case in all but the (presumably) extremely rare case of a
+ binary file which contains redundant escape sequences but no 8-bit
+ characters.
+
+ The remaining priorities are based on perceived "internationalization
+ political correctness." An exception is UCS-4 at the bottom, since
+ basically everything is compatible with UCS-4, but it is likely to
+ be very rare as an external encoding. */
+
enum coding_category_type
{
+ /* must be a contiguous range of values 0 -- CODING_CATEGORY_LAST - 1 */
#ifdef MULE
- CODING_CATEGORY_SHIFT_JIS,
CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes,
no locking shift */
- CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes,
- no locking shift, no single shift,
- using designation to switch charsets */
+ CODING_CATEGORY_NO_CONVERSION,
+ CODING_CATEGORY_UTF8,
CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes,
no locking shift, no designation sequences,
one-dimension characters in the upper half. */
CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes,
no locking shift, no designation sequences,
two-dimension characters in the upper half. */
+ CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes,
+ no locking shift, no single shift,
+ using designation to switch charsets */
CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */
+ CODING_CATEGORY_SHIFT_JIS,
CODING_CATEGORY_BIG5,
CODING_CATEGORY_UCS4,
- CODING_CATEGORY_UTF8,
+#else /* not MULE */
+ CODING_CATEGORY_NO_CONVERSION,
#endif /* MULE */
- CODING_CATEGORY_NO_CONVERSION
+ CODING_CATEGORY_LAST /* not a real coding category */
};
-#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION
-
#ifdef MULE
#define CODING_CATEGORY_SHIFT_JIS_MASK \
(1 << CODING_CATEGORY_SHIFT_JIS)
x_map_subwindow (Lisp_Image_Instance *p, int x, int y,
struct display_glyph_area* dga)
{
+ assert (dga->width > 0 && dga->height > 0);
if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW)
{
Window subwindow = IMAGE_INSTANCE_X_SUBWINDOW_ID (p);
(Dimension)IMAGE_INSTANCE_HEIGHT (p));
}
+ /* Adjust offsets within the frame. */
+ if (XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed)
+ {
+ Arg al[2];
+ XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
+ XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
+ XtGetValues (FRAME_X_TEXT_WIDGET
+ (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2);
+ }
+
/* now modify the widget */
lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p),
wv, True);
Lisp_Object property =
IMAGE_SPECIFIER_ATTACHEE_PROPERTY (XIMAGE_SPECIFIER (specifier));
if (FACEP (attachee))
- face_property_was_changed (attachee, property, locale);
+ {
+ face_property_was_changed (attachee, property, locale);
+ if (BUFFERP (locale))
+ XBUFFER (locale)->buffer_local_face_property = 1;
+ }
else if (GLYPHP (attachee))
glyph_property_was_changed (attachee, property, locale);
}
#include "EmacsFrame.h"
#include "events.h"
-#ifndef XIM_XLIB
-#error XIM_XLIB is not defined??
+#if !defined (XIM_XLIB) && !defined (USE_XFONTSET)
+#error neither XIM_XLIB nor USE_XFONTSET is defined??
#endif
Lisp_Object Qxim_xlib;
#define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str);
#define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str);
+#ifdef XIM_XLIB /* XIM_XLIB specific */
/* Get/Set IC values for just one attribute */
#ifdef DEBUG_XEMACS
#define XIC_Value(Get_Set, xic, name, attr, value) \
"XIMPreeditNone|XIMStatusNone";
static XIMStyle best_style (XIMStyles *user, XIMStyles *xim);
+#endif /* XIM_XLIB only */
/* This function is documented, but no prototype in the header files */
EXTERN_C char * XSetIMValues(XIM, ...);
}
}
+#ifdef XIM_XLIB /* starting XIM specific codes */
+
/* Callbacks for IM are supported from X11R6 or later. */
#ifdef HAVE_XREGISTERIMINSTANTIATECALLBACK
}
}
#endif
+#endif /* XIM_XLIB only */
#if 0
/* Get a fontset for IM to use */
coming from libraries.
*/
+#include <config.h>
+
char my_edata[] = "End of Emacs initialized data";
-int my_ebss;
+/* Ensure there is enough slack in the .bss to pad with. */
+#ifdef HEAP_IN_DATA
+#define BSS_PADDING 0x1000
+#else
+#define BSS_PADDING 1
+#endif
+
+char my_ebss [BSS_PADDING];
+
Lisp_Object oldval)
{
MARK_MENUBAR_CHANGED;
+ /* This is to force subwindow offsets to be recalculated - see
+ x_redisplay_widget (). */
+ MARK_FRAME_CHANGED (WINDOW_XFRAME (w));
}
static void
if (STRINGP (eltstring)
&& (slength <= XSTRING_CHAR_LENGTH (eltstring))
- && (0 > scmp (XSTRING_DATA (eltstring),
+ /* Reject alternatives that start with space
+ unless the input starts with space. */
+ && ((XSTRING_CHAR_LENGTH (string) > 0 &&
+ string_char (XSTRING (string), 0) == ' ')
+ || string_char (XSTRING (eltstring), 0) != ' ')
+ && (0 > scmp (XSTRING_DATA (eltstring),
XSTRING_DATA (string),
slength)))
{
/* Synched up with: Mule 2.3. Not in FSF. */
-/* #### The comments in this file are mostly in EUC-formatted Japanese.
- It would be ***soooo*** much nicer if someone could translate
- them ... */
+/* Japanese comments were translated 2000-12-06 by Stephen Turnbull
+ <stephen@xemacs.org>. I haven't verified that the Japanese comments
+ were correct. YMMV, NO WARRANTY, not even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (^^;;; as the
+ Japanese say. */
/*
#endif /* !CANNA2 */
extern char *jrKanjiError;
+/* #### is this global really necessary? */
#define KEYTOSTRSIZE 2048
-static unsigned char buf[KEYTOSTRSIZE];
+static unsigned char key_buffer[KEYTOSTRSIZE];
static char **warning;
static int canna_empty_info, canna_through_info;
int len;
CHECK_CHAR_COERCE_INT (ch);
- len = jrKanjiString (0, XCHAR (ch), buf, KEYTOSTRSIZE, &ks);
- return storeResults (buf, len, &ks);
+ len = jrKanjiString (0, XCHAR (ch), key_buffer, KEYTOSTRSIZE, &ks);
+ return storeResults (key_buffer, len, &ks);
}
static Lisp_Object
}
else
{
- /* ³ÎÄꤷ¤¿Ê¸»úÎó */
+ /* ³ÎÄꤷ¤¿Ê¸»úÎó (the confirmed string) */
Vcanna_kakutei_string = make_string (buf, len);
val = make_int (len);
- /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó... */
+ /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó...
+ (info about the reading of the confirmed string) */
Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil;
if (ks->info & KanjiYomiInfo)
{
{
int yomilen2;
- Vcanna_kakutei_yomi = make_string (p, yomilen); /* ÆÉ¤ß */
+ Vcanna_kakutei_yomi = make_string (p, yomilen); /* Æɤß
+ (reading) */
p += yomilen + 1;
yomilen2 = strlen (p);
if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE)
{
- Vcanna_kakutei_romaji = make_string (p, yomilen2); /* ¥í¡¼¥Þ»ú */
+ Vcanna_kakutei_romaji = make_string (p, yomilen2);
+ /* ¥í¡¼¥Þ»ú (romanization) */
}
}
}
- /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£*/
+ /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£
+ (string for displaying candidate translations) */
Vcanna_henkan_string = Qnil;
if (ks->length >= 0)
{
{
canna_henkan_length = mule_strlen (ks->echoStr,ks->length);
canna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos);
- canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,ks->revLen);
+ canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,
+ ks->revLen);
}
else
{
#endif /* CANNA_MULE */
}
- /* °ìÍ÷¤Î¾ðÊó */
+ /* °ìÍ÷¤Î¾ðÊó (information about the echo area menu) */
Vcanna_ichiran_string = Qnil;
if (ks->info & KanjiGLineInfo && ks->gline.length >= 0)
{
- Vcanna_ichiran_string = make_string (ks->gline.line, ks->gline.length);
+ Vcanna_ichiran_string = make_string (ks->gline.line,
+ ks->gline.length);
#ifndef CANNA_MULE
canna_ichiran_length = ks->gline.length;
canna_ichiran_revPos = ks->gline.revPos;
canna_ichiran_revLen = ks->gline.revLen;
#else /* CANNA_MULE */
count_char (ks->gline.line, ks->gline.length,
- ks->gline.revPos, ks->gline.revLen, &canna_ichiran_length,
+ ks->gline.revPos, ks->gline.revLen,
+ &canna_ichiran_length,
&canna_ichiran_revPos, &canna_ichiran_revLen);
#endif /* CANNA_MULE */
}
- /* ¥â¡¼¥É¤Î¾ðÊó */
+ /* ¥â¡¼¥É¤Î¾ðÊó (mode information) */
Vcanna_mode_string = Qnil;
if (ks->info & KanjiModeInfo)
{
Vcanna_mode_string = make_string (ks->mode, strlen (ks->mode));
}
- /* ¤½¤Î¾¤Î¾ðÊó */
+ /* ¤½¤Î¾¤Î¾ðÊó (other information) */
canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0;
canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0;
}
*/
(num))
{
- int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */
+ int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© (display clause separator?) */
kugiri = NILP (num) ? 0 : 1;
int res;
unsigned char **p, **q;
- int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */
+ int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© (display clause separator?) */
IRCP_context = -1;
{
val = Fcons (make_string ((unsigned char*) jrKanjiError,
strlen (jrKanjiError)), val);
- /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ */
+ /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ (on initialization failure) */
return Fcons (Qnil, val);
}
else
#ifndef CANNA_MULE
jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
#else
- /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë */
+ /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë
+ (Mule can use half-width katakana) */
if (canna_inhibit_hankakukana)
jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
#endif
- jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹ */
+ jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹
+ (*2: return to
+ romanized form) */
val = Fcons (Qnil, val);
return Fcons (CANNA_mode_keys (), val);
}
#endif
CHECK_STRING (str);
- ksv.buffer = (unsigned char *) buf;
+ ksv.buffer = (unsigned char *) key_buffer;
ksv.bytes_buffer = KEYTOSTRSIZE;
#ifndef CANNA_MULE
ks.echoStr = XSTRING_DATA (str);
#endif /* CANNA_MULE */
ksv.ks = &ks;
len = jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv);
- val = storeResults (buf, ksv.val, ksv.ks);
+ val = storeResults (key_buffer, ksv.val, ksv.ks);
return val;
}
CHECK_INT (num);
- ksv.buffer = (unsigned char *) buf;
+ ksv.buffer = (unsigned char *) key_buffer;
ksv.bytes_buffer = KEYTOSTRSIZE;
ksv.ks = &ks;
ksv.val = XINT (num);
jrKanjiControl (0, KC_CHANGEMODE, (char *)&ksv);
- val = storeResults (buf, ksv.val, ksv.ks);
+ val = storeResults (key_buffer, ksv.val, ksv.ks);
return val;
}
CHECK_STRING (yomi);
#ifndef CANNA_MULE
- strncpy (buf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi));
+ strncpy (key_buffer, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi));
ks.length = XSTRING_LENGTH (yomi);
- buf[ks.length] = '\0';
+ key_buffer[ks.length] = '\0';
#else /* CANNA_MULE */
- m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), buf);
- ks.length = strlen (buf);
+ m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), key_buffer);
+ ks.length = strlen (key_buffer);
#endif /* CANNA_MULE */
if (NILP (roma))
CHECK_STRING (roma);
#ifndef CANNA_MULE
- strncpy (buf + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma),
+ strncpy (key_buffer + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma),
XSTRING_LENGTH (roma));
- buf[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0';
- ks.mode = (unsigned char *)(buf + XSTRING_LENGTH (yomi) + 1);
+ key_buffer[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0';
+ ks.mode = (unsigned char *)(key_buffer + XSTRING_LENGTH (yomi) + 1);
#else /* CANNA_MULE */
- ks.mode = (unsigned char *)(buf + ks.length + 1);
+ ks.mode = (unsigned char *)(key_buffer + ks.length + 1);
m2c (XSTRING_DATA (roma), XSTRING_LENGTH (roma), ks.mode);
#endif /* CANNA_MULE */
}
- ks.echoStr = (unsigned char *) buf;
- ksv.buffer = (unsigned char *) buf; /* ÊÖÃÍÍÑ */
+ ks.echoStr = (unsigned char *) key_buffer;
+ ksv.buffer = (unsigned char *) key_buffer; /* ÊÖÃÍÍÑ (return value) */
ksv.bytes_buffer = KEYTOSTRSIZE;
ksv.ks = &ks;
jrKanjiControl (0, KC_STOREYOMI, (char *)&ksv);
- return storeResults (buf, ksv.val, ksv.ks);
+ return storeResults (key_buffer, ksv.val, ksv.ks);
}
DEFUN ("canna-do-function", Fcanna_do_function, 1, 2, 0, /*
if (NILP (ch))
{
- *buf = '@';
+ *key_buffer = '@';
}
else
{
CHECK_CHAR (ch);
- *buf = XCHAR (ch);
+ *key_buffer = XCHAR (ch);
}
- ksv.buffer = (unsigned char *) buf;
+ ksv.buffer = (unsigned char *) key_buffer;
ksv.bytes_buffer = KEYTOSTRSIZE;
ksv.ks = &ks;
ksv.val = XINT (num);
jrKanjiControl (0, KC_DO, (char *) &ksv);
- val = storeResults (buf, ksv.val, ksv.ks);
+ val = storeResults (key_buffer, ksv.val, ksv.ks);
return val;
}
CHECK_STRING (str);
#ifndef CANNA_MULE
- strncpy (buf, XSTRING_DATA (str), XSTRING_LENGTH (str));
- buf[XSTRING_LENGTH (str)] = '\0';
+ strncpy (key_buffer, XSTRING_DATA (str), XSTRING_LENGTH (str));
+ key_buffer[XSTRING_LENGTH (str)] = '\0';
#else /* CANNA_MULE */
- m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), buf);
+ m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), key_buffer);
#endif /* CANNA_MULE */
- p = (unsigned char**) buf;
+ p = (unsigned char**) key_buffer;
n = jrKanjiControl (0, KC_PARSE, (char *) &p);
val = Qnil;
while (n > 0)
{
return Qnil;
}
- RkEndBun (IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡© */
+ RkEndBun (IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡©
+ (is it OK to invoke learning function
+ at arbitrary times?) */
return Qt;
}
a compatibility test. --kkm */
/* Since stat is encapsulated on Windows NT, we need to encapsulate
- the equally broken fstat as well. */
+ the equally broken fstat as well. FSFmacs also provides its own
+ utime. Is that necessary here too? */
int
-mswindows_fstat (int handle, struct stat *buffer)
+mswindows_fstat (int desc, struct stat * buf)
{
- int ret;
- BY_HANDLE_FILE_INFORMATION lpFileInfo;
- /* Initialize values */
- buffer->st_mode = 0;
- buffer->st_size = 0;
- buffer->st_dev = 0;
- buffer->st_rdev = 0;
- buffer->st_atime = 0;
- buffer->st_ctime = 0;
- buffer->st_mtime = 0;
- buffer->st_nlink = 0;
- ret = GetFileInformationByHandle((HANDLE) _get_osfhandle(handle), &lpFileInfo);
- if (!ret)
+ HANDLE fh = (HANDLE) _get_osfhandle (desc);
+ BY_HANDLE_FILE_INFORMATION info;
+ DWORD fake_inode;
+ int permission;
+
+ switch (GetFileType (fh) & ~FILE_TYPE_REMOTE)
{
- return -1;
+ case FILE_TYPE_DISK:
+ buf->st_mode = _S_IFREG;
+ if (!GetFileInformationByHandle (fh, &info))
+ {
+ errno = EACCES;
+ return -1;
+ }
+ break;
+ case FILE_TYPE_PIPE:
+ buf->st_mode = _S_IFIFO;
+ goto non_disk;
+ case FILE_TYPE_CHAR:
+ case FILE_TYPE_UNKNOWN:
+ default:
+ buf->st_mode = _S_IFCHR;
+ non_disk:
+ memset (&info, 0, sizeof (info));
+ info.dwFileAttributes = 0;
+ info.ftCreationTime = utc_base_ft;
+ info.ftLastAccessTime = utc_base_ft;
+ info.ftLastWriteTime = utc_base_ft;
+ }
+
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+ buf->st_mode = _S_IFDIR;
+ buf->st_nlink = 2; /* doesn't really matter */
+ fake_inode = 0; /* this doesn't either I think */
}
else
{
- buffer->st_mtime = convert_time (lpFileInfo.ftLastWriteTime);
- buffer->st_atime = convert_time (lpFileInfo.ftLastAccessTime);
- if (buffer->st_atime == 0) buffer->st_atime = buffer->st_mtime;
- buffer->st_ctime = convert_time (lpFileInfo.ftCreationTime);
- if (buffer->st_ctime == 0) buffer->st_ctime = buffer->st_mtime;
- buffer->st_size = lpFileInfo.nFileSizeLow;
- buffer->st_nlink = (short) lpFileInfo.nNumberOfLinks;
- return 0;
+ buf->st_nlink = info.nNumberOfLinks;
+ /* Might as well use file index to fake inode values, but this
+ is not guaranteed to be unique unless we keep a handle open
+ all the time (even then there are situations where it is
+ not unique). Reputedly, there are at most 48 bits of info
+ (on NTFS, presumably less on FAT). */
+ fake_inode = info.nFileIndexLow ^ info.nFileIndexHigh;
}
+
+ /* MSVC defines _ino_t to be short; other libc's might not. */
+ if (sizeof (buf->st_ino) == 2)
+ buf->st_ino = fake_inode ^ (fake_inode >> 16);
+ else
+ buf->st_ino = fake_inode;
+
+ /* consider files to belong to current user */
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+
+ buf->st_dev = info.dwVolumeSerialNumber;
+ buf->st_rdev = info.dwVolumeSerialNumber;
+
+ buf->st_size = info.nFileSizeLow;
+
+ /* Convert timestamps to Unix format. */
+ buf->st_mtime = convert_time (info.ftLastWriteTime);
+ buf->st_atime = convert_time (info.ftLastAccessTime);
+ if (buf->st_atime == 0) buf->st_atime = buf->st_mtime;
+ buf->st_ctime = convert_time (info.ftCreationTime);
+ if (buf->st_ctime == 0) buf->st_ctime = buf->st_mtime;
+
+ /* determine rwx permissions */
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
+ permission = _S_IREAD;
+ else
+ permission = _S_IREAD | _S_IWRITE;
+
+ if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ permission |= _S_IEXEC;
+
+ buf->st_mode |= permission | (permission >> 3) | (permission >> 6);
+
+ return 0;
}
/* MSVC stat function can't cope with UNC names and has other bugs, so
Lisp_Object property =
COLOR_SPECIFIER_FACE_PROPERTY (XCOLOR_SPECIFIER (specifier));
if (!NILP (face))
- face_property_was_changed (face, property, locale);
+ {
+ face_property_was_changed (face, property, locale);
+ if (BUFFERP (locale))
+ XBUFFER (locale)->buffer_local_face_property = 1;
+ }
}
void
Lisp_Object property =
FONT_SPECIFIER_FACE_PROPERTY (XFONT_SPECIFIER (specifier));
if (!NILP (face))
- face_property_was_changed (face, property, locale);
+ {
+ face_property_was_changed (face, property, locale);
+ if (BUFFERP (locale))
+ XBUFFER (locale)->buffer_local_face_property = 1;
+ }
}
void
Lisp_Object property =
FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (XFACE_BOOLEAN_SPECIFIER (specifier));
if (!NILP (face))
- face_property_was_changed (face, property, locale);
+ {
+ face_property_was_changed (face, property, locale);
+ if (BUFFERP (locale))
+ XBUFFER (locale)->buffer_local_face_property = 1;
+ }
}
void
/*****************************************************************************
compare_runes
- Compare to runes to see if each of their fields is equal. If so,
+ Compare two runes to see if each of their fields is equal. If so,
return true otherwise return false.
****************************************************************************/
static int
Remove subwindows from the area in the box defined by the given
parameters.
****************************************************************************/
-static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height,
- Lisp_Object ignored_window)
+static void
+redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height,
+ Lisp_Object ignored_window)
{
Lisp_Object rest;
||
-glyphsrc->xoffset >= glyphsrc->width
||
- -glyphsrc->yoffset >= glyphsrc->height)
+ -glyphsrc->yoffset >= glyphsrc->height
+ ||
+ /* #### Not sure why this wasn't coped with before but normalizing
+ to zero width or height is definitely wrong. */
+ (dest->xpos + glyphsrc->xoffset + glyphsrc->width > dest->xpos + dest->width
+ &&
+ dest->width - glyphsrc->xoffset <= 0)
+ ||
+ (dest->ypos + glyphsrc->yoffset + glyphsrc->height > dest->ypos + dest->height
+ &&
+ dest->height - glyphsrc->yoffset <= 0))
{
/* It's all clipped out */
return 0;
If window is topmost, clear the internal border above it.
****************************************************************************/
-static void
+void
redisplay_clear_top_of_window (struct window *w)
{
Lisp_Object window;
/* If the window's structure has changed clear the internal border
above it if it is topmost (the function will check). */
- if (f->windows_structure_changed)
+ if (f->windows_structure_changed || f->faces_changed)
redisplay_clear_top_of_window (w);
/* Output each line. */
f->windows_structure_changed = 1;
}
+ redisplay_clear_top_of_window (w);
if (window_needs_vertical_divider (w))
{
x_output_vertical_divider (w, 0);
maybe a caret cursor, etc. */
DEFVAR_LISP ("bar-cursor", &Vbar_cursor /*
-Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2.
+*Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2.
*/ );
Vbar_cursor = Qnil;
void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2);
void redisplay_clear_region (Lisp_Object window, face_index findex, int x,
int y, int width, int height);
+void redisplay_clear_top_of_window (struct window *w);
void redisplay_clear_bottom_of_window (struct window *w,
display_line_dynarr *ddla,
int min_start, int max_end);
#define SYSTEM_TYPE "SCO 3.2v5"
/* SCO has ptys, but with weird names */
+#define HAVE_PTYS
#define PTY_ITERATION \
for (i = 0; ; i++)
#define PTY_NAME_SPRINTF \
In that case, use ordinary stat instead. */
#ifndef S_IFLNK
-#define lstat stat
+#define lstat xemacs_stat
#endif
#if !S_IRUSR
/* This is a complete rewrite, some code snarfed from unexnt.c and
unexec.c, Andy Piper (andy@xemacs.org) 13-1-98 */
+#include <config.h>
+#include "lisp.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
-#include <config.h>
#include <string.h>
#define DONT_ENCAPSULATE /* filenames are external in unex*.c */
((((unsigned long)addr) + ALLOC_UNIT) & ALLOC_MASK)
/* Note that all sections must be aligned on a 0x1000 boundary so
this is the minimum size that our dummy bss can be. */
-#ifdef BROKEN_GDB
+#ifndef NO_DEBUG
#define BSS_PAD_SIZE 0x1000
#else
#define BSS_PAD_SIZE 0
exit(-1); \
}
-void
-unexec (char *out_name, char *in_name, void *start_data,
- void * d1, void * d2);
/* Dump out .data and .bss sections into a new executable. */
-void unexec (char *out_name, char *in_name, void *start_data,
- void * d1, void * d2)
+int
+unexec (char *out_name, char *in_name, uintptr_t start_data,
+ uintptr_t d1, uintptr_t d2)
{
/* ugly nt hack - should be in lisp */
int a_new, a_out = -1;
close(a_out);
close(a_new);
+ return 0;
}
/* Flip through the executable and cache the info necessary for dumping. */
static void get_section_info (int a_out, char* a_name)
{
- extern int my_ebss;
+ extern char my_ebss[];
/* From lastfile.c */
extern char my_edata[];
data_padding = (f_bss.s_vaddr - f_data.s_vaddr) - f_data.s_size;
}
+ if ((new_bss_size - bss_size) < BSS_PAD_SIZE)
+ {
+ PERROR (".bss free space too small");
+ }
+
file_sz_change=(new_bss_size + data_padding) - BSS_PAD_SIZE;
new_data_size=f_ohdr.dsize + file_sz_change;
lseek (a_new, 0, SEEK_SET);
/* write file header */
f_hdr.f_symptr += file_sz_change;
-#ifndef BROKEN_GDB
+#ifdef NO_DEBUG
f_hdr.f_nscns--;
#endif
{
PERROR("failed to write text header");
}
-#ifdef BROKEN_GDB
+#ifndef NO_DEBUG
/* Write small bss section. */
if (!sections_reversed)
{
{
PERROR("failed to write data header");
}
-#ifdef BROKEN_GDB
+#ifndef NO_DEBUG
/* Write small bss section. */
if (sections_reversed)
{
PERROR("failed to write data header");
}
}
-#ifndef BROKEN_GDB
+#ifdef NO_DEBUG
/* dump bss to maintain offsets */
memset(&f_bss, 0, sizeof(f_bss));
if (write(a_new, &f_bss, sizeof(f_bss)) != sizeof(f_bss))
fatal ("Can't fstat (%s): errno %d\n", old_name, errno);
/* map old file into the address space. */
- if ( (old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size,
- PROT_READ, MAP_SHARED, old_file, 0)) < 0 )
- fatal ("Can't mmap (%s): errno %d\n", old_name, errno);
+ old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size,
+ PROT_READ, MAP_SHARED, old_file, 0);
+ if (old_base == (caddr_t) MAP_FAILED)
+ fatal ("Can't mmap (%s): errno %d\n", old_name, errno);
old_file_h = (ElfW(Ehdr) *) old_base;
old_program_h = (ElfW(Phdr) *) ((byte *) old_base + old_file_h->e_phoff);
By default, only the windows in the selected frame are considered.
The optional argument WHICH-FRAMES changes this behavior:
WHICH-FRAMES = `visible' means search windows on all visible frames.
-WHICH-FRAMES = 0 means search windows on all visible and iconified frames.
+WHICH-FRAMES = 0 means search windows on all visible and iconified frames.
WHICH-FRAMES = t means search windows on all frames including invisible frames.
WHICH-FRAMES = a frame means search only windows on that frame.
Anything else means restrict to the selected frame.
By default, only the windows in the selected frame are considered.
The optional argument WHICH-FRAMES changes this behavior:
WHICH-FRAMES = `visible' means search windows on all visible frames.
-WHICH-FRAMES = 0 means search windows on all visible and iconified frames.
+WHICH-FRAMES = 0 means search windows on all visible and iconified frames.
WHICH-FRAMES = t means search windows on all frames including invisible frames.
WHICH-FRAMES = a frame means search only windows on that frame.
Anything else means restrict to the selected frame.
By default, only the windows in the selected frame are considered.
The optional argument WHICH-FRAMES changes this behavior:
WHICH-FRAMES = `visible' means search windows on all visible frames.
-WHICH-FRAMES = 0 means search windows on all visible and iconified frames.
+WHICH-FRAMES = 0 means search windows on all visible and iconified frames.
WHICH-FRAMES = t means search windows on all frames including invisible frames.
WHICH-FRAMES = a frame means search only windows on that frame.
Anything else means restrict to the selected frame.
DELETE_OTHER_WINDOWS, /* Arg is window not to delete */
DELETE_BUFFER_WINDOWS, /* Arg is buffer */
GET_LARGEST_WINDOW,
- UNSHOW_BUFFER, /* Arg is buffer */
GET_BUFFER_WINDOW_COUNT, /* Arg is buffer */
GET_BUFFER_MRU_WINDOW /* Arg is buffer */
};
int dedicated_too,
Lisp_Object which_devices)
{
- /* This function can GC if type == DELETE_BUFFER_WINDOWS or UNSHOW_BUFFER */
+ /* This function can GC if type == DELETE_BUFFER_WINDOWS */
Lisp_Object w;
Lisp_Object best_window = Qnil;
Lisp_Object next_window;
for (;;)
{
struct window *p = XWINDOW (w);
- struct frame *w_frame = XFRAME (WINDOW_FRAME (p));
/* Pick the next window now, since some operations will delete
the current window. */
break;
}
- case UNSHOW_BUFFER:
- {
- if (EQ (p->buffer, obj))
- {
- /* Find another buffer to show in this window. */
- Lisp_Object another_buffer =
- Fother_buffer (obj, Qnil, Qnil);
- if (NILP (another_buffer))
- another_buffer
- = Fget_buffer_create (QSscratch);
- /* If this window is dedicated, and in a frame
- of its own, kill the frame. */
- if (EQ (w, FRAME_ROOT_WINDOW (w_frame))
- && !NILP (p->dedicated)
- && other_visible_frames (w_frame))
- {
- /* Skip the other windows on this frame.
- There might be one, the minibuffer! */
- if (! EQ (w, last_window))
- while (w_frame == XFRAME (WINDOW_FRAME
- (XWINDOW (next_window))))
- {
- /* As we go, check for the end of the
- loop. We mustn't start going
- around a second time. */
- if (EQ (next_window, last_window))
- {
- last_window = w;
- break;
- }
- next_window = Fnext_window (next_window,
- mini ? Qt : Qnil,
- frame_arg, Qt);
- }
- /* Now we can safely delete the frame. */
- delete_frame_internal (XFRAME (WINDOW_FRAME (p)),
- 0, 0, 0);
- }
- else
- {
- /* Otherwise show a different buffer in the
- window. */
- p->dedicated = Qnil;
- Fset_window_buffer (w, another_buffer, Qnil);
- if (EQ (w, Fselected_window (Qnil)))
- Fset_buffer (p->buffer);
- }
- }
- break;
- }
-
default:
abort ();
}
return Qnil;
}
+static Lisp_Object
+list_windows (struct window *w, Lisp_Object value)
+{
+ for (;;)
+ {
+ if (!NILP (w->hchild))
+ value = list_windows (XWINDOW (w->hchild), value);
+ else if (!NILP (w->vchild))
+ value = list_windows (XWINDOW (w->vchild), value);
+ else
+ {
+ Lisp_Object window;
+ XSETWINDOW (window, w);
+ value = Fcons (window, value);
+ }
+ if (NILP (w->next))
+ break;
+ w = XWINDOW (w->next);
+ }
+ return value;
+}
+
+static Lisp_Object
+list_all_windows (Lisp_Object frame_spec, Lisp_Object device_spec)
+{
+ Lisp_Object devcons, concons;
+ Lisp_Object retval = Qnil;
+
+ DEVICE_LOOP_NO_BREAK (devcons, concons)
+ {
+ Lisp_Object frame_list, the_window;
+ Lisp_Object device, tail;
+
+ device = XCAR (devcons);
+ frame_list = DEVICE_FRAME_LIST (XDEVICE (device));
+
+ LIST_LOOP (tail, frame_list)
+ {
+ if ((NILP (frame_spec)
+ && !EQ (XCAR (tail), DEVICE_SELECTED_FRAME (XDEVICE (device))))
+ || (EQ (frame_spec, Qvisible)
+ && !FRAME_VISIBLE_P (XFRAME (XCAR (tail))))
+ || (FRAMEP (frame_spec)
+ && !EQ (frame_spec, XCAR (tail)))
+ || (!NILP (frame_spec)
+ && !device_matches_device_spec (device,
+ NILP (device_spec) ?
+ Vselected_console :
+ device_spec)))
+ continue;
+ the_window = FRAME_ROOT_WINDOW (XFRAME (XCAR (tail)));
+ retval = list_windows (XWINDOW (the_window), retval);
+ }
+ }
+ return Fnreverse (retval);
+}
+
DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, 1, 3,
"bReplace buffer in windows: ", /*
Replace BUFFER with some other buffer in all windows showing it.
(buffer, which_frames, which_devices))
{
/* This function can GC */
- buffer = Fget_buffer (buffer);
- CHECK_BUFFER (buffer);
+ Lisp_Object window_list;
+ Lisp_Object tail;
+ struct gcpro gcpro1, gcpro2;
- /* WHICH-FRAMES values t and nil mean the opposite of what
- window_loop expects. */
if (EQ (which_frames, Qnil))
which_frames = Qt;
else if (EQ (which_frames, Qt))
which_frames = Qnil;
+ window_list = list_all_windows (which_frames, which_devices);
- /* Ignore dedicated windows. */
- window_loop (UNSHOW_BUFFER, buffer, 0, which_frames, 0, which_devices);
+ buffer = Fget_buffer (buffer);
+ CHECK_BUFFER (buffer);
+
+ GCPRO2 (window_list, buffer);
+ LIST_LOOP (tail, window_list)
+ {
+ Lisp_Object window = XCAR (tail);
+ if (!MINI_WINDOW_P (XWINDOW (window))
+ && EQ (XWINDOW (window)->buffer, buffer))
+ {
+ Lisp_Object another_buffer = Fother_buffer (buffer, Qnil, Qnil);
+ Lisp_Object frame = WINDOW_FRAME (XWINDOW (window));
+ if (NILP (another_buffer))
+ another_buffer = Fget_buffer_create (QSscratch);
+ if (!NILP (XWINDOW (window)->dedicated)
+ && EQ (window,
+ FRAME_ROOT_WINDOW (XFRAME (frame)))
+ && other_visible_frames (XFRAME (frame)))
+ {
+ delete_frame_internal (XFRAME (frame), 0, 0, 0); /* GC */
+ }
+ else
+ {
+ Fset_window_buffer (window, another_buffer, Qnil);
+ if (EQ (window, Fselected_window (Qnil)))
+ Fset_buffer (XWINDOW (window)->buffer);
+ }
+ }
+ }
+ UNGCPRO;
return Qnil;
}
\f
{
Lisp_Object tem;
struct window *w = decode_window (window);
+ int old_buffer_local_face_property = 0;
buffer = Fget_buffer (buffer);
CHECK_BUFFER (buffer);
error ("Window is dedicated to buffer %s",
XSTRING_DATA (XBUFFER (tem)->name));
+ old_buffer_local_face_property =
+ XBUFFER (w->buffer)->buffer_local_face_property;
unshow_buffer (w);
}
SET_LAST_MODIFIED (w, 1);
SET_LAST_FACECHANGE (w);
MARK_WINDOWS_CHANGED (w);
+ {
+ int new_buffer_local_face_property =
+ XBUFFER (w->buffer)->buffer_local_face_property;
+
+ if (new_buffer_local_face_property
+ || new_buffer_local_face_property != old_buffer_local_face_property)
+ MARK_WINDOW_FACES_CHANGED (w);
+ }
recompute_all_cached_specifiers_in_window (w);
if (EQ (window, Fselected_window (Qnil)))
{
|| NILP (XWINDOW (o->parent)->vchild))
{
make_dummy_parent (window);
+#if 0
+ /* #### I can't understand why you have to reset face
+ cachels here. This can cause crash so let's disable it
+ and see the difference. See redisplay-tests.el --yh */
reset_face_cachels (XWINDOW (window));
+#endif
new = o->parent;
XWINDOW (new)->vchild = window;
XFRAME (o->frame)->mirror_dirty = 1;
|| NILP (XWINDOW (o->parent)->hchild))
{
make_dummy_parent (window);
+#if 0
+ /* #### See above. */
reset_face_cachels (XWINDOW (window));
+#endif
new = o->parent;
XWINDOW (new)->hchild = window;
XFRAME (o->frame)->mirror_dirty = 1;
windows_changed = 1; \
} while (0)
+/* #### This should be fixed not to call MARK_FRAME_CHANGED because
+ faces are cached per window. Also, other code which changes window's
+ face should use this macro.
+*/
+#define MARK_WINDOW_FACES_CHANGED(w) \
+ MARK_FRAME_FACES_CHANGED (XFRAME ((w)->frame))
+
#define WINDOW_TTY_P(w) FRAME_TTY_P (XFRAME ((w)->frame))
#define WINDOW_X_P(w) FRAME_X_P (XFRAME ((w)->frame))
#define WINDOW_NS_P(w) FRAME_NS_P (XFRAME ((w)->frame))
+2000-12-31 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.39 is released.
+
+2000-12-28 Martin Buchholz <martin@xemacs.org>
+
+ * automated/lisp-tests.el:
+ Avoid triggering Solaris printf buffer overflow from (format).
+
+2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * redisplay-tests.el: New file.
+
+2000-12-12 Martin Buchholz <martin@xemacs.org>
+
+ * automated/lisp-tests.el: Add/Change (format) tests.
+
+2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * automated/lisp-test.el: Test if all-completions ignore
+ elements start with space.
+
+2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * automated/regexp-tests.el: Test unmatched search doesn't
+ alter match-string.
+
2000-12-05 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.38 is released.
(Assert (string= (format "%e" 100) "1.000000e+02"))
(Assert (string= (format "%E" 100) "1.000000E+02"))
(Assert (string= (format "%f" 100) "100.000000"))
+(Assert (string= (format "%7.3f" 12.12345) " 12.123"))
+(Assert (string= (format "%07.3f" 12.12345) "012.123"))
+(Assert (string= (format "%-7.3f" 12.12345) "12.123 "))
+(Assert (string= (format "%-07.3f" 12.12345) "12.123 "))
(Assert (string= (format "%g" 100.0) "100"))
(Assert (string= (format "%g" 0.000001) "1e-06"))
(Assert (string= (format "%g" 0.0001) "0.0001"))
(Assert (string= (format "%.1d" 10) "10"))
(Assert (string= (format "%.4d" 10) "0010"))
;; Combination of `-', `+', ` ', `0', `#', `.', `*'
-(Assert (string= (format "%-04d" 10) "0010"))
+(Assert (string= (format "%-04d" 10) "10 "))
(Assert (string= (format "%-*d" 4 10) "10 "))
;; #### Correctness of this behavior is questionable.
;; It might be better to signal error.
;; (format "%-.1d" 10)
(Assert (string= (format "%01.1d" 10) "10"))
-(Assert (string= (format "%03.1d" 10) "010"))
-(Assert (string= (format "%01.3d" 10) "10"))
-(Assert (string= (format "%1.3d" 10) "10"))
+(Assert (string= (format "%03.1d" 10) " 10"))
+(Assert (string= (format "%01.3d" 10) "010"))
+(Assert (string= (format "%1.3d" 10) "010"))
(Assert (string= (format "%3.1d" 10) " 10"))
+;;; The following two tests used to use 1000 instead of 100,
+;;; but that merely found buffer overflow bugs in Solaris sprintf().
+(Assert (= 102 (length (format "%.100f" 3.14))))
+(Assert (= 100 (length (format "%100f" 3.14))))
+
;;; Check for 64-bit cleanness on LP64 platforms.
(Assert (= (read (format "%d" most-positive-fixnum)) most-positive-fixnum))
(Assert (= (read (format "%ld" most-positive-fixnum)) most-positive-fixnum))
;;; The printed value might be useful to a human, if not to Emacs Lisp.
(Check-Error invalid-read-syntax (read (format "%u" most-negative-fixnum)))
(Check-Error invalid-read-syntax (read (format "%u" -1)))
+
+;; Check all-completions ignore element start with space.
+(Assert (not (all-completions "" '((" hidden" . "object")))))
+(Assert (all-completions " " '((" hidden" . "object"))))
(setq i (1+ i))))))
;; (test-regex-charset-mule-paranoid)
+
+;; Test replace-match
+(with-temp-buffer
+ (insert "This is a test buffer.")
+ (goto-char (point-min))
+ (search-forward "this is a test ")
+ (looking-at "Unmatchable text")
+ (replace-match "")
+ (Assert (looking-at "^buffer.$")))