aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey <[email protected]>2006-04-10 14:52:24 +0000
committerKaroly Lorentey <[email protected]>2006-04-10 14:52:24 +0000
commite349ae3b6b6db99d11321622fadff88bc42c1125 (patch)
tree7a24a5dad70d4b3695f227681fc37e179551d24a /src
parent2518de51d20e848711c712f5030e8c207a4e2840 (diff)
parent4f07f2e8a5458758dcf2bfbdf9b0cf8c91a8572e (diff)
Merged from
Patches applied: * [email protected]/emacs--devo--0--patch-188 Update from CVS * [email protected]/emacs--devo--0--patch-189 Merge from gnus--rel--5.10 * [email protected]/emacs--devo--0--patch-190 Update from CVS * [email protected]/emacs--devo--0--patch-191 Undo incorrect merge of etc/images/README from Gnus 5.10 * [email protected]/emacs--devo--0--patch-192 Update from CVS * [email protected]/emacs--devo--0--patch-193 Update from CVS * [email protected]/emacs--devo--0--patch-194 Update from CVS * [email protected]/emacs--devo--0--patch-195 Update from CVS * [email protected]/emacs--devo--0--patch-196 Merge from gnus--rel--5.10 * [email protected]/emacs--devo--0--patch-197 Update from CVS * [email protected]/emacs--devo--0--patch-198 Merge from gnus--rel--5.10 * [email protected]/emacs--devo--0--patch-199 Update from CVS * [email protected]/emacs--devo--0--patch-200 Update from CVS * [email protected]/emacs--devo--0--patch-201 Update from CVS * [email protected]/emacs--devo--0--patch-202 Update from CVS * [email protected]/emacs--devo--0--patch-203 Merge from gnus--rel--5.10 * [email protected]/emacs--devo--0--patch-204 Update from CVS * [email protected]/emacs--devo--0--patch-205 Update from CVS * [email protected]/emacs--devo--0--patch-206 Update from CVS * [email protected]/gnus--rel--5.10--patch-73 Update from CVS * [email protected]/gnus--rel--5.10--patch-74 Update from CVS * [email protected]/gnus--rel--5.10--patch-75 Update from CVS * [email protected]/gnus--rel--5.10--patch-76 Update from CVS: README: Addition from 5.10.6 tar ball. * [email protected]/gnus--rel--5.10--patch-77 Update from CVS * [email protected]/gnus--rel--5.10--patch-78 Update from CVS * [email protected]/gnus--rel--5.10--patch-79 Update from CVS * [email protected]/gnus--rel--5.10--patch-80 Update from CVS git-archimport-id: [email protected]/emacs--multi-tty--0--patch-547
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog79
-rw-r--r--src/alloc.c20
-rw-r--r--src/config.in4
-rw-r--r--src/editfns.c34
-rw-r--r--src/image.c11
-rw-r--r--src/keymap.c2
-rw-r--r--src/lisp.h39
-rw-r--r--src/macterm.c4
-rw-r--r--src/process.c96
-rw-r--r--src/process.h19
-rw-r--r--src/puresize.h2
-rw-r--r--src/search.c4
-rw-r--r--src/w32fns.c15
13 files changed, 234 insertions, 95 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ba816a9e2f..d5e4d20111 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,82 @@
+2006-04-09 Richard Stallman <[email protected]>
+
+ * lisp.h (Fkill_emacs): Undo previous change.
+
+2006-04-08 Richard Stallman <[email protected]>
+
+ * search.c (boyer_moore): Test ch >= 0400, not >.
+
+2006-04-09 Dan Nicolaescu <[email protected]>
+
+ * puresize.h (pure_write_error): Mark as NO_RETURN.
+
+ * lisp.h (args_out_of_range, args_out_of_range_3)
+
+2006-04-08 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements
+ if a menu is active on this frame.
+
+2006-04-08 Dan Nicolaescu <[email protected]>
+
+ * lisp.h (report_file_error): Mark as NO_RETURN.
+
+2006-04-08 Eli Zaretskii <[email protected]>
+
+ * alloc.c [STDC_HEADERS]: Include stddef.h.
+
+ * lisp.h (PSEUDOVECSIZE): Fix last change.
+
+2006-04-08 Stefan Monnier <[email protected]>
+
+ * process.h (struct Lisp_Process): Replace Lisp_Objects `pid',
+ `raw_status_high', and `raw_status_low' with plain integers, and move
+ them to the end of the structure.
+
+ * alloc.c (allocate_process): Use PSEUDOVECSIZE to initialize the
+ pseudovector's size field so only the Lisp_Object fields get GC'd.
+
+ * process.c (update_status, make_process, Fdelete_process)
+ (Fprocess_status, list_processes_1, start_process_unwind)
+ (create_process, Fmake_network_process, server_accept_connection)
+ (wait_reading_process_output, send_process, Fprocess_running_child_p)
+ (process_send_signal, proc_encode_coding_system, Fprocess_send_eof)
+ (sigchld_handler, status_notify): Adjust to new non-Lisp fields for
+ `pid' and `raw_status'.
+ (Fprocess_id, Fsignal_process): Same, and additionally use floats when
+ representing PIDs that are larger than most-positive-fixnum.
+
+ * keymap.c (describe_map): Only use XINT if we checked INTEGERP.
+
+ * lisp.h (OFFSETOF, PSEUDOVECSIZE): New macros.
+
+2006-04-08 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
+
+2006-04-03 Paul Eggert <[email protected]>
+
+ * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): New macro, identical to
+ ../lib-src/b2m.c and ../lib-src/editfns.c.
+ (Fcurrent_time_string): Use it.
+ Document that the year might not consume 4 columns if it's outside
+ the range 1000-9999.
+ Check for asctime failure.
+ Don't assume that the output string length is always exactly 24.
+
+2006-04-03 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (XTread_socket): Initialize variable `f' before its use.
+
+2006-04-03 Kenichi Handa <[email protected]>
+
+ * image.c: Include "charset.h" and "coding.h".
+ (x_find_image_file): Return an encoded file name.
+
+2006-04-01 Eli Zaretskii <[email protected]>
+
+ * configure: Regenerated.
+
2006-03-31 Kenichi Handa <[email protected]>
* xfns.c (xg_set_icon): Delete superfluous UNGCPRO.
diff --git a/src/alloc.c b/src/alloc.c
index 259143ffad..8088540bb6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -23,6 +23,10 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <limits.h> /* For CHAR_BIT. */
+#ifdef STDC_HEADERS
+#include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */
+#endif
+
#ifdef ALLOC_DEBUG
#undef INLINE
#endif
@@ -3005,13 +3009,17 @@ allocate_frame ()
struct Lisp_Process *
allocate_process ()
{
- EMACS_INT len = VECSIZE (struct Lisp_Process);
- struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_PROCESS);
+ /* Memory-footprint of the object in nb of Lisp_Object fields. */
+ EMACS_INT memlen = VECSIZE (struct Lisp_Process);
+ /* Size if we only count the actual Lisp_Object fields (which need to be
+ traced by the GC). */
+ EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid);
+ struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS);
EMACS_INT i;
- for (i = 0; i < len; ++i)
+ for (i = 0; i < lisplen; ++i)
v->contents[i] = Qnil;
- v->size = len;
+ v->size = lisplen;
return (struct Lisp_Process *) v;
}
@@ -5563,6 +5571,10 @@ mark_object (arg)
if (size & PSEUDOVECTOR_FLAG)
size &= PSEUDOVECTOR_SIZE_MASK;
+ /* Note that this size is not the memory-footprint size, but only
+ the number of Lisp_Object fields that we should trace.
+ The distinction is used e.g. by Lisp_Process which places extra
+ non-Lisp_Object fields at the end of the structure. */
for (i = 0; i < size; i++) /* and then mark its elements */
mark_object (ptr->contents[i]);
}
diff --git a/src/config.in b/src/config.in
index b6730d0284..ddbbbce97d 100644
--- a/src/config.in
+++ b/src/config.in
@@ -1,8 +1,8 @@
/* src/config.in. Generated from configure.in by autoheader. */
/* GNU Emacs site configuration template file.
- Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004, 2005,
- 2006 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
diff --git a/src/editfns.c b/src/editfns.c
index 888bbe3062..450a768458 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -74,6 +74,13 @@ extern char **environ;
#define TM_YEAR_BASE 1900
+/* Nonzero if TM_YEAR is a struct tm's tm_year value that causes
+ asctime to have well-defined behavior. */
+#ifndef TM_YEAR_IN_ASCTIME_RANGE
+# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) \
+ (1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE)
+#endif
+
extern size_t emacs_strftimeu P_ ((char *, size_t, const char *,
const struct tm *, int));
static int tm_diff P_ ((struct tm *, struct tm *));
@@ -1833,7 +1840,8 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
DEFUN ("current-time-string", Fcurrent_time_string, Scurrent_time_string, 0, 1, 0,
doc: /* Return the current time, as a human-readable string.
Programs can use this function to decode a time,
-since the number of columns in each field is fixed.
+since the number of columns in each field is fixed
+if the year is in the range 1000-9999.
The format is `Sun Sep 16 01:03:52 1973'.
However, see also the functions `decode-time' and `format-time-string'
which provide a much more powerful and general facility.
@@ -1847,31 +1855,23 @@ but this is considered obsolete. */)
Lisp_Object specified_time;
{
time_t value;
- char buf[30];
struct tm *tm;
register char *tem;
if (! lisp_time_argument (specified_time, &value, NULL))
error ("Invalid time specification");
- /* Do not use ctime, since it has undefined behavior with
- out-of-range time stamps. This avoids a core dump triggered by
- (current-time-string '(2814749767106 0)) on 64-bit Solaris 8. See
- <http://www.opengroup.org/austin/mailarchives/ag/msg09294.html>
- for more details about this portability problem. */
+
+ /* Convert to a string, checking for out-of-range time stamps.
+ Don't use 'ctime', as that might dump core if VALUE is out of
+ range. */
tm = localtime (&value);
- /* Checking for out-of-range time stamps avoids buffer overruns that
- cause core dump on some systems (e.g., 64-bit Solaris), and also
- preserves the historic behavior of always returning a fixed-size
- 24-character string. */
- if (! (tm && -999 - TM_YEAR_BASE <= tm->tm_year
- && tm->tm_year <= 9999 - TM_YEAR_BASE))
+ if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm))))
error ("Specified time is not representable");
- tem = asctime (tm);
- strncpy (buf, tem, 24);
- buf[24] = 0;
+ /* Remove the trailing newline. */
+ tem[strlen (tem) - 1] = '\0';
- return build_string (buf);
+ return build_string (tem);
}
/* Yield A - B, measured in seconds.
diff --git a/src/image.c b/src/image.c
index 8e3a0afe91..0d52399327 100644
--- a/src/image.c
+++ b/src/image.c
@@ -39,6 +39,8 @@ Boston, MA 02110-1301, USA. */
#include "blockinput.h"
#include "systime.h"
#include <epaths.h>
+#include "charset.h"
+#include "coding.h"
#ifdef HAVE_X_WINDOWS
@@ -2248,8 +2250,8 @@ static unsigned char *slurp_file P_ ((char *, int *));
/* Find image file FILE. Look in data-directory, then
- x-bitmap-file-path. Value is the full name of the file found, or
- nil if not found. */
+ x-bitmap-file-path. Value is the encoded full name of the file
+ found, or nil if not found. */
Lisp_Object
x_find_image_file (file)
@@ -2269,7 +2271,10 @@ x_find_image_file (file)
if (fd == -1)
file_found = Qnil;
else
- close (fd);
+ {
+ file_found = ENCODE_FILE (file_found);
+ close (fd);
+ }
UNGCPRO;
return file_found;
diff --git a/src/keymap.c b/src/keymap.c
index 92c67ed1f1..af881d73cc 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3336,7 +3336,7 @@ describe_map (map, prefix, elt_describer, partial, shadow,
if (INTEGERP (vect[i].event))
{
while (i + 1 < slots_used
- && XINT (vect[i + 1].event) == XINT (vect[i].event) + 1
+ && EQ (vect[i+1].event, make_number (XINT (vect[i].event) + 1))
&& !NILP (Fequal (vect[i + 1].definition, definition))
&& vect[i].shadowed == vect[i + 1].shadowed)
i++;
diff --git a/src/lisp.h b/src/lisp.h
index efc8a8f19d..c28c981daf 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -297,7 +297,11 @@ enum pvec_type
#endif
};
-/* For convenience, we also store the number of elements in these bits. */
+/* For convenience, we also store the number of elements in these bits.
+ Note that this size is not necessarily the memory-footprint size, but
+ only the number of Lisp_Object fields (that need to be traced by the GC).
+ The distinction is used e.g. by Lisp_Process which places extra
+ non-Lisp_Object fields at the end of the structure. */
#define PSEUDOVECTOR_SIZE_MASK 0x1ff
/* Number of bits to put in each character in the internal representation
@@ -702,12 +706,12 @@ struct Lisp_String
unsigned char *data;
};
-/* If a struct is made to look like a vector, this macro returns the length
- of the shortest vector that would hold that struct. */
-#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector) \
- - sizeof (Lisp_Object)) \
- + sizeof(Lisp_Object) - 1) /* round up */ \
- / sizeof (Lisp_Object))
+#ifdef offsetof
+#define OFFSETOF(type,field) offsetof(type,field)
+#else
+#define OFFSETOF(type,field) \
+ ((int)((char*)&((type*)0)->field - (char*)0))
+#endif
struct Lisp_Vector
{
@@ -716,6 +720,20 @@ struct Lisp_Vector
Lisp_Object contents[1];
};
+/* If a struct is made to look like a vector, this macro returns the length
+ of the shortest vector that would hold that struct. */
+#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector) \
+ - sizeof (Lisp_Object)) \
+ + sizeof(Lisp_Object) - 1) /* round up */ \
+ / sizeof (Lisp_Object))
+
+/* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields
+ at the end and we need to compute the number of Lisp_Object fields (the
+ ones that the GC needs to trace). */
+#define PSEUDOVECSIZE(type, nonlispfield) \
+ ((OFFSETOF(type, nonlispfield) - OFFSETOF(struct Lisp_Vector, contents[0])) \
+ / sizeof (Lisp_Object))
+
/* A char table is a kind of vectorlike, with contents are like a
vector but with a few other slots. For some purposes, it makes
sense to handle a chartable with type struct Lisp_Vector. An
@@ -2225,8 +2243,9 @@ EXFUN (Fmake_variable_buffer_local, 1);
extern Lisp_Object indirect_variable P_ ((Lisp_Object));
extern Lisp_Object long_to_cons P_ ((unsigned long));
extern unsigned long cons_to_long P_ ((Lisp_Object));
-extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object));
-extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
+extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object)) NO_RETURN;
extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object));
extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object,
Lisp_Object, struct buffer *));
@@ -2844,7 +2863,7 @@ EXFUN (Ffile_readable_p, 1);
EXFUN (Ffile_executable_p, 1);
EXFUN (Fread_file_name, 6);
extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
-extern void report_file_error P_ ((const char *, Lisp_Object));
+extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN;
extern int internal_delete_file P_ ((Lisp_Object));
extern void syms_of_fileio P_ ((void));
extern void init_fileio_once P_ ((void));
diff --git a/src/macterm.c b/src/macterm.c
index 77558eb320..7c946a9fd3 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -10455,6 +10455,8 @@ XTread_socket (sd, expected, hold_quit)
ObscureCursor ();
+ f = mac_focus_frame (dpyinfo);
+
if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))
{
@@ -10500,7 +10502,7 @@ XTread_socket (sd, expected, hold_quit)
inev.modifiers |= (extra_keyboard_modifiers
& (meta_modifier | alt_modifier
| hyper_modifier | super_modifier));
- XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo));
+ XSETFRAME (inev.frame_or_window, f);
break;
case kHighLevelEvent:
diff --git a/src/process.c b/src/process.c
index e3fa187565..003f27b77b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -414,10 +414,10 @@ update_status (p)
struct Lisp_Process *p;
{
union { int i; WAITTYPE wt; } u;
- u.i = XFASTINT (p->raw_status_low) + (XFASTINT (p->raw_status_high) << 16);
+ eassert (p->raw_status_new);
+ u.i = p->raw_status;
p->status = status_convert (u.wt);
- p->raw_status_low = Qnil;
- p->raw_status_high = Qnil;
+ p->raw_status_new = 0;
}
/* Convert a process status word in Unix format to
@@ -619,11 +619,10 @@ make_process (name)
XSETINT (p->infd, -1);
XSETINT (p->outfd, -1);
- XSETFASTINT (p->pid, 0);
XSETFASTINT (p->tick, 0);
XSETFASTINT (p->update_tick, 0);
- p->raw_status_low = Qnil;
- p->raw_status_high = Qnil;
+ p->pid = 0;
+ p->raw_status_new = 0;
p->status = Qrun;
p->mark = Fmake_marker ();
@@ -789,8 +788,7 @@ nil, indicating the current buffer's process. */)
process = get_process (process);
p = XPROCESS (process);
- p->raw_status_low = Qnil;
- p->raw_status_high = Qnil;
+ p->raw_status_new = 0;
if (NETCONN1_P (p))
{
p->status = Fcons (Qexit, Fcons (make_number (0), Qnil));
@@ -840,7 +838,7 @@ nil, indicating the current buffer's process. */)
return process;
p = XPROCESS (process);
- if (!NILP (p->raw_status_low))
+ if (p->raw_status_new)
update_status (p);
status = p->status;
if (CONSP (status))
@@ -865,7 +863,7 @@ If PROCESS has not yet exited or died, return 0. */)
register Lisp_Object process;
{
CHECK_PROCESS (process);
- if (!NILP (XPROCESS (process)->raw_status_low))
+ if (XPROCESS (process)->raw_status_new)
update_status (XPROCESS (process));
if (CONSP (XPROCESS (process)->status))
return XCAR (XCDR (XPROCESS (process)->status));
@@ -880,7 +878,9 @@ For a network connection, this value is nil. */)
register Lisp_Object process;
{
CHECK_PROCESS (process);
- return XPROCESS (process)->pid;
+ return (XPROCESS (process)->pid
+ ? make_fixnum_or_float (XPROCESS (process)->pid)
+ : Qnil);
}
DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0,
@@ -1362,7 +1362,7 @@ list_processes_1 (query_only)
Finsert (1, &p->name);
Findent_to (i_status, minspace);
- if (!NILP (p->raw_status_low))
+ if (p->raw_status_new)
update_status (p);
symbol = p->status;
if (CONSP (p->status))
@@ -1734,7 +1734,7 @@ start_process_unwind (proc)
abort ();
/* Was PROC started successfully? */
- if (XINT (XPROCESS (proc)->pid) <= 0)
+ if (XPROCESS (proc)->pid <= 0)
remove_process (proc);
return Qnil;
@@ -1945,7 +1945,7 @@ create_process (process, new_argv, current_dir)
in the table after this function has returned; if it does
it might cause call-process to hang and subsequent asynchronous
processes to get their return values scrambled. */
- XSETINT (XPROCESS (process)->pid, -1);
+ XPROCESS (process)->pid = -1;
BLOCK_INPUT;
@@ -2136,7 +2136,7 @@ create_process (process, new_argv, current_dir)
else
{
/* vfork succeeded. */
- XSETFASTINT (XPROCESS (process)->pid, pid);
+ XPROCESS (process)->pid = pid;
#ifdef WINDOWSNT
register_child (pid, inchannel);
@@ -3354,7 +3354,7 @@ usage: (make-network-process &rest ARGS) */)
p->kill_without_query = Qt;
if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
p->command = Qt;
- p->pid = Qnil;
+ p->pid = 0;
XSETINT (p->infd, inch);
XSETINT (p->outfd, outch);
if (is_server && socktype == SOCK_STREAM)
@@ -4070,7 +4070,7 @@ server_accept_connection (server, channel)
p->sentinel = ps->sentinel;
p->filter = ps->filter;
p->command = Qnil;
- p->pid = Qnil;
+ p->pid = 0;
XSETINT (p->infd, s);
XSETINT (p->outfd, s);
p->status = Qrun;
@@ -4370,9 +4370,9 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
/* Don't wait for output from a non-running process. Just
read whatever data has already been received. */
- if (wait_proc != 0 && !NILP (wait_proc->raw_status_low))
+ if (wait_proc && wait_proc->raw_status_new)
update_status (wait_proc);
- if (wait_proc != 0
+ if (wait_proc
&& ! EQ (wait_proc->status, Qrun)
&& ! EQ (wait_proc->status, Qconnect))
{
@@ -4756,7 +4756,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
/* Preserve status of processes already terminated. */
XSETINT (XPROCESS (proc)->tick, ++process_tick);
deactivate_process (proc);
- if (!NILP (XPROCESS (proc)->raw_status_low))
+ if (XPROCESS (proc)->raw_status_new)
update_status (XPROCESS (proc));
if (EQ (XPROCESS (proc)->status, Qrun))
XPROCESS (proc)->status
@@ -5293,7 +5293,7 @@ send_process (proc, buf, len, object)
VMS_PROC_STUFF *vs, *get_vms_process_pointer();
#endif /* VMS */
- if (! NILP (p->raw_status_low))
+ if (p->raw_status_new)
update_status (p);
if (! EQ (p->status, Qrun))
error ("Process %s not running", SDATA (p->name));
@@ -5557,8 +5557,7 @@ send_process (proc, buf, len, object)
proc = process_sent_to;
p = XPROCESS (proc);
#endif
- p->raw_status_low = Qnil;
- p->raw_status_high = Qnil;
+ p->raw_status_new = 0;
p->status = Fcons (Qexit, Fcons (make_number (256), Qnil));
XSETINT (p->tick, ++process_tick);
deactivate_process (proc);
@@ -5673,7 +5672,7 @@ return t unconditionally. */)
gid = emacs_get_tty_pgrp (p);
- if (gid == XFASTINT (p->pid))
+ if (gid == p->pid)
return Qnil;
return Qt;
}
@@ -5720,7 +5719,7 @@ process_send_signal (process, signo, current_group, nomsg)
/* If we are using pgrps, get a pgrp number and make it negative. */
if (NILP (current_group))
/* Send the signal to the shell's process group. */
- gid = XFASTINT (p->pid);
+ gid = p->pid;
else
{
#ifdef SIGNALS_VIA_CHARACTERS
@@ -5839,7 +5838,7 @@ process_send_signal (process, signo, current_group, nomsg)
if (gid == -1)
/* If we can't get the information, assume
the shell owns the tty. */
- gid = XFASTINT (p->pid);
+ gid = p->pid;
/* It is not clear whether anything really can set GID to -1.
Perhaps on some system one of those ioctls can or could do so.
@@ -5849,12 +5848,12 @@ process_send_signal (process, signo, current_group, nomsg)
#else /* ! defined (TIOCGPGRP ) */
/* Can't select pgrps on this system, so we know that
the child itself heads the pgrp. */
- gid = XFASTINT (p->pid);
+ gid = p->pid;
#endif /* ! defined (TIOCGPGRP ) */
/* If current_group is lambda, and the shell owns the terminal,
don't send any signal. */
- if (EQ (current_group, Qlambda) && gid == XFASTINT (p->pid))
+ if (EQ (current_group, Qlambda) && gid == p->pid)
return;
}
@@ -5862,8 +5861,7 @@ process_send_signal (process, signo, current_group, nomsg)
{
#ifdef SIGCONT
case SIGCONT:
- p->raw_status_low = Qnil;
- p->raw_status_high = Qnil;
+ p->raw_status_new = 0;
p->status = Qrun;
XSETINT (p->tick, ++process_tick);
if (!nomsg)
@@ -5882,7 +5880,7 @@ process_send_signal (process, signo, current_group, nomsg)
#endif
case SIGKILL:
#ifdef VMS
- sys$forcex (&(XFASTINT (p->pid)), 0, 1);
+ sys$forcex (&(p->pid), 0, 1);
whoosh:
#endif
flush_pending_output (XINT (p->infd));
@@ -5894,7 +5892,7 @@ process_send_signal (process, signo, current_group, nomsg)
obvious alternative. */
if (no_pgrp)
{
- kill (XFASTINT (p->pid), signo);
+ kill (p->pid, signo);
return;
}
@@ -5907,7 +5905,7 @@ process_send_signal (process, signo, current_group, nomsg)
}
else
{
- gid = - XFASTINT (p->pid);
+ gid = - p->pid;
kill (gid, signo);
}
#else /* ! defined (TIOCSIGSEND) */
@@ -6027,11 +6025,17 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
(process, sigcode)
Lisp_Object process, sigcode;
{
- Lisp_Object pid;
+ pid_t pid;
if (INTEGERP (process))
{
- pid = process;
+ pid = XINT (process);
+ goto got_it;
+ }
+
+ if (FLOATP (process))
+ {
+ pid = (pid_t) XFLOAT (process);
goto got_it;
}
@@ -6040,8 +6044,8 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
Lisp_Object tem;
if (tem = Fget_process (process), NILP (tem))
{
- pid = Fstring_to_number (process, make_number (10));
- if (XINT (pid) != 0)
+ pid = XINT (Fstring_to_number (process, make_number (10)));
+ if (pid > 0)
goto got_it;
}
process = tem;
@@ -6054,7 +6058,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
CHECK_PROCESS (process);
pid = XPROCESS (process)->pid;
- if (!INTEGERP (pid) || XINT (pid) <= 0)
+ if (pid <= 0)
error ("Cannot signal process %s", SDATA (XPROCESS (process)->name));
got_it:
@@ -6173,7 +6177,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
#undef handle_signal
- return make_number (kill (XINT (pid), XINT (sigcode)));
+ return make_number (kill (pid, XINT (sigcode)));
}
DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0,
@@ -6197,7 +6201,7 @@ text to PROCESS after you call this function. */)
coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)];
/* Make sure the process is really alive. */
- if (! NILP (XPROCESS (proc)->raw_status_low))
+ if (XPROCESS (proc)->raw_status_new)
update_status (XPROCESS (proc));
if (! EQ (XPROCESS (proc)->status, Qrun))
error ("Process %s not running", SDATA (XPROCESS (proc)->name));
@@ -6222,7 +6226,7 @@ text to PROCESS after you call this function. */)
for communication with the subprocess, call shutdown to cause EOF.
(In some old system, shutdown to socketpair doesn't work.
Then we just can't win.) */
- if (NILP (XPROCESS (proc)->pid)
+ if (XPROCESS (proc)->pid == 0
|| XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd))
shutdown (XINT (XPROCESS (proc)->outfd), 1);
/* In case of socketpair, outfd == infd, so don't close it. */
@@ -6359,7 +6363,7 @@ sigchld_handler (signo)
{
proc = XCDR (XCAR (tail));
p = XPROCESS (proc);
- if (GC_EQ (p->childp, Qt) && XINT (p->pid) == pid)
+ if (GC_EQ (p->childp, Qt) && p->pid == pid)
break;
p = 0;
}
@@ -6371,7 +6375,7 @@ sigchld_handler (signo)
{
proc = XCDR (XCAR (tail));
p = XPROCESS (proc);
- if (GC_INTEGERP (p->pid) && XINT (p->pid) == -1)
+ if (p->pid == -1)
break;
p = 0;
}
@@ -6384,8 +6388,8 @@ sigchld_handler (signo)
XSETINT (p->tick, ++process_tick);
u.wt = w;
- XSETINT (p->raw_status_low, u.i & 0xffff);
- XSETINT (p->raw_status_high, u.i >> 16);
+ p->raw_status = u.i;
+ p->raw_status_new = 1;
/* If process has terminated, stop waiting for its output. */
if ((WIFSIGNALED (w) || WIFEXITED (w))
@@ -6582,7 +6586,7 @@ status_notify (deleting_process)
buffer = p->buffer;
/* Get the text to use for the message. */
- if (!NILP (p->raw_status_low))
+ if (p->raw_status_new)
update_status (p);
msg = status_message (p);
diff --git a/src/process.h b/src/process.h
index 9625556888..c4b4281fed 100644
--- a/src/process.h
+++ b/src/process.h
@@ -51,8 +51,6 @@ struct Lisp_Process
Lisp_Object log;
/* Buffer that output is going to */
Lisp_Object buffer;
- /* Number of this process */
- Lisp_Object pid;
/* t if this is a real child process.
For a net connection, it is a plist based on the arguments to make-network-process. */
Lisp_Object childp;
@@ -63,10 +61,6 @@ struct Lisp_Process
/* Non-nil means kill silently if Emacs is exited.
This is the inverse of the `query-on-exit' flag. */
Lisp_Object kill_without_query;
- /* Record the process status in the raw form in which it comes from `wait'.
- This is to avoid consing in a signal handler. */
- Lisp_Object raw_status_low;
- Lisp_Object raw_status_high;
/* Symbol indicating status of process.
This may be a symbol: run, open, or closed.
Or it may be a list, whose car is stop, exit or signal
@@ -112,6 +106,19 @@ struct Lisp_Process
Lisp_Object read_output_delay;
/* Skip reading this process on next read. */
Lisp_Object read_output_skip;
+
+ /* After this point, there are no Lisp_Objects any more. */
+
+ /* Number of this process.
+ allocate_process assumes this is the first non-Lisp_Object field.
+ A value 0 is used for pseudo-processes such as network connections. */
+ pid_t pid;
+ /* Record the process status in the raw form in which it comes from `wait'.
+ This is to avoid consing in a signal handler. The `raw_status_new'
+ flag indicates that `raw_status' contains a new status that still
+ needs to be synced to `status'. */
+ int raw_status_new : 1;
+ int raw_status;
};
/* Every field in the preceding structure except for the first two
diff --git a/src/puresize.h b/src/puresize.h
index 7d6179dc07..168e1e7980 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -65,7 +65,7 @@ Boston, MA 02110-1301, USA. */
{ if (PURE_P (obj)) \
pure_write_error (); }
-extern void pure_write_error P_ ((void));
+extern void pure_write_error P_ ((void)) NO_RETURN;
/* Define PURE_P. */
diff --git a/src/search.c b/src/search.c
index b92812597d..dfbf66fc7e 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1720,7 +1720,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
ch = -1;
}
- if (ch > 0400)
+ if (ch >= 0400)
j = ((unsigned char) ch) | 0200;
else
j = *ptr;
@@ -1739,7 +1739,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
while (1)
{
TRANSLATE (ch, inverse_trt, ch);
- if (ch > 0400)
+ if (ch >= 0400)
j = ((unsigned char) ch) | 0200;
else
j = (unsigned char) ch;
diff --git a/src/w32fns.c b/src/w32fns.c
index 55f4af03d6..093739d160 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3297,6 +3297,14 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP);
case WM_MOUSEMOVE:
+ /* Ignore mouse movements as long as the menu is active. These
+ movements are processed by the window manager anyway, and
+ it's wrong to handle them as if they happened on the
+ underlying frame. */
+ f = x_window_to_frame (dpyinfo, hwnd);
+ if (f && f->output_data.w32->menubar_active)
+ return 0;
+
/* If the mouse has just moved into the frame, start tracking
it, so we will be notified when it leaves the frame. Mouse
tracking only works under W98 and NT4 and later. On earlier
@@ -7668,9 +7676,12 @@ Text larger than the specified size is clipped. */)
AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
FRAME_EXTERNAL_MENU_BAR (f));
- /* Position and size tooltip, and put it in the topmost group. */
+ /* Position and size tooltip, and put it in the topmost group.
+ The add-on of 3 to the 5th argument is a kludge: without it,
+ some fonts cause the last character of the tip to be truncated,
+ for some obscure reason. */
SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
- root_x, root_y, rect.right - rect.left,
+ root_x, root_y, rect.right - rect.left + 3,
rect.bottom - rect.top, SWP_NOACTIVATE);
/* Ensure tooltip is on top of other topmost windows (eg menus). */