Now on revision 112125. ------------------------------------------------------------ revno: 112125 fixes bug: http://debbugs.gnu.org/13999 committer: Leo Liu branch nick: trunk timestamp: Sun 2013-03-24 14:42:25 +0800 message: * lisp/files.el (kill-buffer-hook): Doc fix. * lisp/emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer is the last entry in kill-buffer-hook. * lisp/nxml/rng-valid.el (rng-validate-while-idle) (rng-validate-quick-while-idle): Guard against deleted buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-23 22:04:40 +0000 +++ lisp/ChangeLog 2013-03-24 06:42:25 +0000 @@ -1,3 +1,14 @@ +2013-03-24 Leo Liu + + * nxml/rng-valid.el (rng-validate-while-idle) + (rng-validate-quick-while-idle): Guard against deleted buffer. + (Bug#13999) + + * emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer + is the last entry in kill-buffer-hook. + + * files.el (kill-buffer-hook): Doc fix. + 2013-03-23 Dmitry Gutov * emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column): Make === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2013-01-11 23:08:55 +0000 +++ lisp/emacs-lisp/edebug.el 2013-03-24 06:42:25 +0000 @@ -3810,7 +3810,10 @@ ;; If the user kills the buffer in which edebug is currently active, ;; exit to top level, because the edebug command loop can't usefully ;; continue running in such a case. - (add-hook 'kill-buffer-hook 'edebug-kill-buffer nil t) + ;; + ;; Append `edebug-kill-buffer' to the hook to avoid interfering with + ;; other entries that are ungarded against deleted buffer. + (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t) (use-local-map edebug-mode-map)) (defun edebug-kill-buffer () === modified file 'lisp/files.el' --- lisp/files.el 2013-03-04 07:37:30 +0000 +++ lisp/files.el 2013-03-24 06:42:25 +0000 @@ -1516,7 +1516,10 @@ (defvar kill-buffer-hook nil "Hook run when a buffer is killed. The buffer being killed is current while the hook is running. -See `kill-buffer'.") +See `kill-buffer'. + +Note: Be careful with let-binding this hook considering it is +frequently used for cleanup.") (defun find-alternate-file (filename &optional wildcards) "Find file FILENAME, select its buffer, kill previous buffer. === modified file 'lisp/nxml/rng-valid.el' --- lisp/nxml/rng-valid.el 2013-03-23 02:21:25 +0000 +++ lisp/nxml/rng-valid.el 2013-03-24 06:42:25 +0000 @@ -433,24 +433,26 @@ ;; validation process down. (defun rng-validate-while-idle (buffer) - (with-current-buffer buffer - (if rng-validate-mode - (if (let ((rng-validate-display-point (point)) - (rng-validate-display-modified-p (buffer-modified-p))) - (rng-do-some-validation 'rng-validate-while-idle-continue-p)) - (force-mode-line-update) - (rng-validate-done)) - ;; must have done kill-all-local-variables - (rng-kill-timers)))) + (when (buffer-live-p buffer) ; bug#13999 + (with-current-buffer buffer + (if rng-validate-mode + (if (let ((rng-validate-display-point (point)) + (rng-validate-display-modified-p (buffer-modified-p))) + (rng-do-some-validation 'rng-validate-while-idle-continue-p)) + (force-mode-line-update) + (rng-validate-done)) + ;; must have done kill-all-local-variables + (rng-kill-timers))))) (defun rng-validate-quick-while-idle (buffer) - (with-current-buffer buffer - (if rng-validate-mode - (if (rng-do-some-validation) - (force-mode-line-update) - (rng-validate-done)) - ;; must have done kill-all-local-variables - (rng-kill-timers)))) + (when (buffer-live-p buffer) ; bug#13999 + (with-current-buffer buffer + (if rng-validate-mode + (if (rng-do-some-validation) + (force-mode-line-update) + (rng-validate-done)) + ;; must have done kill-all-local-variables + (rng-kill-timers))))) (defun rng-validate-done () (when (or (not (current-message)) ------------------------------------------------------------ revno: 112124 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2013-03-24 09:29:35 +0400 message: * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument to be optional or nil. Adjust comment and convert it to docstring. * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message. * frame.c (display_x_get_resource, Fx_get_resource): Break long line. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-24 02:40:51 +0000 +++ src/ChangeLog 2013-03-24 05:29:35 +0000 @@ -1,3 +1,10 @@ +2013-03-24 Dmitry Antipov + + * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument + to be optional or nil. Adjust comment and convert it to docstring. + * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message. + * frame.c (display_x_get_resource, Fx_get_resource): Break long line. + 2013-03-24 Paul Eggert Static checking by GCC 4.8-20130319. === modified file 'src/frame.c' --- src/frame.c 2013-03-23 09:01:14 +0000 +++ src/frame.c 2013-03-24 05:29:35 +0000 @@ -3495,7 +3495,8 @@ class, respectively. You must specify both of them or neither. If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE' and the class is `Emacs.CLASS.SUBCLASS'. */) - (Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass) + (Lisp_Object attribute, Lisp_Object class, Lisp_Object component, + Lisp_Object subclass) { #ifdef HAVE_X_WINDOWS check_x (); @@ -3508,7 +3509,9 @@ /* Get an X resource, like Fx_get_resource, but for display DPYINFO. */ Lisp_Object -display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass) +display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, + Lisp_Object class, Lisp_Object component, + Lisp_Object subclass) { return xrdb_get_resource (dpyinfo->xrdb, attribute, class, component, subclass); === modified file 'src/xfaces.c' --- src/xfaces.c 2013-03-20 09:56:19 +0000 +++ src/xfaces.c 2013-03-24 05:29:35 +0000 @@ -3395,21 +3395,22 @@ } } - -/* Get the value of X resource RESOURCE, class CLASS for the display - of frame FRAME. This is here because ordinary `x-get-resource' - doesn't take a frame argument. */ - DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource, - Sinternal_face_x_get_resource, 3, 3, 0, doc: /* */) + Sinternal_face_x_get_resource, 2, 3, 0, + doc: /* Get the value of X resource RESOURCE, class CLASS. +Returned value is for the display of frame FRAME. If FRAME is not +specified or nil, use selected frame. This function exists because +ordinary `x-get-resource' doesn't take a frame argument. */) (Lisp_Object resource, Lisp_Object class, Lisp_Object frame) { Lisp_Object value = Qnil; + struct frame *f; + CHECK_STRING (resource); CHECK_STRING (class); - CHECK_LIVE_FRAME (frame); + f = decode_live_frame (frame); block_input (); - value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)), + value = display_x_get_resource (FRAME_X_DISPLAY_INFO (f), resource, class, Qnil, Qnil); unblock_input (); return value; === modified file 'src/xselect.c' --- src/xselect.c 2013-03-05 01:48:30 +0000 +++ src/xselect.c 2013-03-24 05:29:35 +0000 @@ -2571,7 +2571,7 @@ return 1; } -DEFUN ("x-send-client-message", Fx_send_client_event, +DEFUN ("x-send-client-message", Fx_send_client_message, Sx_send_client_message, 6, 6, 0, doc: /* Send a client message of MESSAGE-TYPE to window DEST on DISPLAY. ------------------------------------------------------------ revno: 112123 committer: Paul Eggert branch nick: trunk timestamp: Sat 2013-03-23 19:40:51 -0700 message: Static checking by GCC 4.8-20130319. * image.c (gif_load): Assume pass < 3 to pacify GCC. * process.c (Fset_process_datagram_address) (Fmake_network_process): Check get_lisp_to_sockaddr_size return value. * xdisp.c (get_char_face_and_encoding): (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized. (get_glyph_face_and_encoding): Prepare face before possibly using it. (get_per_char_metric): Don't use CHAR2B if it might not be initialized. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-24 00:48:49 +0000 +++ src/ChangeLog 2013-03-24 02:40:51 +0000 @@ -1,3 +1,14 @@ +2013-03-24 Paul Eggert + + Static checking by GCC 4.8-20130319. + * image.c (gif_load): Assume pass < 3 to pacify GCC. + * process.c (Fset_process_datagram_address) + (Fmake_network_process): Check get_lisp_to_sockaddr_size return value. + * xdisp.c (get_char_face_and_encoding): + (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized. + (get_glyph_face_and_encoding): Prepare face before possibly using it. + (get_per_char_metric): Don't use CHAR2B if it might not be initialized. + 2013-03-24 Ken Brown * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to === modified file 'src/image.c' --- src/image.c 2013-03-20 09:56:19 +0000 +++ src/image.c 2013-03-24 02:40:51 +0000 @@ -7373,11 +7373,10 @@ y < subimg_height; y++, row += interlace_increment[pass]) { - if (row >= subimg_height) + while (subimg_height <= row) { + lint_assume (pass < 3); row = interlace_start[++pass]; - while (row >= subimg_height) - row = interlace_start[++pass]; } for (x = 0; x < subimg_width; x++) === modified file 'src/process.c' --- src/process.c 2013-03-08 02:32:21 +0000 +++ src/process.c 2013-03-24 02:40:51 +0000 @@ -2155,7 +2155,7 @@ channel = XPROCESS (process)->infd; len = get_lisp_to_sockaddr_size (address, &family); - if (datagram_address[channel].len != len) + if (len == 0 || datagram_address[channel].len != len) return Qnil; conv_lisp_to_sockaddr (family, address, datagram_address[channel].sa, len); return address; @@ -3269,7 +3269,8 @@ { int rfamily, rlen; rlen = get_lisp_to_sockaddr_size (remote, &rfamily); - if (rfamily == lres->ai_family && rlen == lres->ai_addrlen) + if (rlen != 0 && rfamily == lres->ai_family + && rlen == lres->ai_addrlen) conv_lisp_to_sockaddr (rfamily, remote, datagram_address[s].sa, rlen); } === modified file 'src/xdisp.c' --- src/xdisp.c 2013-03-22 12:41:34 +0000 +++ src/xdisp.c 2013-03-24 02:40:51 +0000 @@ -22391,16 +22391,16 @@ XChar2b *char2b, int display_p) { struct face *face = FACE_FROM_ID (f, face_id); + unsigned code = 0; if (face->font) { - unsigned code = face->font->driver->encode_char (face->font, c); + code = face->font->driver->encode_char (face->font, c); - if (code != FONT_INVALID_CODE) - STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); - else - STORE_XCHAR2B (char2b, 0, 0); + if (code == FONT_INVALID_CODE) + code = 0; } + STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); /* Make sure X resources of the face are allocated. */ #ifdef HAVE_X_WINDOWS @@ -22424,31 +22424,30 @@ XChar2b *char2b, int *two_byte_p) { struct face *face; + unsigned code = 0; eassert (glyph->type == CHAR_GLYPH); face = FACE_FROM_ID (f, glyph->face_id); + /* Make sure X resources of the face are allocated. */ + eassert (face != NULL); + PREPARE_FACE_FOR_DISPLAY (f, face); + if (two_byte_p) *two_byte_p = 0; if (face->font) { - unsigned code; - if (CHAR_BYTE8_P (glyph->u.ch)) code = CHAR_TO_BYTE8 (glyph->u.ch); else code = face->font->driver->encode_char (face->font, glyph->u.ch); - if (code != FONT_INVALID_CODE) - STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); - else - STORE_XCHAR2B (char2b, 0, 0); + if (code == FONT_INVALID_CODE) + code = 0; } - /* Make sure X resources of the face are allocated. */ - eassert (face != NULL); - PREPARE_FACE_FOR_DISPLAY (f, face); + STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); return face; } @@ -22758,9 +22757,12 @@ get_per_char_metric (struct font *font, XChar2b *char2b) { static struct font_metrics metrics; - unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b); + unsigned code; - if (! font || code == FONT_INVALID_CODE) + if (! font) + return NULL; + code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b); + if (code == FONT_INVALID_CODE) return NULL; font->driver->text_extents (font, &code, 1, &metrics); return &metrics; ------------------------------------------------------------ revno: 112122 committer: Paul Eggert branch nick: trunk timestamp: Sat 2013-03-23 17:49:50 -0700 message: Merge from gnulib. diff: === modified file 'ChangeLog' --- ChangeLog 2013-03-18 21:02:34 +0000 +++ ChangeLog 2013-03-24 00:49:50 +0000 @@ -1,3 +1,8 @@ +2013-03-24 Paul Eggert + + Merge from gnulib, incorporating: + 2013-03-21 sys_select, sys_time: port 2013-01-30 fix to Cygwin + 2013-03-18 Paul Eggert Fix bug when building Emacs with a GNU Make submake (Bug#13962). === modified file 'lib/sys_select.in.h' --- lib/sys_select.in.h 2013-02-08 23:37:17 +0000 +++ lib/sys_select.in.h 2013-03-24 00:49:50 +0000 @@ -21,23 +21,27 @@ /* On OSF/1 and Solaris 2.6, and both include . + On Cygwin, includes . Simply delegate to the system's header in this case. */ #if (@HAVE_SYS_SELECT_H@ \ - && ((defined __osf__ && defined _SYS_TYPES_H_ && defined _OSF_SOURCE) \ + && ((defined __osf__ && defined _SYS_TYPES_H_ \ + && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \ + && defined _OSF_SOURCE) \ || (defined __sun && defined _SYS_TYPES_H \ && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ - || defined __EXTENSIONS__))) \ - && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) + || defined __EXTENSIONS__)))) # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ #elif (@HAVE_SYS_SELECT_H@ \ - && ((defined __osf__ && defined _SYS_TIME_H_ && defined _OSF_SOURCE) \ + && (defined _CYGWIN_SYS_TIME_H \ + || (defined __osf__ && defined _SYS_TIME_H_ \ + && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \ + && defined _OSF_SOURCE) \ || (defined __sun && defined _SYS_TIME_H \ && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ - || defined __EXTENSIONS__))) \ - && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) + || defined __EXTENSIONS__)))) # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ === modified file 'lib/sys_time.in.h' --- lib/sys_time.in.h 2013-02-08 23:37:17 +0000 +++ lib/sys_time.in.h 2013-03-24 00:49:50 +0000 @@ -24,6 +24,14 @@ #endif @PRAGMA_COLUMNS@ +/* On Cygwin, includes itself recursively via . + Simply delegate to the system's header in this case; it is a no-op. + Without this extra ifdef, the C++ gettimeofday declaration below + would be a forward declaration in gnulib's nested . */ +#ifdef _CYGWIN_SYS_TIME_H +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +#else + /* The include_next requires a split double-inclusion guard. */ #if @HAVE_SYS_TIME_H@ # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ @@ -200,4 +208,5 @@ #endif #endif /* _@GUARD_PREFIX@_SYS_TIME_H */ +#endif /* _CYGWIN_SYS_TIME_H */ #endif /* _@GUARD_PREFIX@_SYS_TIME_H */ ------------------------------------------------------------ revno: 112121 committer: Ken Brown branch nick: trunk timestamp: Sat 2013-03-23 20:48:49 -0400 message: * src/w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-24 00:16:11 +0000 +++ src/ChangeLog 2013-03-24 00:48:49 +0000 @@ -1,5 +1,9 @@ 2013-03-24 Ken Brown + * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to + fix compilation on 64-bit Cygwin, where underscores are not + automatically prepended. + * w32term.c (w32_initialize): Silence compiler warning. 2013-03-23 Eli Zaretskii === modified file 'src/w32fns.c' --- src/w32fns.c 2013-03-20 11:29:37 +0000 +++ src/w32fns.c 2013-03-24 00:48:49 +0000 @@ -7759,6 +7759,9 @@ #endif if (stderr_fd >= 0) write (stderr_fd, "\r\nBacktrace:\r\n", 14); +#ifdef CYGWIN +#define _open open +#endif errfile_fd = _open ("emacs_backtrace.txt", O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE); if (errfile_fd >= 0) { ------------------------------------------------------------ revno: 112120 committer: Ken Brown branch nick: trunk timestamp: Sat 2013-03-23 20:16:11 -0400 message: * src/w32term.c (w32_initialize): Silence compiler warning. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-23 19:40:43 +0000 +++ src/ChangeLog 2013-03-24 00:16:11 +0000 @@ -1,3 +1,7 @@ +2013-03-24 Ken Brown + + * w32term.c (w32_initialize): Silence compiler warning. + 2013-03-23 Eli Zaretskii * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH, === modified file 'src/w32term.c' --- src/w32term.c 2013-03-23 19:40:43 +0000 +++ src/w32term.c 2013-03-24 00:16:11 +0000 @@ -6662,7 +6662,7 @@ Fset_input_mode (Qnil, Qnil, make_number (2), Qnil); { - DWORD input_locale_id = (DWORD) GetKeyboardLayout (0); + DWORD input_locale_id = ((DWORD_PTR) GetKeyboardLayout (0) & 0xffffffff); w32_keyboard_codepage = codepage_for_locale ((LCID) (input_locale_id & 0xffff)); } ------------------------------------------------------------ revno: 112119 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-03-24 02:04:40 +0400 message: * lisp/emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column): Make it safe-local. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-23 17:43:18 +0000 +++ lisp/ChangeLog 2013-03-23 22:04:40 +0000 @@ -1,5 +1,8 @@ 2013-03-23 Dmitry Gutov + * emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column): Make + it safe-local. + * vc/diff-mode.el (diff-mode-shared-map): Unbind "/" (Bug#14034). 2013-03-23 Leo Liu === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2013-02-17 16:58:12 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2013-03-23 22:04:40 +0000 @@ -1436,6 +1436,8 @@ :type '(choice (integer) (const :tag "Use the current `fill-column'" t)) :group 'lisp) +(put 'emacs-lisp-docstring-fill-column 'safe-local-variable + (lambda (x) (or (eq x t) (integerp x)))) (defun lisp-fill-paragraph (&optional justify) "Like \\[fill-paragraph], but handle Emacs Lisp comments and docstrings. ------------------------------------------------------------ revno: 112118 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-03-23 21:40:43 +0200 message: Fix fullscreen resizing of multiple frames on MS-Windows. src/w32term.h (struct w32_output): New members normal_width, normal_height, normal_top, normal_left, and prev_fsmode. (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP) (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these members of a frame. src/w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static variables, to save and restore frame dimensions. Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position after returning from a 'fullscreen' configuration. use SendMessage instead of PostMessage to send the SC_RESTORE message, to avoid races between the main thread and the input thread. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-23 09:01:14 +0000 +++ src/ChangeLog 2013-03-23 19:40:43 +0000 @@ -1,5 +1,19 @@ 2013-03-23 Eli Zaretskii + * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH, + FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static + variables, to save and restore frame dimensions. Use + FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position + after returning from a 'fullscreen' configuration. use + SendMessage instead of PostMessage to send the SC_RESTORE message, + to avoid races between the main thread and the input thread. + + * w32term.h (struct w32_output): New members normal_width, + normal_height, normal_top, normal_left, and prev_fsmode. + (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP) + (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these + members of a frame. + * w32term.c (w32fullscreen_hook): Record last value of the frame's 'fullscreen' parameter. Always record previous width and height of the frame, except when switching out of maximized modes, so === modified file 'src/w32term.c' --- src/w32term.c 2013-03-23 09:01:14 +0000 +++ src/w32term.c 2013-03-23 19:40:43 +0000 @@ -5660,9 +5660,6 @@ static void w32fullscreen_hook (FRAME_PTR f) { - static int normal_width, normal_height; - static Lisp_Object prev_full; - if (FRAME_VISIBLE_P (f)) { int width, height, top_pos, left_pos, pixel_height, pixel_width; @@ -5670,17 +5667,23 @@ RECT workarea_rect; block_input (); - if (!( EQ (prev_full, Qfullscreen) - || EQ (prev_full, Qfullboth) - || EQ (prev_full, Qmaximized))) + /* Record current "normal" dimensions for restoring later. */ + if (!( FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH + || FRAME_PREV_FSMODE (f) == FULLSCREEN_MAXIMIZED)) { - if (!EQ (prev_full, Qfullheight)) - normal_height = cur_h; - if (!EQ (prev_full, Qfullwidth)) - normal_width = cur_w; + if (FRAME_PREV_FSMODE (f) != FULLSCREEN_HEIGHT) + { + FRAME_NORMAL_HEIGHT (f) = cur_h; + FRAME_NORMAL_TOP (f) = f->top_pos; + } + if (FRAME_PREV_FSMODE (f) != FULLSCREEN_WIDTH) + { + FRAME_NORMAL_WIDTH (f) = cur_w; + FRAME_NORMAL_LEFT (f) = f->left_pos; + } } - eassert (normal_height > 0); - eassert (normal_width > 0); + eassert (FRAME_NORMAL_HEIGHT (f) > 0); + eassert (FRAME_NORMAL_WIDTH (f) > 0); x_real_positions (f, &f->left_pos, &f->top_pos); x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos); @@ -5693,16 +5696,15 @@ mouse pointer hovers over the window edges, becaise the WM will still think the window is maximized. */ if (f->want_fullscreen != FULLSCREEN_BOTH) - PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_RESTORE, 0); + SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_RESTORE, 0); + FRAME_PREV_FSMODE (f) = f->want_fullscreen; switch (f->want_fullscreen) { case FULLSCREEN_BOTH: - prev_full = Qfullboth; PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0); break; case FULLSCREEN_MAXIMIZED: - prev_full = Qmaximized; height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - XINT (Ftool_bar_lines_needed (selected_frame)) @@ -5714,28 +5716,25 @@ top_pos = workarea_rect.top; break; case FULLSCREEN_WIDTH: - prev_full = Qfullwidth; width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width) - FRAME_SCROLL_BAR_COLS (f); - height = normal_height; + height = FRAME_NORMAL_HEIGHT (f); left_pos = workarea_rect.left; break; case FULLSCREEN_HEIGHT: - prev_full = Qfullheight; height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - XINT (Ftool_bar_lines_needed (selected_frame)) + (NILP (Vmenu_bar_mode) ? 1 : 0); - width = normal_width; + width = FRAME_NORMAL_WIDTH (f); top_pos = workarea_rect.top; break; case FULLSCREEN_NONE: - prev_full = Qnil; - height = normal_height; - width = normal_width; - /* FIXME: Should restore the original position of the frame. */ - top_pos = left_pos = 0; + height = FRAME_NORMAL_HEIGHT (f); + width = FRAME_NORMAL_WIDTH (f); + left_pos = FRAME_NORMAL_LEFT (f); + top_pos = FRAME_NORMAL_TOP (f); break; } === modified file 'src/w32term.h' --- src/w32term.h 2013-03-10 22:55:25 +0000 +++ src/w32term.h 2013-03-23 19:40:43 +0000 @@ -359,6 +359,12 @@ /* The background for which the above relief GCs were set up. They are changed only when a different background is involved. */ unsigned long relief_background; + + /* Frame geometry and full-screen mode before it was resized by + specifying the 'fullscreen' frame parameter. Used to restore the + geometry when 'fullscreen' is reset to nil. */ + int normal_width, normal_height, normal_top, normal_left; + int prev_fsmode; }; extern struct w32_output w32term_display; @@ -390,6 +396,13 @@ #define FRAME_SMALLEST_FONT_HEIGHT(F) \ FRAME_W32_DISPLAY_INFO(F)->smallest_font_height + +#define FRAME_NORMAL_WIDTH(F) ((F)->output_data.w32->normal_width) +#define FRAME_NORMAL_HEIGHT(F) ((F)->output_data.w32->normal_height) +#define FRAME_NORMAL_TOP(F) ((F)->output_data.w32->normal_top) +#define FRAME_NORMAL_LEFT(F) ((F)->output_data.w32->normal_left) +#define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode) + /* W32-specific scroll bar stuff. */ ------------------------------------------------------------ revno: 112117 fixes bug: http://debbugs.gnu.org/14034 committer: Dmitry Gutov branch nick: trunk timestamp: Sat 2013-03-23 21:43:18 +0400 message: * lisp/vc/diff-mode.el (diff-mode-shared-map): Unbind "/". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-23 02:21:25 +0000 +++ lisp/ChangeLog 2013-03-23 17:43:18 +0000 @@ -1,3 +1,7 @@ +2013-03-23 Dmitry Gutov + + * vc/diff-mode.el (diff-mode-shared-map): Unbind "/" (Bug#14034). + 2013-03-23 Leo Liu * nxml/nxml-util.el (nxml-with-unmodifying-text-property-changes): === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2013-02-28 16:34:51 +0000 +++ lisp/vc/diff-mode.el 2013-03-23 17:43:18 +0000 @@ -124,7 +124,6 @@ ("A" . diff-ediff-patch) ("r" . diff-restrict-view) ("R" . diff-reverse-direction) - ("/" . diff-undo) ([remap undo] . diff-undo)) "Basic keymap for `diff-mode', bound to various prefix keys." :inherit special-mode-map) ------------------------------------------------------------ revno: 112116 author: cg committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-03-23 17:30:38 +0200 message: Fix MSVC compilation problem in lib-src. lib-src/makefile.w32-in (LIB_SRC): Move before first use. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2013-03-16 22:08:22 +0000 +++ lib-src/ChangeLog 2013-03-23 15:30:38 +0000 @@ -1,3 +1,7 @@ +2013-03-23 cg (tiny change) + + * makefile.w32-in (LIB_SRC): Move before first use. + 2013-03-16 Paul Eggert * pop.c: Fix ERRMAX typo (Bug#13925). === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2013-01-02 16:13:04 +0000 +++ lib-src/makefile.w32-in 2013-03-23 15:30:38 +0000 @@ -27,6 +27,7 @@ -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS) LIBS = $(BASE_LIBS) $(ADVAPI32) +LIB_SRC = . # The following target is used by makefile.w32-in files in other directories. make-docfile: $(BLD)/make-docfile.exe @@ -360,7 +361,6 @@ ### DEPENDENCIES ### EMACS_ROOT = .. -LIB_SRC = . SRC = $(EMACS_ROOT)/src NT_INC = $(EMACS_ROOT)/nt/inc GNU_LIB = $(EMACS_ROOT)/lib ------------------------------------------------------------ revno: 112115 fixes bug: http://debbugs.gnu.org/13935 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-03-23 11:33:00 +0200 message: Fix bug #13935 with inaccurate description of 'fullscreen'. doc/lispref/frames.texi (Size Parameters): More accurate description of the difference between 'fullboth' and 'maximized'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-03-17 16:51:36 +0000 +++ doc/lispref/ChangeLog 2013-03-23 09:33:00 +0000 @@ -1,3 +1,8 @@ +2013-03-23 Eli Zaretskii + + * frames.texi (Size Parameters): More accurate description of the + difference between 'fullboth' and 'maximized'. (Bug#13935) + 2013-03-17 Christopher Schmidt * symbols.texi (Standard Properties): Document pure. (Bug#13823) === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2013-03-16 08:22:31 +0000 +++ doc/lispref/frames.texi 2013-03-23 09:33:00 +0000 @@ -632,8 +632,9 @@ the height shall be set to the size of the screen. The value @code{maximized} specifies that the frame shall be maximized. The difference between @code{maximized} and @code{fullboth} is that the -former still has window manager decorations while the latter really -covers the whole screen. +former can still be resized by dragging window manager decorations +with the mouse, while the latter really covers the whole screen and +does not allow resizing by mouse dragging. @end table @node Layout Parameters ------------------------------------------------------------ revno: 112114 fixes bug: http://debbugs.gnu.org/14032 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-03-23 11:01:14 +0200 message: Fix bug #14032 with restoring frame dimensions on MS-Windows. src/w32term.c (w32fullscreen_hook): Record last value of the frame's 'fullscreen' parameter. Always record previous width and height of the frame, except when switching out of maximized modes, so that they could be restored correctly, instead of resetting to the default frame dimensions. Send SC_RESTORE command to the frame, unless we are going to send SC_MAXIMIZE, to restore the frame resize hints in the mouse pointer shown by the window manager. src/frame.c (get_frame_param): Now extern for WINDOWSNT as well. src/lisp.h (get_frame_param): Adjust conditions for prototype declaration. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-22 16:52:31 +0000 +++ src/ChangeLog 2013-03-23 09:01:14 +0000 @@ -1,3 +1,19 @@ +2013-03-23 Eli Zaretskii + + * w32term.c (w32fullscreen_hook): Record last value of the frame's + 'fullscreen' parameter. Always record previous width and height + of the frame, except when switching out of maximized modes, so + that they could be restored correctly, instead of resetting to the + default frame dimensions. Send SC_RESTORE command to the frame, + unless we are going to send SC_MAXIMIZE, to restore the frame + resize hints in the mouse pointer shown by the window manager. + (Bug#14032) + + * frame.c (get_frame_param): Now extern for WINDOWSNT as well. + + * lisp.h (get_frame_param): Adjust conditions for prototype + declaration. + 2013-03-22 Ken Brown * unexcw.c: Drop unneeded inclusion of w32common.h. === modified file 'src/frame.c' --- src/frame.c 2013-03-20 11:29:37 +0000 +++ src/frame.c 2013-03-23 09:01:14 +0000 @@ -1819,7 +1819,7 @@ /* Return the value of frame parameter PROP in frame FRAME. */ #ifdef HAVE_WINDOW_SYSTEM -#if !HAVE_NS +#if !HAVE_NS && !defined(WINDOWSNT) static #endif Lisp_Object === modified file 'src/lisp.h' --- src/lisp.h 2013-03-21 20:56:22 +0000 +++ src/lisp.h 2013-03-23 09:01:14 +0000 @@ -3511,7 +3511,7 @@ extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object); extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object); -#if HAVE_NS +#if HAVE_NS || defined(WINDOWSNT) extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); #endif extern void frames_discard_buffer (Lisp_Object); === modified file 'src/w32term.c' --- src/w32term.c 2013-03-15 10:07:29 +0000 +++ src/w32term.c 2013-03-23 09:01:14 +0000 @@ -5661,6 +5661,7 @@ w32fullscreen_hook (FRAME_PTR f) { static int normal_width, normal_height; + static Lisp_Object prev_full; if (FRAME_VISIBLE_P (f)) { @@ -5669,23 +5670,39 @@ RECT workarea_rect; block_input (); - if (normal_height <= 0) - normal_height = cur_h; - if (normal_width <= 0) - normal_width = cur_w; + if (!( EQ (prev_full, Qfullscreen) + || EQ (prev_full, Qfullboth) + || EQ (prev_full, Qmaximized))) + { + if (!EQ (prev_full, Qfullheight)) + normal_height = cur_h; + if (!EQ (prev_full, Qfullwidth)) + normal_width = cur_w; + } + eassert (normal_height > 0); + eassert (normal_width > 0); x_real_positions (f, &f->left_pos, &f->top_pos); x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos); SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0); pixel_height = workarea_rect.bottom - workarea_rect.top; pixel_width = workarea_rect.right - workarea_rect.left; + /* Need to send SC_RESTORE to the window, in case we are + resizing from FULLSCREEN_MAXIMIZED. Otherwise, the mouse + resize hints will not be shown by the window manager when the + mouse pointer hovers over the window edges, becaise the WM + will still think the window is maximized. */ + if (f->want_fullscreen != FULLSCREEN_BOTH) + PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_RESTORE, 0); switch (f->want_fullscreen) { case FULLSCREEN_BOTH: + prev_full = Qfullboth; PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0); break; case FULLSCREEN_MAXIMIZED: + prev_full = Qmaximized; height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - XINT (Ftool_bar_lines_needed (selected_frame)) @@ -5697,31 +5714,26 @@ top_pos = workarea_rect.top; break; case FULLSCREEN_WIDTH: + prev_full = Qfullwidth; width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width) - FRAME_SCROLL_BAR_COLS (f); - if (normal_height > 0) - height = normal_height; + height = normal_height; left_pos = workarea_rect.left; break; case FULLSCREEN_HEIGHT: + prev_full = Qfullheight; height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - XINT (Ftool_bar_lines_needed (selected_frame)) + (NILP (Vmenu_bar_mode) ? 1 : 0); - if (normal_width > 0) - width = normal_width; + width = normal_width; top_pos = workarea_rect.top; break; case FULLSCREEN_NONE: - if (normal_height > 0) - height = normal_height; - else - normal_height = height; - if (normal_width > 0) - width = normal_width; - else - normal_width = width; + prev_full = Qnil; + height = normal_height; + width = normal_width; /* FIXME: Should restore the original position of the frame. */ top_pos = left_pos = 0; break; ------------------------------------------------------------ revno: 112113 committer: Leo Liu branch nick: trunk timestamp: Sat 2013-03-23 10:21:25 +0800 message: * lisp/nxml/nxml-util.el (nxml-with-unmodifying-text-property-changes): Remove. * lisp/nxml/rng-valid.el (rng-validate-mode) (rng-after-change-function, rng-do-some-validation): * lisp/nxml/rng-maint.el (rng-validate-buffer): * lisp/nxml/nxml-rap.el (nxml-tokenize-forward, nxml-ensure-scan-up-to-date): * lisp/nxml/nxml-outln.el (nxml-show-all, nxml-set-outline-state): * lisp/nxml/nxml-mode.el (nxml-mode, nxml-degrade, nxml-after-change) (nxml-extend-after-change-region): Use with-silent-modifications. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-23 01:38:56 +0000 +++ lisp/ChangeLog 2013-03-23 02:21:25 +0000 @@ -1,5 +1,16 @@ 2013-03-23 Leo Liu + * nxml/nxml-util.el (nxml-with-unmodifying-text-property-changes): + Remove. + + * nxml/rng-valid.el (rng-validate-mode) + (rng-after-change-function, rng-do-some-validation): + * nxml/rng-maint.el (rng-validate-buffer): + * nxml/nxml-rap.el (nxml-tokenize-forward, nxml-ensure-scan-up-to-date): + * nxml/nxml-outln.el (nxml-show-all, nxml-set-outline-state): + * nxml/nxml-mode.el (nxml-mode, nxml-degrade, nxml-after-change) + (nxml-extend-after-change-region): Use with-silent-modifications. + * nxml/rng-nxml.el (rng-set-state-after): Do not let-bind timer-idle-list. === modified file 'lisp/nxml/nxml-mode.el' --- lisp/nxml/nxml-mode.el 2013-02-12 17:36:54 +0000 +++ lisp/nxml/nxml-mode.el 2013-03-23 02:21:25 +0000 @@ -540,7 +540,7 @@ (widen) (nxml-clear-dependent-regions (point-min) (point-max)) (setq nxml-scan-end (copy-marker (point-min) nil)) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (nxml-clear-inside (point-min) (point-max)) (nxml-with-invisible-motion (nxml-scan-prolog))))) @@ -601,7 +601,7 @@ (save-excursion (save-restriction (widen) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (nxml-clear-inside (point-min) (point-max)))))) ;;; Change management @@ -625,7 +625,7 @@ (widen) (save-match-data (nxml-with-invisible-motion - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (nxml-after-change1 start end pre-change-length))))))))) @@ -910,7 +910,7 @@ (widen) (save-match-data (nxml-with-invisible-motion - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (nxml-extend-after-change-region1 start end pre-change-length))))))))) (if (consp region) region)))) === modified file 'lisp/nxml/nxml-outln.el' --- lisp/nxml/nxml-outln.el 2013-01-01 09:11:05 +0000 +++ lisp/nxml/nxml-outln.el 2013-03-23 02:21:25 +0000 @@ -149,7 +149,7 @@ (defun nxml-show-all () "Show all elements in the buffer normally." (interactive) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (remove-text-properties (point-min) (point-max) '(nxml-outline-state nil))) @@ -370,7 +370,7 @@ (get-text-property pos 'nxml-outline-state)) (defun nxml-set-outline-state (pos state) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (if state (put-text-property pos (1+ pos) 'nxml-outline-state state) (remove-text-properties pos (1+ pos) '(nxml-outline-state nil))))) === modified file 'lisp/nxml/nxml-rap.el' --- lisp/nxml/nxml-rap.el 2013-01-01 09:11:05 +0000 +++ lisp/nxml/nxml-rap.el 2013-03-23 02:21:25 +0000 @@ -293,7 +293,7 @@ (cond ((memq xmltok-type '(comment cdata-section processing-instruction)) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (nxml-set-inside (1+ xmltok-start) (point) xmltok-type))) (xmltok-dependent-regions (nxml-mark-parse-dependent-regions))) @@ -338,7 +338,7 @@ '(comment processing-instruction cdata-section)) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (nxml-set-inside (1+ xmltok-start) (point) xmltok-type))) === modified file 'lisp/nxml/nxml-util.el' --- lisp/nxml/nxml-util.el 2013-01-01 09:11:05 +0000 +++ lisp/nxml/nxml-util.el 2013-03-23 02:21:25 +0000 @@ -78,27 +78,6 @@ (nxml-degrade ,context ,error-symbol)))) `(progn ,@body))) -(defmacro nxml-with-unmodifying-text-property-changes (&rest body) - "Evaluate BODY without any text property changes modifying the buffer. -Any text properties changes happen as usual but the changes are not treated as -modifications to the buffer." - (let ((modified (make-symbol "modified"))) - `(let ((,modified (buffer-modified-p)) - (inhibit-read-only t) - (inhibit-modification-hooks t) - (buffer-undo-list t) - (deactivate-mark nil) - ;; Apparently these avoid file locking problems. - (buffer-file-name nil) - (buffer-file-truename nil)) - (unwind-protect - (progn ,@body) - (unless ,modified - (restore-buffer-modified-p nil)))))) - -(put 'nxml-with-unmodifying-text-property-changes 'lisp-indent-function 0) -(def-edebug-spec nxml-with-unmodifying-text-property-changes t) - (defmacro nxml-with-invisible-motion (&rest body) "Evaluate body without calling any point motion hooks." `(let ((inhibit-point-motion-hooks t)) === modified file 'lisp/nxml/rng-maint.el' --- lisp/nxml/rng-maint.el 2013-01-01 09:11:05 +0000 +++ lisp/nxml/rng-maint.el 2013-03-23 02:21:25 +0000 @@ -259,7 +259,7 @@ (defun rng-validate-buffer () (save-restriction (widen) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (rng-clear-cached-state (point-min) (point-max))) ;; 1+ to clear empty overlays at (point-max) (rng-clear-overlays (point-min) (1+ (point-max)))) === modified file 'lisp/nxml/rng-valid.el' --- lisp/nxml/rng-valid.el 2013-03-23 01:38:56 +0000 +++ lisp/nxml/rng-valid.el 2013-03-23 02:21:25 +0000 @@ -244,7 +244,7 @@ (> (prefix-numeric-value arg) 0))) (save-restriction (widen) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (rng-clear-cached-state (point-min) (point-max))) ;; 1+ to clear empty overlays at (point-max) (rng-clear-overlays (point-min) (1+ (point-max))) @@ -305,7 +305,7 @@ (defun rng-after-change-function (start end pre-change-len) (setq rng-message-overlay-inhibit-point nil) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (rng-clear-cached-state start end)) ;; rng-validate-up-to-date-end holds the position before the change ;; Adjust it to reflect the change. @@ -469,7 +469,7 @@ (condition-case-unless-debug err (and (rng-validate-prepare) (let ((rng-dt-namespace-context-getter '(nxml-ns-get-context))) - (nxml-with-unmodifying-text-property-changes + (with-silent-modifications (rng-do-some-validation-1 continue-p-function)))) ;; errors signaled from a function run by an idle timer ;; are ignored; if we don't catch them, validation