summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog31
-rw-r--r--src/callproc.c2
-rw-r--r--src/lisp.h9
-rw-r--r--src/msdos.c2
-rw-r--r--src/ralloc.c6
-rw-r--r--src/search.c22
-rw-r--r--src/xdisp.c12
7 files changed, 81 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1ade4691184..a9dae7f68aa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,34 @@
+2012-05-27 Ken Brown <kbrown@cornell.edu>
+
+ * callproc.c (Fcall_process): Restore a line that was accidentally
+ commented out in the 2011-02-13 change (bug#11547).
+
+2012-05-27 Eli Zaretskii <eliz@gnu.org>
+
+ * lisp.h [REL_ALLOC]: Add prototypes for external functions
+ defined on ralloc.c.
+
+ * buffer.c [REL_ALLOC]: Remove prototypes of
+ r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
+ they are now on lisp.h.
+
+ * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
+
+ * search.c (search_buffer): Use it to inhibit relocation of buffer
+ text while re_search_2 is doing its job, because re_search_2 is
+ passed C pointers to buffer text. (Bug#11519)
+
+ * msdos.c (internal_terminal_init) <Vwindow_system_version>:
+ Update value to 24.
+
+ * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
+ state after an additional call to move_it_in_display_line_to, keep
+ the values of it->max_ascent and it->max_descent found for the
+ entire line.
+ (pos_visible_p): Revert the comparison against bottom_y to what it
+ was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
+ (Bug#11464)
+
2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
Fix coding-related core dumps with gcc -ftrapv.
diff --git a/src/callproc.c b/src/callproc.c
index 1dd56749e16..f7c9971907d 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -652,7 +652,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
/* GConf causes us to ignore SIGPIPE, make sure it is restored
in the child. */
- //signal (SIGPIPE, SIG_DFL);
+ signal (SIGPIPE, SIG_DFL);
#ifdef HAVE_WORKING_VFORK
pthread_sigmask (SIG_SETMASK, &procmask, 0);
#endif
diff --git a/src/lisp.h b/src/lisp.h
index 551c15473a7..522f7cec634 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3633,6 +3633,15 @@ void syms_of_dbusbind (void);
/* Defined in msdos.c, w32.c */
extern char *emacs_root_dir (void);
#endif /* DOS_NT */
+
+#ifdef REL_ALLOC
+/* Defined in ralloc.c */
+extern void r_alloc_reset_variable (POINTER_TYPE **, POINTER_TYPE **);
+extern POINTER_TYPE *r_alloc (POINTER_TYPE **, size_t);
+extern POINTER_TYPE *r_re_alloc (POINTER_TYPE **, size_t);
+extern void r_alloc_free (POINTER_TYPE **ptr);
+extern void r_alloc_inhibit_buffer_relocation (int);
+#endif /* REL_ALLOC */
/* Nonzero means Emacs has already been initialized.
Used during startup to detect startup of dumped Emacs. */
diff --git a/src/msdos.c b/src/msdos.c
index 5f46829aefd..c6213b566b8 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1813,7 +1813,7 @@ internal_terminal_init (void)
}
Vinitial_window_system = Qpc;
- Vwindow_system_version = make_number (23); /* RE Emacs version */
+ Vwindow_system_version = make_number (24); /* RE Emacs version */
tty->terminal->type = output_msdos_raw;
/* If Emacs was dumped on DOS/V machine, forget the stale VRAM
diff --git a/src/ralloc.c b/src/ralloc.c
index d736e279520..7fdef69842a 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1139,6 +1139,12 @@ r_alloc_reset_variable (POINTER *old, POINTER *new)
bloc->variable = new;
}
+void
+r_alloc_inhibit_buffer_relocation (int inhibit)
+{
+ use_relocatable_buffers = !inhibit;
+}
+
/***********************************************************************
Initialization
diff --git a/src/search.c b/src/search.c
index a9542a2ed97..5608e344e75 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1159,12 +1159,25 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
while (n < 0)
{
ptrdiff_t val;
+
+#ifdef REL_ALLOC
+ /* re_search_2 below is passed C pointers to buffer text.
+ If some code called by it causes memory (re)allocation,
+ buffer text could be relocated on platforms that use
+ REL_ALLOC, which invalidates those C pointers. So we
+ inhibit relocation of buffer text for as long as
+ re_search_2 runs. */
+ r_alloc_inhibit_buffer_relocation (1);
+#endif
val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
pos_byte - BEGV_BYTE, lim_byte - pos_byte,
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
/* Don't allow match past current point */
pos_byte - BEGV_BYTE);
+#ifdef REL_ALLOC
+ r_alloc_inhibit_buffer_relocation (0);
+#endif
if (val == -2)
{
matcher_overflow ();
@@ -1203,11 +1216,20 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
while (n > 0)
{
ptrdiff_t val;
+
+#ifdef REL_ALLOC
+ /* See commentary above for the reasons for inhibiting
+ buffer text relocation here. */
+ r_alloc_inhibit_buffer_relocation (1);
+#endif
val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
pos_byte - BEGV_BYTE, lim_byte - pos_byte,
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
lim_byte - BEGV_BYTE);
+#ifdef REL_ALLOC
+ r_alloc_inhibit_buffer_relocation (0);
+#endif
if (val == -2)
{
matcher_overflow ();
diff --git a/src/xdisp.c b/src/xdisp.c
index 794355af153..25aae04f048 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8705,8 +8705,18 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
{
/* If TO_Y is in this line and TO_X was reached
above, we scanned too far. We have to restore
- IT's settings to the ones before skipping. */
+ IT's settings to the ones before skipping. But
+ keep the more accurate values of max_ascent and
+ max_descent we've found while skipping the rest
+ of the line, for the sake of callers, such as
+ pos_visible_p, that need to know the line
+ height. */
+ int max_ascent = it->max_ascent;
+ int max_descent = it->max_descent;
+
RESTORE_IT (it, &it_backup, backup_data);
+ it->max_ascent = max_ascent;
+ it->max_descent = max_descent;
reached = 6;
}
else