aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey <[email protected]>2006-03-12 04:51:49 +0000
committerKaroly Lorentey <[email protected]>2006-03-12 04:51:49 +0000
commita6b6d0863c1b96e14ba3a2d1b9c941fbbcc8adf2 (patch)
treeab087c9b03ec98c1648cb02b4ee49096a1052e44 /src
parent33780b9521e3a416283b46dcd7e3ebb84bbffd67 (diff)
parent8cf1c5a44266bbd0f9919e854deee1d7361facd1 (diff)
Merged from [email protected]
Patches applied: * [email protected]/emacs--devo--0--patch-144 Update from CVS * [email protected]/emacs--devo--0--patch-145 Update from CVS * [email protected]/emacs--devo--0--patch-146 Update from CVS * [email protected]/emacs--devo--0--patch-147 Merge from gnus--rel--5.10 * [email protected]/emacs--devo--0--patch-148 Update from CVS * [email protected]/emacs--devo--0--patch-149 Update from CVS * [email protected]/emacs--devo--0--patch-150 Update from CVS * [email protected]/emacs--devo--0--patch-151 Merge from gnus--rel--5.10 * [email protected]/emacs--devo--0--patch-152 Update from CVS * [email protected]/gnus--rel--5.10--patch-56 Update from CVS * [email protected]/gnus--rel--5.10--patch-57 Copy/update icons from Gnus trunk git-archimport-id: [email protected]/emacs--multi-tty--0--patch-530
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog107
-rw-r--r--src/alloc.c12
-rw-r--r--src/coding.c2
-rw-r--r--src/eval.c26
-rw-r--r--src/keymap.c2
-rw-r--r--src/lisp.h8
-rw-r--r--src/macterm.c14
-rw-r--r--src/mem-limits.h86
-rw-r--r--src/process.c2
-rw-r--r--src/vm-limit.c208
-rw-r--r--src/w32fns.c5
-rw-r--r--src/w32term.c2
-rw-r--r--src/window.c23
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfns.c1
-rw-r--r--src/xterm.c19
16 files changed, 333 insertions, 186 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index db10f46024..389538b161 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,9 +1,95 @@
+2006-03-11 Luc Teirlinck <[email protected]>
+
+ * window.c: Rename preserve_y to window_scroll_pixel_based_preserve_y.
+ (window_scroll_pixel_based, syms_of_window): Adapt to above change.
+
+2006-03-11 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_wnd_proc): Ignore middle and extra button events
+ if a menu is already active (the menubar_active flag is on).
+
+2006-03-11 David Ponce <[email protected]>
+
+ * xfns.c (x_create_tip_frame): Preserve received parms by copying
+ them.
+
+2006-03-11 Eli Zaretskii <[email protected]>
+
+ * w32term.c: Add x_fully_uncatch_errors and x_catching_errors to
+ the list of unused display error handling functions.
+
+ * eval.c (unwind_to_catch): Call x_fully_uncatch_errors only if
+ HAVE_X_WINDOWS.
+ (internal_condition_case, internal_condition_case_1)
+ (internal_condition_case_2): Call x_catching_errors only if
+ HAVE_X_WINDOWS.
+
+ * vm-limit.c [HAVE_GETRLIMIT]: Don't define unconditionally.
+ Don't include sys/resource.h unless defined.
+
+2006-03-11 Richard Stallman <[email protected]>
+
+ * keymap.c (describe_map): Shorten string to indicate shadowed binding.
+
+ * vm-limit.c (get_lim_data, lim_data, data_space_start):
+ Moved from mem-limits.h.
+ (enum warnlevel): New data type.
+ (check_memory_limits): Rewrite the logic about warnings.
+ Use standard `struct rlimit'. Check return values for nonsense.
+ (memory_warnings): Always clear lim_data.
+
+ * mem-limits.h (get_lim_data, lim_data, data_space_start):
+ Moved to vm-limit.c.
+
+ * xterm.c (x_fully_uncatch_errors, x_catching_errors): New functions.
+
+ * eval.c (unwind_to_catch): Call x_fully_uncatch_errors.
+ (internal_condition_case_1, internal_condition_case_2):
+ Abort if within unclosed x_catch_errors.
+
+2006-03-11 Romain Francoise <[email protected]>
+
+ * process.c (Vprocess_adaptive_read_buffering): Doc fix.
+
+2006-03-11 Giorgos Keramidas <[email protected]> (tiny change)
+
+ * lisp.h: Remove duplicate prototypes. Make the prototype of
+ getloadavg be conditioned on HAVE_GETLOADAVG being undefined.
+
+2006-03-11 Eli Zaretskii <[email protected]>
+
+ * xterm.c (x_draw_hollow_cursor): Subtract 1 from the last
+ argument of XDrawRectangle.
+
+ * xdisp.c (get_phys_cursor_geometry): Don't decrease height by 1.
+
+ * macterm.c (mac_draw_rectangle): Don't add 1 to width and height.
+ (x_draw_glyph_string_foreground)
+ (x_draw_composite_glyph_string_foreground)
+ (x_draw_image_foreground): Don't subtract 1 from width and height
+ arguments to mac_draw_rectangle.
+ (x_draw_hollow_cursor): Add 1 to w->phys_cursor_width.
+
+2006-03-10 Kim F. Storm <[email protected]>
+
+ * alloc.c (USE_POSIX_MEMALIGN): Fix last change.
+
+2006-03-09 Stefan Monnier <[email protected]>
+
+ * alloc.c (USE_POSIX_MEMALIGN): New macro.
+ (ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it.
+
+2006-03-09 Kenichi Handa <[email protected]>
+
+ * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding
+ ASCII component of a composition.
+
2006-03-08 Luc Teirlinck <[email protected]>
* window.c: Declare preserve_y as a static global variable.
(window_scroll_pixel_based): No longer declare preserve_y;
it is global now.
- (syms_of_window): set preserve_y to -1.
+ (syms_of_window): Set preserve_y to -1.
2006-03-08 YAMAMOTO Mitsuharu <[email protected]>
@@ -23,10 +109,10 @@
(MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines.
* macfns.c (x_default_scroll_bar_color_parameter)
- (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Remove
- unnecessary prototypes.
- (x_set_scroll_bar_default_width): Use
- MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH.
+ (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
+ Remove unnecessary prototypes.
+ (x_set_scroll_bar_default_width):
+ Use MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH.
(mac_set_scroll_bar_width): New function.
(mac_frame_parm_handlers): Set it as handler for scroll-bar-width.
@@ -38,7 +124,7 @@
(mac_handle_command_event, mac_handle_window_event)
(mac_handle_mouse_event): Check error code of GetEventParameter.
(convert_fn_keycode) [MAC_OSX]: Likewise.
-
+
2006-03-05 Andreas Schwab <[email protected]>
* xselect.c (x_catch_errors_unwind): Fix missing return value.
@@ -52,9 +138,9 @@
lines, by distributing the rows evenly over the tool-bar screen area.
(Vtool_bar_border): New variable.
(syms_of_xdisp): DEFVAR_LISP it.
- (display_tool_bar_line): Add HEIGHT arg for desired row height. Make
- tool-bar row the desired height. Use default face for border below
- tool-bar.
+ (display_tool_bar_line): Add HEIGHT arg for desired row height.
+ Make tool-bar row the desired height. Use default face for border
+ below tool-bar.
(tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of
actual tool-bar rows.
(redisplay_tool_bar): Calculate f->n_tool_bar_rows initially.
@@ -81,8 +167,7 @@
2006-02-26 Chong Yidong <[email protected]>
- * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
- argument.
+ * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument.
* xterm.c: (x_load_font, x_term_init, XTmouse_position)
(handle_one_xevent, x_connection_closed, x_list_fonts): No arg for
diff --git a/src/alloc.c b/src/alloc.c
index 74c3c66173..259143ffad 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -885,6 +885,12 @@ lisp_free (block)
/* The entry point is lisp_align_malloc which returns blocks of at most */
/* BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */
+/* Use posix_memalloc if the system has it and we're using the system's
+ malloc (because our gmalloc.c routines don't have posix_memalign although
+ its memalloc could be used). */
+#if defined (HAVE_POSIX_MEMALIGN) && defined (SYSTEM_MALLOC)
+#define USE_POSIX_MEMALIGN 1
+#endif
/* BLOCK_ALIGN has to be a power of 2. */
#define BLOCK_ALIGN (1 << 10)
@@ -950,7 +956,7 @@ struct ablocks
#define ABLOCKS_BUSY(abase) ((abase)->blocks[0].abase)
/* Pointer to the (not necessarily aligned) malloc block. */
-#ifdef HAVE_POSIX_MEMALIGN
+#ifdef USE_POSIX_MEMALIGN
#define ABLOCKS_BASE(abase) (abase)
#else
#define ABLOCKS_BASE(abase) \
@@ -991,7 +997,7 @@ lisp_align_malloc (nbytes, type)
mallopt (M_MMAP_MAX, 0);
#endif
-#ifdef HAVE_POSIX_MEMALIGN
+#ifdef USE_POSIX_MEMALIGN
{
int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES);
if (err)
@@ -1107,7 +1113,7 @@ lisp_align_free (block)
}
eassert ((aligned & 1) == aligned);
eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1));
-#ifdef HAVE_POSIX_MEMALIGN
+#ifdef USE_POSIX_MEMALIGN
eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0);
#endif
free (ABLOCKS_BASE (abase));
diff --git a/src/coding.c b/src/coding.c
index 2d5618649d..26d47da931 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -731,7 +731,7 @@ detect_coding_emacs_mule (src, src_end, multibytep)
c = -1; \
else \
{ \
- c -= 0xA0; \
+ c -= 0x80; \
*p++ = c; \
} \
} \
diff --git a/src/eval.c b/src/eval.c
index a84948981f..86ee384896 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1259,6 +1259,12 @@ unwind_to_catch (catch, value)
}
while (! last_time);
+#if HAVE_X_WINDOWS
+ /* If x_catch_errors was done, turn it off now.
+ (First we give unbind_to a chance to do that.) */
+ x_fully_uncatch_errors ();
+#endif
+
byte_stack_list = catch->byte_stack;
gcprolist = catch->gcpro;
#ifdef DEBUG_GCPRO
@@ -1435,8 +1441,10 @@ internal_condition_case (bfun, handlers, hfun)
struct catchtag c;
struct handler h;
-#if 0 /* We now handle interrupt_input_blocked properly.
- What we still do not handle is exiting a signal handler. */
+ /* Since Fsignal will close off all calls to x_catch_errors,
+ we will get the wrong results if some are not closed now. */
+#if HAVE_X_WINDOWS
+ if (x_catching_errors ())
abort ();
#endif
@@ -1481,6 +1489,13 @@ internal_condition_case_1 (bfun, arg, handlers, hfun)
struct catchtag c;
struct handler h;
+ /* Since Fsignal will close off all calls to x_catch_errors,
+ we will get the wrong results if some are not closed now. */
+#if HAVE_X_WINDOWS
+ if (x_catching_errors ())
+ abort ();
+#endif
+
c.tag = Qnil;
c.val = Qnil;
c.backlist = backtrace_list;
@@ -1525,6 +1540,13 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
struct catchtag c;
struct handler h;
+ /* Since Fsignal will close off all calls to x_catch_errors,
+ we will get the wrong results if some are not closed now. */
+#if HAVE_X_WINDOWS
+ if (x_catching_errors ())
+ abort ();
+#endif
+
c.tag = Qnil;
c.val = Qnil;
c.backlist = backtrace_list;
diff --git a/src/keymap.c b/src/keymap.c
index ca8edab122..fc7b23f630 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3364,7 +3364,7 @@ describe_map (map, prefix, elt_describer, partial, shadow,
if (vect[i].shadowed)
{
SET_PT (PT - 1);
- insert_string (" (binding currently shadowed)");
+ insert_string (" (shadowed)");
SET_PT (PT + 1);
}
}
diff --git a/src/lisp.h b/src/lisp.h
index 4cca3a60ca..efc8a8f19d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2732,7 +2732,6 @@ EXFUN (Fbobp, 0);
EXFUN (Fformat, MANY);
EXFUN (Fmessage, MANY);
extern Lisp_Object format2 P_ ((char *, Lisp_Object, Lisp_Object));
-extern Lisp_Object make_buffer_string P_ ((int, int, int));
EXFUN (Fbuffer_substring, 2);
EXFUN (Fbuffer_string, 0);
extern Lisp_Object save_excursion_save P_ ((void));
@@ -2751,7 +2750,6 @@ extern Lisp_Object make_buffer_string P_ ((int, int, int));
extern Lisp_Object make_buffer_string_both P_ ((int, int, int, int, int));
extern void init_editfns P_ ((void));
extern void syms_of_editfns P_ ((void));
-EXFUN (Fcurrent_message, 0);
extern Lisp_Object Vinhibit_field_text_motion;
EXFUN (Fconstrain_to_field, 5);
EXFUN (Ffield_string, 1);
@@ -2849,7 +2847,6 @@ extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
extern void report_file_error P_ ((const char *, Lisp_Object));
extern int internal_delete_file P_ ((Lisp_Object));
extern void syms_of_fileio P_ ((void));
-EXFUN (Fmake_temp_name, 1);
extern void init_fileio_once P_ ((void));
extern Lisp_Object make_temp_name P_ ((Lisp_Object, int));
EXFUN (Fmake_symbolic_link, 3);
@@ -3202,8 +3199,10 @@ EXFUN (Fset_fontset_font, 4);
/* Defined in xfaces.c */
extern void syms_of_xfaces P_ ((void));
+#ifndef HAVE_GETLOADAVG
/* Defined in getloadavg.c */
extern int getloadavg P_ ((double *, int));
+#endif
#ifdef HAVE_X_WINDOWS
/* Defined in xfns.c */
@@ -3224,9 +3223,6 @@ extern void syms_of_xselect P_ ((void));
/* Defined in xterm.c */
extern void syms_of_xterm P_ ((void));
-/* Defined in getloadavg.c */
-extern int getloadavg P_ ((double [], int));
-
#ifdef MSDOS
/* Defined in msdos.c */
EXFUN (Fmsdos_downcase_filename, 1);
diff --git a/src/macterm.c b/src/macterm.c
index 7f682515f4..9252d3bd91 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -598,7 +598,7 @@ mac_draw_rectangle (f, gc, x, y, width, height)
SetPortWindowPort (FRAME_MAC_WINDOW (f));
RGBForeColor (GC_FORE_COLOR (gc));
- SetRect (&r, x, y, x + width + 1, y + height + 1);
+ SetRect (&r, x, y, x + width, y + height);
mac_begin_clip (gc);
FrameRect (&r); /* using foreground color of gc */
@@ -2436,7 +2436,7 @@ x_draw_glyph_string_foreground (s)
{
struct glyph *g = s->first_glyph + i;
mac_draw_rectangle (s->f, s->gc, x, s->y,
- g->pixel_width - 1, s->height - 1);
+ g->pixel_width, s->height);
x += g->pixel_width;
}
}
@@ -2515,7 +2515,7 @@ x_draw_composite_glyph_string_foreground (s)
{
if (s->gidx == 0)
mac_draw_rectangle (s->f, s->gc, x, s->y,
- s->width - 1, s->height - 1);
+ s->width, s->height);
}
else
{
@@ -3068,15 +3068,15 @@ x_draw_image_foreground (s)
int r = s->img->relief;
if (r < 0) r = -r;
mac_draw_rectangle (s->f, s->gc, x - r, y - r,
- s->slice.width + r*2 - 1,
- s->slice.height + r*2 - 1);
+ s->slice.width + r*2,
+ s->slice.height + r*2);
}
}
}
else
/* Draw a rectangle if image could not be loaded. */
mac_draw_rectangle (s->f, s->gc, x, y,
- s->slice.width - 1, s->slice.height - 1);
+ s->slice.width, s->slice.height);
}
@@ -5245,7 +5245,7 @@ x_draw_hollow_cursor (w, row)
/* Compute frame-relative coordinates for phys cursor. */
x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
y = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
- wd = w->phys_cursor_width;
+ wd = w->phys_cursor_width + 1;
/* The foreground of cursor_gc is typically the same as the normal
background color, which can cause the cursor box to be invisible. */
diff --git a/src/mem-limits.h b/src/mem-limits.h
index 292293b2f9..45dabca3ac 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -112,91 +112,5 @@ extern char etext;
#endif /* not _LIBC */
-/* start of data space; can be changed by calling malloc_init */
-static POINTER data_space_start;
-
-/* Number of bytes of writable memory we can expect to be able to get */
-static unsigned long lim_data;
-
-#ifdef NO_LIM_DATA
-static void
-get_lim_data ()
-{
- lim_data = -1;
-}
-#else /* not NO_LIM_DATA */
-
-#ifdef USG
-
-static void
-get_lim_data ()
-{
- extern long ulimit ();
-
- lim_data = -1;
-
- /* Use the ulimit call, if we seem to have it. */
-#if !defined (ULIMIT_BREAK_VALUE) || defined (GNU_LINUX)
- lim_data = ulimit (3, 0);
-#endif
-
- /* If that didn't work, just use the macro's value. */
-#ifdef ULIMIT_BREAK_VALUE
- if (lim_data == -1)
- lim_data = ULIMIT_BREAK_VALUE;
-#endif
-
- lim_data -= (long) data_space_start;
-}
-
-#else /* not USG */
-#ifdef WINDOWSNT
-
-static void
-get_lim_data ()
-{
- extern unsigned long reserved_heap_size;
- lim_data = reserved_heap_size;
-}
-
-#else
-#if !defined (BSD4_2) && !defined (__osf__)
-
-#ifdef MSDOS
-void
-get_lim_data ()
-{
- _go32_dpmi_meminfo info;
-
- _go32_dpmi_get_free_memory_information (&info);
- lim_data = info.available_memory;
-}
-#else /* not MSDOS */
-static void
-get_lim_data ()
-{
- lim_data = vlimit (LIM_DATA, -1);
-}
-#endif /* not MSDOS */
-
-#else /* BSD4_2 */
-
-static void
-get_lim_data ()
-{
- struct rlimit XXrlimit;
-
- getrlimit (RLIMIT_DATA, &XXrlimit);
-#ifdef RLIM_INFINITY
- lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
-#else
- lim_data = XXrlimit.rlim_cur; /* soft limit */
-#endif
-}
-#endif /* BSD4_2 */
-#endif /* not WINDOWSNT */
-#endif /* not USG */
-#endif /* not NO_LIM_DATA */
-
/* arch-tag: fe39244e-e54f-4208-b7aa-02556f7841c5
(do not change this comment) */
diff --git a/src/process.c b/src/process.c
index 99f2773391..a82932ba57 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6983,7 +6983,7 @@ On some systems, when Emacs reads the output from a subprocess, the output data
is read in very small blocks, potentially resulting in very poor performance.
This behavior can be remedied to some extent by setting this variable to a
non-nil value, as it will automatically delay reading from such processes, to
-allowing them to produce more output before Emacs tries to read it.
+allow them to produce more output before Emacs tries to read it.
If the value is t, the delay is reset after each write to the process; any other
non-nil value means that the delay is not reset on write.
The variable takes effect when `start-process' is called. */);
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 48d13c323a..cadfb4cc95 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -44,13 +44,102 @@ typedef void *POINTER;
2 -- 85% warning already issued.
3 -- 95% warning issued; keep warning frequently.
*/
-static int warnlevel;
+enum warnlevel { not_warned, warned_75, warned_85, warned_95 };
+
+static enum warnlevel warnlevel;
/* Function to call to issue a warning;
0 means don't issue them. */
static void (*warn_function) ();
-/* Get more memory space, complaining if we're near the end. */
+/* Start of data space; can be changed by calling malloc_init. */
+static POINTER data_space_start;
+
+/* Number of bytes of writable memory we can expect to be able to get. */
+static unsigned long lim_data;
+
+
+#ifdef NO_LIM_DATA
+static void
+get_lim_data ()
+{
+ lim_data = -1;
+}
+#else /* not NO_LIM_DATA */
+
+#ifdef USG
+
+static void
+get_lim_data ()
+{
+ extern long ulimit ();
+
+ lim_data = -1;
+
+ /* Use the ulimit call, if we seem to have it. */
+#if !defined (ULIMIT_BREAK_VALUE) || defined (GNU_LINUX)
+ lim_data = ulimit (3, 0);
+#endif
+
+ /* If that didn't work, just use the macro's value. */
+#ifdef ULIMIT_BREAK_VALUE
+ if (lim_data == -1)
+ lim_data = ULIMIT_BREAK_VALUE;
+#endif
+
+ lim_data -= (long) data_space_start;
+}
+
+#else /* not USG */
+#ifdef WINDOWSNT
+
+static void
+get_lim_data ()
+{
+ extern unsigned long reserved_heap_size;
+ lim_data = reserved_heap_size;
+}
+
+#else
+#if !defined (BSD4_2) && !defined (__osf__)
+
+#ifdef MSDOS
+void
+get_lim_data ()
+{
+ _go32_dpmi_meminfo info;
+
+ _go32_dpmi_get_free_memory_information (&info);
+ lim_data = info.available_memory;
+}
+#else /* not MSDOS */
+static void
+get_lim_data ()
+{
+ lim_data = vlimit (LIM_DATA, -1);
+}
+#endif /* not MSDOS */
+
+#else /* BSD4_2 */
+
+static void
+get_lim_data ()
+{
+ struct rlimit XXrlimit;
+
+ getrlimit (RLIMIT_DATA, &XXrlimit);
+#ifdef RLIM_INFINITY
+ lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
+#else
+ lim_data = XXrlimit.rlim_cur; /* soft limit */
+#endif
+}
+#endif /* BSD4_2 */
+#endif /* not WINDOWSNT */
+#endif /* not USG */
+#endif /* not NO_LIM_DATA */
+
+/* Verify amount of memory available, complaining if we're near the end. */
static void
check_memory_limits ()
@@ -64,14 +153,19 @@ check_memory_limits ()
register POINTER cp;
unsigned long five_percent;
unsigned long data_size;
+ enum warnlevel new_warnlevel;
#ifdef HAVE_GETRLIMIT
- struct rlimit {
- rlim_t rlim_cur;
- rlim_t rlim_max;
- } rlimit;
+ struct rlimit rlimit;
- getrlimit (RLIMIT_DATA, &rlimit);
+ getrlimit (RLIMIT_AS, &rlimit);
+
+ if (RLIM_INFINITY == rlimit.rlim_max)
+ return;
+
+ /* This is a nonsensical case, but it happens -- rms. */
+ if (rlimit.rlim_cur > rlimit.rlim_max)
+ return;
five_percent = rlimit.rlim_max / 20;
data_size = rlimit.rlim_cur;
@@ -93,57 +187,61 @@ check_memory_limits ()
#endif /* not HAVE_GETRLIMIT */
- if (warn_function)
- switch (warnlevel)
- {
- case 0:
- if (data_size > five_percent * 15)
- {
- warnlevel++;
- (*warn_function) ("Warning: past 75% of memory limit");
- }
- break;
-
- case 1:
- if (data_size > five_percent * 17)
- {
- warnlevel++;
- (*warn_function) ("Warning: past 85% of memory limit");
- }
- break;
-
- case 2:
- if (data_size > five_percent * 19)
- {
- warnlevel++;
- (*warn_function) ("Warning: past 95% of memory limit");
- }
- break;
-
- default:
- (*warn_function) ("Warning: past acceptable memory limits");
- break;
- }
-
- /* If we go down below 70% full, issue another 75% warning
- when we go up again. */
- if (data_size < five_percent * 14)
- warnlevel = 0;
- /* If we go down below 80% full, issue another 85% warning
- when we go up again. */
- else if (warnlevel > 1 && data_size < five_percent * 16)
- warnlevel = 1;
- /* If we go down below 90% full, issue another 95% warning
- when we go up again. */
- else if (warnlevel > 2 && data_size < five_percent * 18)
- warnlevel = 2;
+ if (!warn_function)
+ return;
+
+ /* What level of warning does current memory usage demand? */
+ if (data_size > five_percent * 19)
+ new_warnlevel = warned_95;
+ else if (data_size > five_percent * 17)
+ new_warnlevel = warned_85;
+ else if (data_size > five_percent * 15)
+ new_warnlevel = warned_75;
+ else
+ new_warnlevel = not_warned;
+
+ /* If we have gone up a level, give the appropriate warning. */
+ if (new_warnlevel > warnlevel || new_warnlevel == warned_95)
+ {
+ warnlevel = new_warnlevel;
+ switch (warnlevel)
+ {
+ case warned_75:
+ (*warn_function) ("Warning: past 75% of memory limit");
+ break;
+
+ case warned_85:
+ (*warn_function) ("Warning: past 85% of memory limit");
+ break;
+
+ case warned_95:
+ (*warn_function) ("Warning: past 95% of memory limit");
+ }
+ }
+ /* Handle going down in usage levels, with some hysteresis. */
+ else
+ {
+ /* If we go down below 70% full, issue another 75% warning
+ when we go up again. */
+ if (data_size < five_percent * 14)
+ warnlevel = not_warned;
+ /* If we go down below 80% full, issue another 85% warning
+ when we go up again. */
+ else if (warnlevel > warned_75 && data_size < five_percent * 16)
+ warnlevel = warned_75;
+ /* If we go down below 90% full, issue another 95% warning
+ when we go up again. */
+ else if (warnlevel > warned_85 && data_size < five_percent * 18)
+ warnlevel = warned_85;
+ }
if (EXCEEDS_LISP_PTR (cp))
(*warn_function) ("Warning: memory in use exceeds lisp pointer size");
}
-
-/* Cause reinitialization based on job parameters;
- also declare where the end of pure storage is. */
+
+/* Enable memory usage warnings.
+ START says where the end of pure storage is.
+ WARNFUN specifies the function to call to issue a warning. */
void
memory_warnings (start, warnfun)
@@ -160,10 +258,8 @@ memory_warnings (start, warnfun)
warn_function = warnfun;
__after_morecore_hook = check_memory_limits;
-#ifdef WINDOWSNT
/* Force data limit to be recalculated on each run. */
lim_data = 0;
-#endif
}
/* arch-tag: eab04eda-1f69-447a-8d9f-95f0a3983ca5
diff --git a/src/w32fns.c b/src/w32fns.c
index 34450fd521..c116c51603 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3250,6 +3250,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
BOOL up;
int button;
+ /* Ignore middle and extra buttons as long as the menu is active. */
+ f = x_window_to_frame (dpyinfo, hwnd);
+ if (f && f->output_data.w32->menubar_active)
+ return 0;
+
if (parse_button (msg, HIWORD (wParam), &button, &up))
{
if (up) ReleaseCapture ();
diff --git a/src/w32term.c b/src/w32term.c
index 0017d2a5c8..bd04f0cb4b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5236,6 +5236,8 @@ x_error_catcher (display, error)
x_catch_errors (dpy)
x_catch_errors_unwind (old_val)
x_check_errors (dpy, format)
+x_fully_uncatch_errors ()
+x_catching_errors ()
x_had_errors_p (dpy)
x_clear_errors (dpy)
x_uncatch_errors (dpy, count)
diff --git a/src/window.c b/src/window.c
index bc9a956994..23a4eb98e4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -219,7 +219,7 @@ int window_deletion_count;
/* Used by the function window_scroll_pixel_based */
-static int preserve_y;
+static int window_scroll_pixel_based_preserve_y;
#if 0 /* This isn't used anywhere. */
/* Nonzero means we can split a frame even if it is "unsplittable". */
@@ -4797,17 +4797,17 @@ window_scroll_pixel_based (window, n, whole, noerror)
calls to scroll-up or scroll-down. This avoids the
possibility of point becoming "stuck" on a tall line when
scrolling by one line. */
- if (preserve_y < 0
+ if (window_scroll_pixel_based_preserve_y < 0
|| (current_kboard->Vlast_command != Qscroll_up
&& current_kboard->Vlast_command != Qscroll_down))
{
start_display (&it, w, start);
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
- preserve_y = it.current_y;
+ window_scroll_pixel_based_preserve_y = it.current_y;
}
}
else
- preserve_y = -1;
+ window_scroll_pixel_based_preserve_y = -1;
/* Move iterator it from start the specified distance forward or
backward. The result is the new window start. */
@@ -4937,12 +4937,13 @@ window_scroll_pixel_based (window, n, whole, noerror)
|| EQ (Vscroll_preserve_screen_position, Qt)))
/* We found PT at a legitimate height. Leave it alone. */
;
- else if (preserve_y >= 0)
+ else if (window_scroll_pixel_based_preserve_y >= 0)
{
/* If we have a header line, take account of it.
This is necessary because we set it.current_y to 0, above. */
move_it_to (&it, -1, -1,
- preserve_y - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ),
+ window_scroll_pixel_based_preserve_y
+ - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ),
-1, MOVE_TO_Y);
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
}
@@ -4963,7 +4964,8 @@ window_scroll_pixel_based (window, n, whole, noerror)
int charpos, bytepos;
int partial_p;
- /* Save our position, for the preserve_y case. */
+ /* Save our position, for the
+ window_scroll_pixel_based_preserve_y case. */
charpos = IT_CHARPOS (it);
bytepos = IT_BYTEPOS (it);
@@ -4993,14 +4995,15 @@ window_scroll_pixel_based (window, n, whole, noerror)
|| EQ (Vscroll_preserve_screen_position, Qt)))
/* We found PT before we found the display margin, so PT is ok. */
;
- else if (preserve_y >= 0)
+ else if (window_scroll_pixel_based_preserve_y >= 0)
{
SET_TEXT_POS_FROM_MARKER (start, w->start);
start_display (&it, w, start);
/* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT
here because we called start_display again and did not
alter it.current_y this time. */
- move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
+ move_it_to (&it, -1, -1, window_scroll_pixel_based_preserve_y, -1,
+ MOVE_TO_Y);
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
}
else
@@ -7027,7 +7030,7 @@ syms_of_window ()
minibuf_selected_window = Qnil;
staticpro (&minibuf_selected_window);
- preserve_y = -1;
+ window_scroll_pixel_based_preserve_y = -1;
DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function,
doc: /* Non-nil means call as function to display a help buffer.
diff --git a/src/xdisp.c b/src/xdisp.c
index a645efd38a..7bdda29fb0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2020,7 +2020,7 @@ get_phys_cursor_geometry (w, row, glyph, heightp)
}
}
- *heightp = h - 1;
+ *heightp = h;
return WINDOW_TO_FRAME_PIXEL_Y (w, y);
}
diff --git a/src/xfns.c b/src/xfns.c
index d3067e00fe..f2d5530a39 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4610,6 +4610,7 @@ unwind_create_tip_frame (frame)
return deleted;
}
+ parms = Fcopy_alist (parms);
/* Create a frame for a tooltip on the display described by DPYINFO.
PARMS is a list of frame parameters. TEXT is the string to
diff --git a/src/xterm.c b/src/xterm.c
index 0d19cf029b..80b8c914f5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7193,7 +7193,7 @@ x_draw_hollow_cursor (w, row)
/* Set clipping, draw the rectangle, and reset clipping again. */
x_clip_to_row (w, row, TEXT_AREA, gc);
- XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h);
+ XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h - 1);
XSetClipMask (dpy, gc, None);
}
@@ -7604,6 +7604,23 @@ x_clear_errors (dpy)
x_error_message->string[0] = 0;
}
+/* Close off all unclosed x_catch_errors calls. */
+
+void
+x_fully_uncatch_errors ()
+{
+ while (x_error_message)
+ x_uncatch_errors ();
+}
+
+/* Nonzero if x_catch_errors has been done and not yet canceled. */
+
+int
+x_catching_errors ()
+{
+ return x_error_message != 0;
+}
+
#if 0
static unsigned int x_wire_count;
x_trace_wire ()