------------------------------------------------------------ revno: 117568 fixes bug: http://debbugs.gnu.org/18095 committer: Michael Albinus branch nick: trunk timestamp: Thu 2014-07-24 09:30:36 +0200 message: * net/tramp-cache.el (tramp-flush-file-function): Wrap the code with `save-match-data'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-07-21 17:53:38 +0000 +++ lisp/ChangeLog 2014-07-24 07:30:36 +0000 @@ -1,3 +1,8 @@ +2014-07-24 Michael Albinus + + * net/tramp-cache.el (tramp-flush-file-function): Wrap the code + with `save-match-data'. (Bug#18095) + 2014-07-21 Vincent Belaïche * ses.el (ses-truncate-cell): Use cl-progv instead of eval in === modified file 'lisp/net/tramp-cache.el' --- lisp/net/tramp-cache.el 2014-06-15 15:47:35 +0000 +++ lisp/net/tramp-cache.el 2014-07-24 07:30:36 +0000 @@ -201,17 +201,19 @@ ;; Reverting or killing a buffer should also flush file properties. ;; They could have been changed outside Tramp. In eshell, "ls" would ;; not show proper directory contents when a file has been copied or -;; deleted before. +;; deleted before. We must apply `save-match-data', because it would +;; corrupt other packages otherwise (reported from org). (defun tramp-flush-file-function () "Flush all Tramp cache properties from `buffer-file-name'. This is suppressed for temporary buffers." - (unless (string-match "^ \\*temp\\*" (or (buffer-name) "")) - (let ((bfn (if (stringp (buffer-file-name)) - (buffer-file-name) - default-directory))) - (when (tramp-tramp-file-p bfn) - (with-parsed-tramp-file-name bfn nil - (tramp-flush-file-property v localname)))))) + (save-match-data + (unless (string-match "^ \\*temp\\*" (or (buffer-name) "")) + (let ((bfn (if (stringp (buffer-file-name)) + (buffer-file-name) + default-directory))) + (when (tramp-tramp-file-p bfn) + (with-parsed-tramp-file-name bfn nil + (tramp-flush-file-property v localname))))))) (add-hook 'before-revert-hook 'tramp-flush-file-function) (add-hook 'eshell-pre-command-hook 'tramp-flush-file-function) ------------------------------------------------------------ revno: 117567 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-07-24 09:49:14 +0400 message: Fix error reported by Angelo Graziosi in and complete previous change. * frame.c (adjust_frame_height): New function. (Fset_frame_height, Fset_frame_size): Use it. (x_set_frame_parameters): Take frame top margin into account. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-23 16:09:34 +0000 +++ src/ChangeLog 2014-07-24 05:49:14 +0000 @@ -1,3 +1,12 @@ +2014-07-24 Dmitry Antipov + + Fix error reported by Angelo Graziosi in + + and complete previous change. + * frame.c (adjust_frame_height): New function. + (Fset_frame_height, Fset_frame_size): Use it. + (x_set_frame_parameters): Take frame top margin into account. + 2014-07-23 Dmitry Antipov * frame.c (Fset_frame_height): Take frame top margin into account. === modified file 'src/frame.c' --- src/frame.c 2014-07-23 16:09:34 +0000 +++ src/frame.c 2014-07-24 05:49:14 +0000 @@ -2565,7 +2565,21 @@ { return make_number (FRAME_BOTTOM_DIVIDER_WIDTH (decode_any_frame (frame))); } - + +/* For requested height in *HEIGHTP, calculate new height of frame F in + character units and return true if actual height should be changed. */ + +static bool +adjust_frame_height (struct frame *f, int *heightp) +{ + if (FRAME_LINES (f) - FRAME_TOP_MARGIN (f) != *heightp) + { + *heightp += FRAME_TOP_MARGIN (f); + return 1; + } + return 0; +} + DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 4, 0, doc: /* Specify that the frame FRAME has HEIGHT text lines. Optional third arg PRETEND non-nil means that redisplay should use @@ -2584,9 +2598,10 @@ { if (NILP (pixelwise)) { - if (FRAME_LINES (f) - FRAME_TOP_MARGIN (f) != XINT (height)) - x_set_window_size (f, 1, FRAME_COLS (f), - XINT (height) + FRAME_TOP_MARGIN (f), 0); + int h = XINT (height); + + if (adjust_frame_height (f, &h)) + x_set_window_size (f, 1, FRAME_COLS (f), h, 0); do_pending_window_change (0); } @@ -2653,15 +2668,17 @@ #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) { + int h = XINT (height); + if (!NILP (pixelwise) ? (XINT (width) != FRAME_TEXT_WIDTH (f) - || XINT (height) != FRAME_TEXT_HEIGHT (f) + || h != FRAME_TEXT_HEIGHT (f) || f->new_height || f->new_width) - : (XINT (width) != FRAME_COLS (f) - || XINT (height) != FRAME_LINES (f) + : (adjust_frame_height (f, &h) + || XINT (width) != FRAME_COLS (f) || f->new_height || f->new_width)) { - x_set_window_size (f, 1, XINT (width), XINT (height), + x_set_window_size (f, 1, XINT (width), h, NILP (pixelwise) ? 0 : 1); do_pending_window_change (0); } @@ -2865,7 +2882,9 @@ else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX)) { height_change = 1; - height = XFASTINT (val) * FRAME_LINE_HEIGHT (f); + /* Add menu and tool bar lines to correctly resize F pixelwise. */ + height + = (XFASTINT (val) + FRAME_TOP_MARGIN (f)) * FRAME_LINE_HEIGHT (f); } else if (EQ (prop, Qtop)) top = val; ------------------------------------------------------------ revno: 117566 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2014-07-23 20:09:34 +0400 message: * frame.c (Fset_frame_height): Take frame top margin into account. Incorrect behavior was reported by Martin Rudalics in diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-22 13:55:04 +0000 +++ src/ChangeLog 2014-07-23 16:09:34 +0000 @@ -1,3 +1,9 @@ +2014-07-23 Dmitry Antipov + + * frame.c (Fset_frame_height): Take frame top margin into account. + Incorrect behavior was reported by Martin Rudalics in + + 2014-07-22 Dmitry Antipov * xterm.h (struct x_output) [USE_X_TOOLKIT || USE_GTK]: Define === modified file 'src/frame.c' --- src/frame.c 2014-07-21 16:58:12 +0000 +++ src/frame.c 2014-07-23 16:09:34 +0000 @@ -2584,8 +2584,9 @@ { if (NILP (pixelwise)) { - if (XINT (height) != FRAME_LINES (f)) - x_set_window_size (f, 1, FRAME_COLS (f), XINT (height), 0); + if (FRAME_LINES (f) - FRAME_TOP_MARGIN (f) != XINT (height)) + x_set_window_size (f, 1, FRAME_COLS (f), + XINT (height) + FRAME_TOP_MARGIN (f), 0); do_pending_window_change (0); } ------------------------------------------------------------ revno: 117565 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-07-22 17:55:04 +0400 message: * xterm.h (struct x_output) [USE_LUCID && USE_TOOLKIT_SCROLL_BARS]: Define scroll_bar_top_shadow_pixel and scroll_bar_bottom_shadow_pixel as such. All related users changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-07-22 10:34:05 +0000 +++ src/ChangeLog 2014-07-22 13:55:04 +0000 @@ -2,6 +2,9 @@ * xterm.h (struct x_output) [USE_X_TOOLKIT || USE_GTK]: Define menubar_height as such. Tweak comment. + [USE_LUCID && USE_TOOLKIT_SCROLL_BARS]: Likewise for + scroll_bar_top_shadow_pixel and scroll_bar_bottom_shadow_pixel. + All related users changed. (FRAME_MENUBAR_HEIGHT) [!USE_X_TOOLKIT && !USE_GTK]: No-op. * xterm.c (handle_one_xevent): * gtkutil.c (xg_event_is_for_menubar): === modified file 'src/xfns.c' --- src/xfns.c 2014-07-22 10:34:05 +0000 +++ src/xfns.c 2014-07-22 13:55:04 +0000 @@ -1221,7 +1221,7 @@ if (f->output_data.x->scroll_bar_background_pixel != -1) unload_color (f, f->output_data.x->scroll_bar_background_pixel); -#ifdef USE_TOOLKIT_SCROLL_BARS +#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS) /* Scrollbar shadow colors. */ if (f->output_data.x->scroll_bar_top_shadow_pixel != -1) { @@ -1233,7 +1233,7 @@ unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel); f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; } -#endif /* USE_TOOLKIT_SCROLL_BARS */ +#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */ f->output_data.x->scroll_bar_background_pixel = pixel; if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f)) @@ -2950,10 +2950,10 @@ FRAME_FONTSET (f) = -1; f->output_data.x->scroll_bar_foreground_pixel = -1; f->output_data.x->scroll_bar_background_pixel = -1; -#ifdef USE_TOOLKIT_SCROLL_BARS +#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS) f->output_data.x->scroll_bar_top_shadow_pixel = -1; f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; -#endif /* USE_TOOLKIT_SCROLL_BARS */ +#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */ f->output_data.x->white_relief.pixel = -1; f->output_data.x->black_relief.pixel = -1; @@ -4952,10 +4952,10 @@ FRAME_FONTSET (f) = -1; f->output_data.x->scroll_bar_foreground_pixel = -1; f->output_data.x->scroll_bar_background_pixel = -1; -#ifdef USE_TOOLKIT_SCROLL_BARS +#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS) f->output_data.x->scroll_bar_top_shadow_pixel = -1; f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; -#endif /* USE_TOOLKIT_SCROLL_BARS */ +#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */ f->output_data.x->white_relief.pixel = -1; f->output_data.x->black_relief.pixel = -1; === modified file 'src/xterm.c' --- src/xterm.c 2014-07-22 10:34:05 +0000 +++ src/xterm.c 2014-07-22 13:55:04 +0000 @@ -9269,13 +9269,13 @@ unload_color (f, f->output_data.x->scroll_bar_background_pixel); if (f->output_data.x->scroll_bar_foreground_pixel != -1) unload_color (f, f->output_data.x->scroll_bar_foreground_pixel); -#ifdef USE_TOOLKIT_SCROLL_BARS +#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS) /* Scrollbar shadow colors. */ if (f->output_data.x->scroll_bar_top_shadow_pixel != -1) unload_color (f, f->output_data.x->scroll_bar_top_shadow_pixel); if (f->output_data.x->scroll_bar_bottom_shadow_pixel != -1) unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel); -#endif /* USE_TOOLKIT_SCROLL_BARS */ +#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */ if (f->output_data.x->white_relief.pixel != -1) unload_color (f, f->output_data.x->white_relief.pixel); if (f->output_data.x->black_relief.pixel != -1) === modified file 'src/xterm.h' --- src/xterm.h 2014-07-22 10:34:05 +0000 +++ src/xterm.h 2014-07-22 13:55:04 +0000 @@ -541,10 +541,12 @@ bars). */ unsigned long scroll_bar_background_pixel; - /* Top and bottom shadow colors for 3d toolkit scrollbars. -1 means - let the scroll compute them itself. */ +#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS) + /* Top and bottom shadow colors for 3D Lucid scrollbars. + -1 means let the scroll compute them itself. */ unsigned long scroll_bar_top_shadow_pixel; unsigned long scroll_bar_bottom_shadow_pixel; +#endif /* Descriptor for the cursor in use for this window. */ Cursor text_cursor;