aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-05-31 14:08:06 +0800
committerChong Yidong2012-05-31 14:08:06 +0800
commitefc00ab16e2890b75d7224434ac43fe944ade4dd (patch)
tree28c1078ca32b96402cd1a5f618a17b3526143f27
parentba93a18774352c97d6dd73c73141cbff6305581b (diff)
parentdd41169b6cb0105b0766f3d368c657ebafc19cba (diff)
downloademacs-efc00ab16e2890b75d7224434ac43fe944ade4dd.tar.gz
emacs-efc00ab16e2890b75d7224434ac43fe944ade4dd.zip
Merge from emacs-24; up to 2012-04-24T21:47:24Z!michael.albinus@gmx.de
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/makefile.w32-in2
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/desktop.el12
-rw-r--r--lisp/emacs-lisp/bytecomp.el12
-rw-r--r--nt/ChangeLog17
-rwxr-xr-xnt/configure.bat39
-rw-r--r--nt/gmake.defs2
-rw-r--r--nt/nmake.defs2
-rw-r--r--src/ChangeLog31
-rw-r--r--src/charset.c9
-rw-r--r--src/doc.c21
-rw-r--r--src/keymap.c8
-rw-r--r--src/keymap.h2
-rw-r--r--src/ralloc.c7
-rw-r--r--src/search.c20
-rw-r--r--src/xdisp.c2
17 files changed, 150 insertions, 58 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index d95137852e0..ff631d09fcd 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,9 @@
12012-05-31 Eli Zaretskii <eliz@gnu.org>
2
3 * makefile.w32-in ($(BLD)/emacsclientw.exe): Use $(MWINDOWS)
4 instead of a literal -mwindows, which is not supported by MSVC.
5 (Bug#11405)
6
12012-05-30 Stefan Monnier <monnier@iro.umontreal.ca> 72012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * make-docfile.c: Improve comment style. 9 * make-docfile.c: Improve comment style.
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 83b818ed6c6..b727288351a 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -65,7 +65,7 @@ $(BLD)/emacsclient.exe: $(ECLIENTOBJS)
65 65
66$(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(CLIENTRES) 66$(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(CLIENTRES)
67# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib 67# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
68 $(LINK) $(LINK_OUT)$@ $(CLIENTRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) 68 $(LINK) $(LINK_OUT)$@ $(CLIENTRES) $(MWINDOWS) $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
69 69
70$(BLD)/emacsclient.$(O): emacsclient.c 70$(BLD)/emacsclient.$(O): emacsclient.c
71 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c 71 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index acb87b0ac5f..f60fcb0b14d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,21 @@
12012-05-31 Stefan Monnier <monnier@iro.umontreal.ca> 12012-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle
4 arbitrary file name lengths (Bug#11585).
5
62012-05-31 Martin Rudalics <rudalics@gmx.at>
7
8 * desktop.el (desktop-read): Clear previous and next buffers for
9 all windows and bury *Messages* buffer (bug#11556).
10
112012-05-31 Eli Zaretskii <eliz@gnu.org>
12
13 * mail/sendmail.el (mail-yank-region): Recognize
14 rmail-yank-current-message in addition to insert-buffer. Fixes
15 mail-mode's "C-c C-r" that otherwise does nothing when invoked in
16
172012-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18
3 Add `declare' for `defun'. Align `defmacro's with it. 19 Add `declare' for `defun'. Align `defmacro's with it.
4 * emacs-lisp/easy-mmode.el (define-minor-mode) 20 * emacs-lisp/easy-mmode.el (define-minor-mode)
5 (define-globalized-minor-mode): Don't autoload the var definitions. 21 (define-globalized-minor-mode): Don't autoload the var definitions.
diff --git a/lisp/desktop.el b/lisp/desktop.el
index f7a33f2b05d..5d9982940bf 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1020,6 +1020,18 @@ Using it may cause conflicts. Use it anyway? " owner)))))
1020 (format ", %d to restore lazily" 1020 (format ", %d to restore lazily"
1021 (length desktop-buffer-args-list)) 1021 (length desktop-buffer-args-list))
1022 "")) 1022 ""))
1023 ;; Bury the *Messages* buffer to not reshow it when burying
1024 ;; the buffer we switched to above.
1025 (when (buffer-live-p (get-buffer "*Messages*"))
1026 (bury-buffer "*Messages*"))
1027 ;; Clear all windows' previous and next buffers, these have
1028 ;; been corrupted by the `switch-to-buffer' calls in
1029 ;; `desktop-restore-file-buffer' (bug#11556). This is a
1030 ;; brute force fix and should be replaced by a more subtle
1031 ;; strategy eventually.
1032 (walk-window-tree (lambda (window)
1033 (set-window-prev-buffers window nil)
1034 (set-window-next-buffers window nil)))
1023 t)) 1035 t))
1024 ;; No desktop file found. 1036 ;; No desktop file found.
1025 (desktop-clear) 1037 (desktop-clear)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index ce4d5d64ae2..bbf029700a3 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1937,7 +1937,7 @@ and will be removed soon. See (elisp)Backquote in the manual."))
1937 (byte-compile-fix-header byte-compile-current-file)))) 1937 (byte-compile-fix-header byte-compile-current-file))))
1938 byte-compile--outbuffer))) 1938 byte-compile--outbuffer)))
1939 1939
1940(defun byte-compile-fix-header (filename) 1940(defun byte-compile-fix-header (_filename)
1941 "If the current buffer has any multibyte characters, insert a version test." 1941 "If the current buffer has any multibyte characters, insert a version test."
1942 (when (< (point-max) (position-bytes (point-max))) 1942 (when (< (point-max) (position-bytes (point-max)))
1943 (goto-char (point-min)) 1943 (goto-char (point-min))
@@ -1962,12 +1962,10 @@ and will be removed soon. See (elisp)Backquote in the manual."))
1962 ;; don't try to check the version number. 1962 ;; don't try to check the version number.
1963 " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" 1963 " (< (aref emacs-version (1- (length emacs-version))) ?A)\n"
1964 (format " (string-lessp emacs-version \"%s\")\n" minimum-version) 1964 (format " (string-lessp emacs-version \"%s\")\n" minimum-version)
1965 " (error \"`" 1965 ;; Because the header must fit in a fixed width, we cannot
1966 ;; prin1-to-string is used to quote backslashes. 1966 ;; insert arbitrary-length file names (Bug#11585).
1967 (substring (prin1-to-string (file-name-nondirectory filename)) 1967 " (error \"`%s' was compiled for "
1968 1 -1) 1968 (format "Emacs %s or later\" load-file-name))\n\n" minimum-version))
1969 (format "' was compiled for Emacs %s or later\"))\n\n"
1970 minimum-version))
1971 ;; Now compensate for any change in size, to make sure all 1969 ;; Now compensate for any change in size, to make sure all
1972 ;; positions in the file remain valid. 1970 ;; positions in the file remain valid.
1973 (setq delta (- (point-max) old-header-end)) 1971 (setq delta (- (point-max) old-header-end))
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 781d5d71559..0687e8be605 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,20 @@
12012-05-31 Eli Zaretskii <eliz@gnu.org>
2
3 * configure.bat (genmakefiles): Move the redirection away from the
4 end of the command, to avoid excess whitespace at the end of Make
5 variables created at configure time, and also avoid things like
6 "FOO1>>config.settings", where "1" gets interpreted as the file
7 descriptor and eaten up. This fixes breakage introduced by the
8 last change, without reintroducing the bug fixed by that change.
9
102012-05-31 Eli Zaretskii <eliz@gnu.org>
11
12 * nmake.defs (MWINDOWS): Define as
13 "-subsystem:windows -entry:mainCRTStartup". Suggested by Fabrice
14 Popineau <fabrice.popineau@supelec.fr>. (Bug#11405)
15
16 * gmake.defs (MWINDOWS): Define as "-mwindows".
17
12012-05-28 Eli Zaretskii <eliz@gnu.org> 182012-05-28 Eli Zaretskii <eliz@gnu.org>
2 19
3 * config.nt (HAVE_SYSINFO): Remove; unused. 20 * config.nt (HAVE_SYSINFO): Remove; unused.
diff --git a/nt/configure.bat b/nt/configure.bat
index a60df56fc94..cecf52ee927 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -753,29 +753,36 @@ if %COMPILER% == gcc set MAKECMD=gmake
753if %COMPILER% == cl set MAKECMD=nmake 753if %COMPILER% == cl set MAKECMD=nmake
754 754
755rem Pass on chosen settings to makefiles. 755rem Pass on chosen settings to makefiles.
756rem NB. Be very careful to not have a space before redirection symbols
757rem except when there is a preceding digit, when a space is required.
758rem 756rem
757rem The weird place we put the redirection is to make sure no extra
758rem whitespace winds up at the end of the Make variables, since some
759rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will
760rem write the blanks between the end of command arguments and the
761rem redirection symbol to the file. OTOH, we cannot put the
762rem redirection immediately after the last character of the command,
763rem because environment variable expansion can yield a digit there,
764rem which will then be misinterpreted as the file descriptor to
765rem redirect...
759echo # Start of settings from configure.bat >config.settings 766echo # Start of settings from configure.bat >config.settings
760echo COMPILER=%COMPILER% >>config.settings 767>>config.settings echo COMPILER=%COMPILER%
761if not "(%mf%)" == "()" echo MCPU_FLAG=%mf% >>config.settings 768if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%
762if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo% >>config.settings 769if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%
763if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings 770if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1
764if (%noopt%) == (Y) echo NOOPT=1 >>config.settings 771if (%noopt%) == (Y) >>config.settings echo NOOPT=1
765if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings 772if (%enablechecking%) == (Y) >>config.settings echo ENABLECHECKS=1
766if (%profile%) == (Y) echo PROFILE=1 >>config.settings 773if (%profile%) == (Y) >>config.settings echo PROFILE=1
767if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings 774if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1
768if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix% >>config.settings 775if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%
769if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles% >>config.settings 776if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%
770rem We go thru docflags because usercflags could be "-DFOO=bar" -something 777rem We go thru docflags because usercflags could be "-DFOO=bar" -something
771rem and the if command cannot cope with this 778rem and the if command cannot cope with this
772for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y 779for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
773if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags% >>config.settings 780if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%
774if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags% >>config.settings 781if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%
775for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y 782for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
776if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags% >>config.settings 783if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%
777for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y 784for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
778if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs% >>config.settings 785if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%
779echo # End of settings from configure.bat>>config.settings 786echo # End of settings from configure.bat>>config.settings
780echo. >>config.settings 787echo. >>config.settings
781 788
diff --git a/nt/gmake.defs b/nt/gmake.defs
index a669ffd27be..dd96b776363 100644
--- a/nt/gmake.defs
+++ b/nt/gmake.defs
@@ -210,6 +210,8 @@ else
210CHECKING_CFLAGS = 210CHECKING_CFLAGS =
211endif 211endif
212 212
213MWINDOWS = -mwindows
214
213CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) 215CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
214ESC_CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) 216ESC_CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS)
215EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1 217EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1
diff --git a/nt/nmake.defs b/nt/nmake.defs
index 11079b4fb7d..b01e341f2d3 100644
--- a/nt/nmake.defs
+++ b/nt/nmake.defs
@@ -151,6 +151,8 @@ CHECKING_CFLAGS = -DENABLE_CHECKING -DXASSERTS
151CHECKING_CFLAGS = 151CHECKING_CFLAGS =
152!endif 152!endif
153 153
154MWINDOWS = -subsystem:windows -entry:mainCRTStartup
155
154CFLAGS = -I. $(ARCH_CFLAGS) \ 156CFLAGS = -I. $(ARCH_CFLAGS) \
155 $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) 157 $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
156ESC_CFLAGS = -I. $(ARCH_CFLAGS) \ 158ESC_CFLAGS = -I. $(ARCH_CFLAGS) \
diff --git a/src/ChangeLog b/src/ChangeLog
index 32bd9e2d18c..8622adbf0ce 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,34 @@
12012-05-31 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (handle_stop): Detect whether we have overlay strings
4 loaded by testing it->current.overlay_string_index to be
5 non-negative, instead of checking whether n_overlay_strings is
6 positive. (Bug#11587)
7
82012-05-31 Chong Yidong <cyd@gnu.org>
9
10 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11
12 * doc.c (Fsubstitute_command_keys): Doc fix.
13
142012-05-31 Eli Zaretskii <eliz@gnu.org>
15
16 * search.c (search_buffer): Remove calls to
17 r_alloc_inhibit_buffer_relocation, as it is now called by
18 maybe_unify_char, which was the cause of relocation of buffer text
19 in bug#11519.
20
212012-05-31 Eli Zaretskii <eliz@gnu.org>
22
23 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
24 for the duration of call to load_charset, to avoid problems with
25 callers of maybe_unify_char that access buffer text through C
26 pointers.
27
28 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
29 decrement the inhibition flag, instead of just setting or
30 resetting it.
31
12012-05-31 Paul Eggert <eggert@cs.ucla.edu> 322012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2 33
3 Remove obsolete '#define static' cruft. 34 Remove obsolete '#define static' cruft.
diff --git a/src/charset.c b/src/charset.c
index 6ecc8d2c4d1..8ce972ebf37 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1633,6 +1633,12 @@ maybe_unify_char (int c, Lisp_Object val)
1633 return c; 1633 return c;
1634 1634
1635 CHECK_CHARSET_GET_CHARSET (val, charset); 1635 CHECK_CHARSET_GET_CHARSET (val, charset);
1636#ifdef REL_ALLOC
1637 /* The call to load_charset below can allocate memory, which screws
1638 callers of this function through STRING_CHAR_* macros that hold C
1639 pointers to buffer text, if REL_ALLOC is used. */
1640 r_alloc_inhibit_buffer_relocation (1);
1641#endif
1636 load_charset (charset, 1); 1642 load_charset (charset, 1);
1637 if (! inhibit_load_charset_map) 1643 if (! inhibit_load_charset_map)
1638 { 1644 {
@@ -1648,6 +1654,9 @@ maybe_unify_char (int c, Lisp_Object val)
1648 if (unified > 0) 1654 if (unified > 0)
1649 c = unified; 1655 c = unified;
1650 } 1656 }
1657#ifdef REL_ALLOC
1658 r_alloc_inhibit_buffer_relocation (0);
1659#endif
1651 return c; 1660 return c;
1652} 1661}
1653 1662
diff --git a/src/doc.c b/src/doc.c
index bec20fb0d94..cd23d9266a2 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -705,18 +705,23 @@ the same file name is found in the `doc-directory'. */)
705DEFUN ("substitute-command-keys", Fsubstitute_command_keys, 705DEFUN ("substitute-command-keys", Fsubstitute_command_keys,
706 Ssubstitute_command_keys, 1, 1, 0, 706 Ssubstitute_command_keys, 1, 1, 0,
707 doc: /* Substitute key descriptions for command names in STRING. 707 doc: /* Substitute key descriptions for command names in STRING.
708Substrings of the form \\=\\[COMMAND] replaced by either: a keystroke 708Each substring of the form \\=\\[COMMAND] is replaced by either a
709sequence that will invoke COMMAND, or "M-x COMMAND" if COMMAND is not 709keystroke sequence that invokes COMMAND, or "M-x COMMAND" if COMMAND
710on any keys. 710is not on any keys.
711Substrings of the form \\=\\{MAPVAR} are replaced by summaries 711
712\(made by `describe-bindings') of the value of MAPVAR, taken as a keymap. 712Each substring of the form \\=\\{MAPVAR} is replaced by a summary of
713Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR 713the value of MAPVAR as a keymap. This summary is similar to the one
714produced by `describe-bindings'. The summary ends in two newlines
715\(used by the helper function `help-make-xrefs' to find the end of the
716summary).
717
718Each substring of the form \\=\\<MAPVAR> specifies the use of MAPVAR
714as the keymap for future \\=\\[COMMAND] substrings. 719as the keymap for future \\=\\[COMMAND] substrings.
715\\=\\= quotes the following character and is discarded; 720\\=\\= quotes the following character and is discarded;
716thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output. 721thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output.
717 722
718Returns original STRING if no substitutions were made. Otherwise, 723Return the original STRING if no substitutions are made.
719a new string, without any text properties, is returned. */) 724Otherwise, return a new string, without any text properties. */)
720 (Lisp_Object string) 725 (Lisp_Object string)
721{ 726{
722 char *buf; 727 char *buf;
diff --git a/src/keymap.c b/src/keymap.c
index 2a03dda5a5e..2f5558c171f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2996,9 +2996,9 @@ You type Translation\n\
2996 If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW, 2996 If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW,
2997 don't omit it; instead, mention it but say it is shadowed. 2997 don't omit it; instead, mention it but say it is shadowed.
2998 2998
2999 Return whether something was inserted or not. */ 2999 Any inserted text ends in two newlines (used by `help-make-xrefs'). */
3000 3000
3001int 3001void
3002describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, 3002describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow,
3003 Lisp_Object prefix, const char *title, int nomenu, int transl, 3003 Lisp_Object prefix, const char *title, int nomenu, int transl,
3004 int always_title, int mention_shadow) 3004 int always_title, int mention_shadow)
@@ -3108,8 +3108,10 @@ key binding\n\
3108 skip: ; 3108 skip: ;
3109 } 3109 }
3110 3110
3111 if (something)
3112 insert_string ("\n");
3113
3111 UNGCPRO; 3114 UNGCPRO;
3112 return something;
3113} 3115}
3114 3116
3115static int previous_description_column; 3117static int previous_description_column;
diff --git a/src/keymap.h b/src/keymap.h
index 234ffce471d..d9334cda0f4 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -47,7 +47,7 @@ EXFUN (Fcurrent_active_maps, 2);
47extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, int, int, int); 47extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, int, int, int);
48extern Lisp_Object get_keymap (Lisp_Object, int, int); 48extern Lisp_Object get_keymap (Lisp_Object, int, int);
49EXFUN (Fset_keymap_parent, 2); 49EXFUN (Fset_keymap_parent, 2);
50extern int describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, 50extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object,
51 const char *, int, int, int, int); 51 const char *, int, int, int, int);
52extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); 52extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **);
53extern void initial_define_key (Lisp_Object, int, const char *); 53extern void initial_define_key (Lisp_Object, int, const char *);
diff --git a/src/ralloc.c b/src/ralloc.c
index 7fdef69842a..19d15664eec 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1142,7 +1142,12 @@ r_alloc_reset_variable (POINTER *old, POINTER *new)
1142void 1142void
1143r_alloc_inhibit_buffer_relocation (int inhibit) 1143r_alloc_inhibit_buffer_relocation (int inhibit)
1144{ 1144{
1145 use_relocatable_buffers = !inhibit; 1145 if (use_relocatable_buffers < 0)
1146 use_relocatable_buffers = 0;
1147 if (inhibit)
1148 use_relocatable_buffers++;
1149 else if (use_relocatable_buffers > 0)
1150 use_relocatable_buffers--;
1146} 1151}
1147 1152
1148 1153
diff --git a/src/search.c b/src/search.c
index 5608e344e75..99519b839ef 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1160,24 +1160,12 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
1160 { 1160 {
1161 ptrdiff_t val; 1161 ptrdiff_t val;
1162 1162
1163#ifdef REL_ALLOC
1164 /* re_search_2 below is passed C pointers to buffer text.
1165 If some code called by it causes memory (re)allocation,
1166 buffer text could be relocated on platforms that use
1167 REL_ALLOC, which invalidates those C pointers. So we
1168 inhibit relocation of buffer text for as long as
1169 re_search_2 runs. */
1170 r_alloc_inhibit_buffer_relocation (1);
1171#endif
1172 val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, 1163 val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
1173 pos_byte - BEGV_BYTE, lim_byte - pos_byte, 1164 pos_byte - BEGV_BYTE, lim_byte - pos_byte,
1174 (NILP (Vinhibit_changing_match_data) 1165 (NILP (Vinhibit_changing_match_data)
1175 ? &search_regs : &search_regs_1), 1166 ? &search_regs : &search_regs_1),
1176 /* Don't allow match past current point */ 1167 /* Don't allow match past current point */
1177 pos_byte - BEGV_BYTE); 1168 pos_byte - BEGV_BYTE);
1178#ifdef REL_ALLOC
1179 r_alloc_inhibit_buffer_relocation (0);
1180#endif
1181 if (val == -2) 1169 if (val == -2)
1182 { 1170 {
1183 matcher_overflow (); 1171 matcher_overflow ();
@@ -1217,19 +1205,11 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
1217 { 1205 {
1218 ptrdiff_t val; 1206 ptrdiff_t val;
1219 1207
1220#ifdef REL_ALLOC
1221 /* See commentary above for the reasons for inhibiting
1222 buffer text relocation here. */
1223 r_alloc_inhibit_buffer_relocation (1);
1224#endif
1225 val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, 1208 val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
1226 pos_byte - BEGV_BYTE, lim_byte - pos_byte, 1209 pos_byte - BEGV_BYTE, lim_byte - pos_byte,
1227 (NILP (Vinhibit_changing_match_data) 1210 (NILP (Vinhibit_changing_match_data)
1228 ? &search_regs : &search_regs_1), 1211 ? &search_regs : &search_regs_1),
1229 lim_byte - BEGV_BYTE); 1212 lim_byte - BEGV_BYTE);
1230#ifdef REL_ALLOC
1231 r_alloc_inhibit_buffer_relocation (0);
1232#endif
1233 if (val == -2) 1213 if (val == -2)
1234 { 1214 {
1235 matcher_overflow (); 1215 matcher_overflow ();
diff --git a/src/xdisp.c b/src/xdisp.c
index 25aae04f048..f5d17877d1c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3170,7 +3170,7 @@ handle_stop (struct it *it)
3170 onto the stack one more time, which is not 3170 onto the stack one more time, which is not
3171 expected by the rest of the code that processes 3171 expected by the rest of the code that processes
3172 overlay strings. */ 3172 overlay strings. */
3173 || (it->n_overlay_strings <= 0 3173 || (it->current.overlay_string_index < 0
3174 ? !get_overlay_strings_1 (it, 0, 0) 3174 ? !get_overlay_strings_1 (it, 0, 0)
3175 : 0)) 3175 : 0))
3176 { 3176 {