diff options
-rw-r--r-- | lib-src/ChangeLog | 6 | ||||
-rw-r--r-- | lib-src/makefile.w32-in | 2 | ||||
-rw-r--r-- | lisp/ChangeLog | 16 | ||||
-rw-r--r-- | lisp/desktop.el | 12 | ||||
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 12 | ||||
-rw-r--r-- | nt/ChangeLog | 17 | ||||
-rwxr-xr-x | nt/configure.bat | 39 | ||||
-rw-r--r-- | nt/gmake.defs | 2 | ||||
-rw-r--r-- | nt/nmake.defs | 2 | ||||
-rw-r--r-- | src/ChangeLog | 31 | ||||
-rw-r--r-- | src/charset.c | 9 | ||||
-rw-r--r-- | src/doc.c | 21 | ||||
-rw-r--r-- | src/keymap.c | 8 | ||||
-rw-r--r-- | src/keymap.h | 2 | ||||
-rw-r--r-- | src/ralloc.c | 7 | ||||
-rw-r--r-- | src/search.c | 20 | ||||
-rw-r--r-- | src/xdisp.c | 2 |
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 @@ +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in ($(BLD)/emacsclientw.exe): Use $(MWINDOWS) + instead of a literal -mwindows, which is not supported by MSVC. + (Bug#11405) + 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca> * 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) $(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(CLIENTRES) # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib - $(LINK) $(LINK_OUT)$@ $(CLIENTRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) + $(LINK) $(LINK_OUT)$@ $(CLIENTRES) $(MWINDOWS) $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) $(BLD)/emacsclient.$(O): emacsclient.c $(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 @@ 2012-05-31 Stefan Monnier <monnier@iro.umontreal.ca> + * emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle + arbitrary file name lengths (Bug#11585). + +2012-05-31 Martin Rudalics <rudalics@gmx.at> + + * desktop.el (desktop-read): Clear previous and next buffers for + all windows and bury *Messages* buffer (bug#11556). + +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * mail/sendmail.el (mail-yank-region): Recognize + rmail-yank-current-message in addition to insert-buffer. Fixes + mail-mode's "C-c C-r" that otherwise does nothing when invoked in + +2012-05-31 Stefan Monnier <monnier@iro.umontreal.ca> + Add `declare' for `defun'. Align `defmacro's with it. * emacs-lisp/easy-mmode.el (define-minor-mode) (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))))) (format ", %d to restore lazily" (length desktop-buffer-args-list)) "")) + ;; Bury the *Messages* buffer to not reshow it when burying + ;; the buffer we switched to above. + (when (buffer-live-p (get-buffer "*Messages*")) + (bury-buffer "*Messages*")) + ;; Clear all windows' previous and next buffers, these have + ;; been corrupted by the `switch-to-buffer' calls in + ;; `desktop-restore-file-buffer' (bug#11556). This is a + ;; brute force fix and should be replaced by a more subtle + ;; strategy eventually. + (walk-window-tree (lambda (window) + (set-window-prev-buffers window nil) + (set-window-next-buffers window nil))) t)) ;; No desktop file found. (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.")) (byte-compile-fix-header byte-compile-current-file)))) byte-compile--outbuffer))) -(defun byte-compile-fix-header (filename) +(defun byte-compile-fix-header (_filename) "If the current buffer has any multibyte characters, insert a version test." (when (< (point-max) (position-bytes (point-max))) (goto-char (point-min)) @@ -1962,12 +1962,10 @@ and will be removed soon. See (elisp)Backquote in the manual.")) ;; don't try to check the version number. " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" (format " (string-lessp emacs-version \"%s\")\n" minimum-version) - " (error \"`" - ;; prin1-to-string is used to quote backslashes. - (substring (prin1-to-string (file-name-nondirectory filename)) - 1 -1) - (format "' was compiled for Emacs %s or later\"))\n\n" - minimum-version)) + ;; Because the header must fit in a fixed width, we cannot + ;; insert arbitrary-length file names (Bug#11585). + " (error \"`%s' was compiled for " + (format "Emacs %s or later\" load-file-name))\n\n" minimum-version)) ;; Now compensate for any change in size, to make sure all ;; positions in the file remain valid. (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 @@ +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * configure.bat (genmakefiles): Move the redirection away from the + end of the command, to avoid excess whitespace at the end of Make + variables created at configure time, and also avoid things like + "FOO1>>config.settings", where "1" gets interpreted as the file + descriptor and eaten up. This fixes breakage introduced by the + last change, without reintroducing the bug fixed by that change. + +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * nmake.defs (MWINDOWS): Define as + "-subsystem:windows -entry:mainCRTStartup". Suggested by Fabrice + Popineau <fabrice.popineau@supelec.fr>. (Bug#11405) + + * gmake.defs (MWINDOWS): Define as "-mwindows". + 2012-05-28 Eli Zaretskii <eliz@gnu.org> * 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 if %COMPILER% == cl set MAKECMD=nmake
rem Pass on chosen settings to makefiles.
-rem NB. Be very careful to not have a space before redirection symbols
-rem except when there is a preceding digit, when a space is required.
rem
+rem The weird place we put the redirection is to make sure no extra
+rem whitespace winds up at the end of the Make variables, since some
+rem variables, e.g. INSTALL_DIR, cannot stand that. Yes, echo will
+rem write the blanks between the end of command arguments and the
+rem redirection symbol to the file. OTOH, we cannot put the
+rem redirection immediately after the last character of the command,
+rem because environment variable expansion can yield a digit there,
+rem which will then be misinterpreted as the file descriptor to
+rem redirect...
echo # Start of settings from configure.bat >config.settings
-echo COMPILER=%COMPILER% >>config.settings
-if not "(%mf%)" == "()" echo MCPU_FLAG=%mf% >>config.settings
-if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo% >>config.settings
-if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
-if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
-if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings
-if (%profile%) == (Y) echo PROFILE=1 >>config.settings
-if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
-if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix% >>config.settings
-if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles% >>config.settings
+>>config.settings echo COMPILER=%COMPILER%
+if not "(%mf%)" == "()" >>config.settings echo MCPU_FLAG=%mf%
+if not "(%dbginfo%)" == "()" >>config.settings echo DEBUG_INFO=%dbginfo%
+if (%nodebug%) == (Y) >>config.settings echo NODEBUG=1
+if (%noopt%) == (Y) >>config.settings echo NOOPT=1
+if (%enablechecking%) == (Y) >>config.settings echo ENABLECHECKS=1
+if (%profile%) == (Y) >>config.settings echo PROFILE=1
+if (%nocygwin%) == (Y) >>config.settings echo NOCYGWIN=1
+if not "(%prefix%)" == "()" >>config.settings echo INSTALL_DIR=%prefix%
+if not "(%distfiles%)" == "()" >>config.settings echo DIST_FILES=%distfiles%
rem We go thru docflags because usercflags could be "-DFOO=bar" -something
rem and the if command cannot cope with this
for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
-if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags% >>config.settings
-if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags% >>config.settings
+if (%docflags%)==(Y) >>config.settings echo USER_CFLAGS=%usercflags%
+if (%docflags%)==(Y) >>config.settings echo ESC_USER_CFLAGS=%escusercflags%
for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
-if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags% >>config.settings
+if (%doldflags%)==(Y) >>config.settings echo USER_LDFLAGS=%userldflags%
for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y
-if (%doextralibs%)==(Y) echo USER_LIBS=%extrauserlibs% >>config.settings
+if (%doextralibs%)==(Y) >>config.settings echo USER_LIBS=%extrauserlibs%
echo # End of settings from configure.bat>>config.settings
echo. >>config.settings
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 CHECKING_CFLAGS = endif +MWINDOWS = -mwindows + CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) ESC_CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) EMACS_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 CHECKING_CFLAGS =
!endif
+MWINDOWS = -subsystem:windows -entry:mainCRTStartup
+
CFLAGS = -I. $(ARCH_CFLAGS) \
$(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
ESC_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 @@ +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * xdisp.c (handle_stop): Detect whether we have overlay strings + loaded by testing it->current.overlay_string_index to be + non-negative, instead of checking whether n_overlay_strings is + positive. (Bug#11587) + +2012-05-31 Chong Yidong <cyd@gnu.org> + + * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169). + + * doc.c (Fsubstitute_command_keys): Doc fix. + +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * search.c (search_buffer): Remove calls to + r_alloc_inhibit_buffer_relocation, as it is now called by + maybe_unify_char, which was the cause of relocation of buffer text + in bug#11519. + +2012-05-31 Eli Zaretskii <eliz@gnu.org> + + * charset.c (maybe_unify_char): Inhibit relocation of buffer text + for the duration of call to load_charset, to avoid problems with + callers of maybe_unify_char that access buffer text through C + pointers. + + * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and + decrement the inhibition flag, instead of just setting or + resetting it. + 2012-05-31 Paul Eggert <eggert@cs.ucla.edu> 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) return c; CHECK_CHARSET_GET_CHARSET (val, charset); +#ifdef REL_ALLOC + /* The call to load_charset below can allocate memory, which screws + callers of this function through STRING_CHAR_* macros that hold C + pointers to buffer text, if REL_ALLOC is used. */ + r_alloc_inhibit_buffer_relocation (1); +#endif load_charset (charset, 1); if (! inhibit_load_charset_map) { @@ -1648,6 +1654,9 @@ maybe_unify_char (int c, Lisp_Object val) if (unified > 0) c = unified; } +#ifdef REL_ALLOC + r_alloc_inhibit_buffer_relocation (0); +#endif return c; } 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'. */) DEFUN ("substitute-command-keys", Fsubstitute_command_keys, Ssubstitute_command_keys, 1, 1, 0, doc: /* Substitute key descriptions for command names in STRING. -Substrings of the form \\=\\[COMMAND] replaced by either: a keystroke -sequence that will invoke COMMAND, or "M-x COMMAND" if COMMAND is not -on any keys. -Substrings of the form \\=\\{MAPVAR} are replaced by summaries -\(made by `describe-bindings') of the value of MAPVAR, taken as a keymap. -Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR +Each substring of the form \\=\\[COMMAND] is replaced by either a +keystroke sequence that invokes COMMAND, or "M-x COMMAND" if COMMAND +is not on any keys. + +Each substring of the form \\=\\{MAPVAR} is replaced by a summary of +the value of MAPVAR as a keymap. This summary is similar to the one +produced by `describe-bindings'. The summary ends in two newlines +\(used by the helper function `help-make-xrefs' to find the end of the +summary). + +Each substring of the form \\=\\<MAPVAR> specifies the use of MAPVAR as the keymap for future \\=\\[COMMAND] substrings. \\=\\= quotes the following character and is discarded; thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output. -Returns original STRING if no substitutions were made. Otherwise, -a new string, without any text properties, is returned. */) +Return the original STRING if no substitutions are made. +Otherwise, return a new string, without any text properties. */) (Lisp_Object string) { 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\ If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW, don't omit it; instead, mention it but say it is shadowed. - Return whether something was inserted or not. */ + Any inserted text ends in two newlines (used by `help-make-xrefs'). */ -int +void describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, Lisp_Object prefix, const char *title, int nomenu, int transl, int always_title, int mention_shadow) @@ -3108,8 +3108,10 @@ key binding\n\ skip: ; } + if (something) + insert_string ("\n"); + UNGCPRO; - return something; } static 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); extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, int, int, int); extern Lisp_Object get_keymap (Lisp_Object, int, int); EXFUN (Fset_keymap_parent, 2); -extern int describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, +extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, const char *, int, int, int, int); extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); extern 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) void r_alloc_inhibit_buffer_relocation (int inhibit) { - use_relocatable_buffers = !inhibit; + if (use_relocatable_buffers < 0) + use_relocatable_buffers = 0; + if (inhibit) + use_relocatable_buffers++; + else if (use_relocatable_buffers > 0) + use_relocatable_buffers--; } 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, { 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 (); @@ -1217,19 +1205,11 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, { 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 25aae04f048..f5d17877d1c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3170,7 +3170,7 @@ handle_stop (struct it *it) onto the stack one more time, which is not expected by the rest of the code that processes overlay strings. */ - || (it->n_overlay_strings <= 0 + || (it->current.overlay_string_index < 0 ? !get_overlay_strings_1 (it, 0, 0) : 0)) { |