commit 02138cb0b88c5f6addf891d725967d9867eda3f9 (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Wed Feb 11 09:07:24 2015 +0100 Improve toggling fullscreen state of frames. * frame.el (toggle-frame-maximized, toggle-frame-fullscreen): Rename frame parameter `maximized' to `fullscreen-restore'. Restore fullwidth/-height after fullboth state. Update doc-strings. * w32term.c (w32_read_socket): In SIZE_MAXIMIZED and SIZE_RESTORED cases correctly handle `maximized' value for the `fullscreen' parameter. Don't use the 'maximized' parameter any more. (w32fullscreen_hook): Include menu bar height when calculating new text height in FULLSCREEN_BOTH case. * xterm.c (do_ewmh_fullscreen): Handle transition from FULLSCREEN_BOTH to FULLSCREEN_MAXIMIZED when x_frame_normalize_before_maximize is set. * frames.texi (Size Parameters): Update description of fullscreen frame parameter. diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 0c76a6b..3e5d9ac 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2015-02-11 Martin Rudalics + + * frames.texi (Size Parameters): Update description of + fullscreen frame parameter. + 2015-02-09 Eli Zaretskii * positions.texi (Screen Lines): Update the documentation of diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index a6f4081..559f4cc 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -701,6 +701,7 @@ parameters represent the user's stated preference; otherwise, use @code{nil}. @end table + @node Size Parameters @subsubsection Size Parameters @cindex window size on display @@ -731,22 +732,34 @@ user-position}) does for the position parameters @code{top} and @vindex fullscreen, a frame parameter @item fullscreen Specify that width, height or both shall be maximized. The value -@code{fullwidth} specifies that width shall be as wide as possible. -The value @code{fullheight} specifies that height shall be as tall as +@code{fullwidth} specifies that width shall be as wide as possible. The +value @code{fullheight} specifies that height shall be as tall as possible. The value @code{fullboth} specifies that both the width and 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 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. +@code{maximized} specifies that the frame shall be maximized. + +The difference between @code{maximized} and @code{fullboth} is that a +maximized frame usually keeps its title bar and the buttons for resizing +and closing the frame. Also, maximized frames typically avoid hiding +any task bar or panels displayed on the desktop. ``Fullboth'' frames, +on the other hand, usually omit the title bar and occupy the entire +available screen space. + +``Fullheight'' and ``fullwidth'' frames are more similar to maximized +frames in this regard. However, these typically display an external +border which might be absent with maximized frames. Hence the heights +of maximized and fullheight frames and the widths of maximized and +fullwidth frames often differ by a few pixels. With some window managers you may have to customize the variable -@code{frame-resize-pixelwise} (@pxref{Size and Position}) to a -non-@code{nil} value in order to make a frame appear ``maximized'' or -``fullscreen''. +@code{frame-resize-pixelwise} (@pxref{Size and Position}) in order to +make a frame truly appear ``maximized'' or ``fullscreen''. Moreover, +some window managers might not support smooth transition between the +various fullscreen or maximization states. Customizing the variable +@code{x-frame-normalize-before-maximize} can help to overcome that. @end table + @node Layout Parameters @subsubsection Layout Parameters @cindex layout parameters of frames diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 03b465e..a6e5f59 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-02-11 Martin Rudalics + + * frame.el (toggle-frame-maximized, toggle-frame-fullscreen): + Rename frame parameter `maximized' to `fullscreen-restore'. + Restore fullwidth/-height after fullboth state. Update + doc-strings. + 2015-02-11 Lars Ingebrigtsen * net/shr.el (shr-insert): Make sure the space inserted has the diff --git a/lisp/frame.el b/lisp/frame.el index ecb433e..dfcebf1 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1874,57 +1874,56 @@ terminals, cursor blinking is controlled by the terminal." ;; Frame maximization/fullscreen (defun toggle-frame-maximized () - "Toggle maximization state of the selected frame. -Maximize the selected frame or un-maximize if it is already maximized. -Respect window manager screen decorations. -If the frame is in fullscreen mode, don't change its mode, -just toggle the temporary frame parameter `maximized', -so the frame will go to the right maximization state -after disabling fullscreen mode. + "Toggle maximization state of selected frame. +Maximize selected frame or un-maximize if it is already maximized. + +If the frame is in fullscreen state, don't change its state, but +set the frame's `fullscreen-restore' parameter to `maximized', so +the frame will be maximized after disabling fullscreen state. Note that with some window managers you may have to set `frame-resize-pixelwise' to non-nil in order to make a frame -appear truly maximized. +appear truly maximized. In addition, you may have to set +`x-frame-normalize-before-maximize' in order to enable +transitions from one fullscreen state to another. See also `toggle-frame-fullscreen'." (interactive) - (if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth)) - (modify-frame-parameters - nil - `((maximized - . ,(unless (eq (frame-parameter nil 'maximized) 'maximized) - 'maximized)))) - (modify-frame-parameters - nil - `((fullscreen - . ,(unless (eq (frame-parameter nil 'fullscreen) 'maximized) - 'maximized)))))) + (let ((fullscreen (frame-parameter nil 'fullscreen))) + (cond + ((memq fullscreen '(fullscreen fullboth)) + (set-frame-parameter nil 'fullscreen-restore 'maximized)) + ((eq fullscreen 'maximized) + (set-frame-parameter nil 'fullscreen nil)) + (t + (set-frame-parameter nil 'fullscreen 'maximized))))) (defun toggle-frame-fullscreen () - "Toggle fullscreen mode of the selected frame. -Enable fullscreen mode of the selected frame or disable if it is -already fullscreen. Ignore window manager screen decorations. -When turning on fullscreen mode, remember the previous value of the -maximization state in the temporary frame parameter `maximized'. -Restore the maximization state when turning off fullscreen mode. + "Toggle fullscreen state of selected frame. +Make selected frame fullscreen or restore its previous size if it +is already fullscreen. + +Before making the frame fullscreen remember the current value of +the frame's `fullscreen' parameter in the `fullscreen-restore' +parameter of the frame. That value is used to restore the +frame's size when toggling fullscreen the next time. Note that with some window managers you may have to set `frame-resize-pixelwise' to non-nil in order to make a frame -appear truly fullscreen. +appear truly fullscreen. In addition, you may have to set +`x-frame-normalize-before-maximize' in order to enable +transitions from one fullscreen state to another. See also `toggle-frame-maximized'." (interactive) - (modify-frame-parameters - nil - `((maximized - . ,(unless (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth)) - (frame-parameter nil 'fullscreen))) - (fullscreen - . ,(if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth)) - (if (eq (frame-parameter nil 'maximized) 'maximized) - 'maximized) - 'fullscreen))))) - + (let ((fullscreen (frame-parameter nil 'fullscreen))) + (if (memq fullscreen '(fullscreen fullboth)) + (let ((fullscreen-restore (frame-parameter nil 'fullscreen-restore))) + (if (memq fullscreen-restore '(maximized fullheight fullwidth)) + (set-frame-parameter nil 'fullscreen fullscreen-restore) + (set-frame-parameter nil 'fullscreen nil))) + (modify-frame-parameters + nil `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))))) ;;;; Key bindings diff --git a/src/ChangeLog b/src/ChangeLog index b4abdc5..f8e65d5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2015-02-11 Martin Rudalics + + * w32term.c (w32_read_socket): In SIZE_MAXIMIZED and + SIZE_RESTORED cases correctly handle `maximized' value for the + `fullscreen' parameter. Don't use 'maximized' frame parameter + any more. + (w32fullscreen_hook): Include menu bar height when calculating + new text height in FULLSCREEN_BOTH case. + * xterm.c (do_ewmh_fullscreen): Handle transition from + FULLSCREEN_BOTH to FULLSCREEN_MAXIMIZED when + x_frame_normalize_before_maximize is set. + 2015-02-10 Paul Eggert Use bool for boolean in xdisp.c diff --git a/src/w32term.c b/src/w32term.c index fb9d238..a9ed2a8 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5052,6 +5052,7 @@ w32_read_socket (struct terminal *terminal, case SIZE_MAXIMIZED: { bool iconified = FRAME_ICONIFIED_P (f); + Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, false); @@ -5082,12 +5083,22 @@ w32_read_socket (struct terminal *terminal, to update the frame titles in case this is the second frame. */ record_asynch_buffer_change (); - } - if (EQ (get_frame_param (f, Qfullscreen), Qnil)) - set_frame_param (f, Qfullscreen, Qmaximized); - else if (! EQ (get_frame_param (f, Qfullscreen), Qmaximized)) - set_frame_param (f, Qmaximized, Qmaximized); + /* Windows can send us a SIZE_MAXIMIZED message even + when fullscreen is fullboth. The following is a + simple hack to check that based on the fact that + only a maximized fullscreen frame should have both + top/left outside the screen. */ + if (EQ (fullscreen, Qfullwidth) || EQ (fullscreen, Qfullheight) + || NILP (fullscreen)) + { + int x, y; + + x_real_positions (f, &x, &y); + if (x < 0 && y < 0) + store_frame_param (f, Qfullscreen, Qmaximized); + } + } break; @@ -5128,9 +5139,7 @@ w32_read_socket (struct terminal *terminal, } if (EQ (get_frame_param (f, Qfullscreen), Qmaximized)) - set_frame_param (f, Qfullscreen, Qnil); - else if (! EQ (get_frame_param (f, Qmaximized), Qnil)) - set_frame_param (f, Qmaximized, Qnil); + store_frame_param (f, Qfullscreen, Qnil); break; } @@ -6008,6 +6017,8 @@ w32fullscreen_hook (struct frame *f) } else if (f->want_fullscreen == FULLSCREEN_BOTH) { + int menu_bar_height = GetSystemMetrics (SM_CYMENU); + w32_fullscreen_rect (hwnd, f->want_fullscreen, FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect); SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); @@ -6016,7 +6027,8 @@ w32fullscreen_hook (struct frame *f) SWP_NOOWNERZORDER | SWP_FRAMECHANGED); change_frame_size (f, FRAME_PIXEL_TO_TEXT_WIDTH (f, rect.right - rect.left), - FRAME_PIXEL_TO_TEXT_HEIGHT (f, rect.bottom - rect.top), + FRAME_PIXEL_TO_TEXT_HEIGHT (f, (rect.bottom - rect.top + - menu_bar_height)), 0, 1, 0, 1); } else diff --git a/src/xterm.c b/src/xterm.c index 6a63a45..0b3efe7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9271,7 +9271,15 @@ do_ewmh_fullscreen (struct frame *f) } break; case FULLSCREEN_MAXIMIZED: - if (x_frame_normalize_before_maximize && cur == FULLSCREEN_WIDTH) + if (x_frame_normalize_before_maximize && cur == FULLSCREEN_BOTH) + { + set_wm_state (frame, false, + dpyinfo->Xatom_net_wm_state_fullscreen, None); + set_wm_state (frame, true, + dpyinfo->Xatom_net_wm_state_maximized_horz, + dpyinfo->Xatom_net_wm_state_maximized_vert); + } + else if (x_frame_normalize_before_maximize && cur == FULLSCREEN_WIDTH) { set_wm_state (frame, false, dpyinfo->Xatom_net_wm_state_maximized_horz, None); commit 6ebbeafc94a35e49fc3a842b5f5fbd7b069ce936 Author: Lars Magne Ingebrigtsen Date: Wed Feb 11 17:24:42 2015 +1100 Fix
  • indentation in shr (shr-ensure-paragraph): Don't insert a new paragraph as the first item in a

  • . diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ec017c..03b465e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * net/shr.el (shr-insert): Make sure the space inserted has the right font (for width). (shr-fill-line): Preserve background colours when indenting/folding. + (shr-ensure-paragraph): Don't insert a new paragraph as the first + item in a
  • . 2015-02-10 Lars Ingebrigtsen diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 7a93c3a..cf35a12 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -719,23 +719,32 @@ size, and full-buffer size." (defun shr-ensure-paragraph () (unless (bobp) - (if (<= (current-column) shr-indentation) - (unless (save-excursion - (forward-line -1) - (looking-at " *$")) - (insert "\n")) - (if (save-excursion - (beginning-of-line) - ;; If the current line is totally blank, and doesn't even - ;; have any face properties set, then delete the blank - ;; space. - (and (looking-at " *$") - (not (get-text-property (point) 'face)) - (not (= (next-single-property-change (point) 'face nil - (line-end-position)) - (line-end-position))))) - (delete-region (match-beginning 0) (match-end 0)) - (insert "\n\n"))))) + (let ((prefix (get-text-property (line-beginning-position) + 'shr-prefix-length))) + (cond + ((and (bolp) + (save-excursion + (forward-line -1) + (looking-at " *$"))) + ;; We're already at a new paragraph; do nothing. + ) + ((and prefix + (= prefix (- (point) (line-beginning-position)))) + ;; Do nothing; we're at the start of a
  • . + ) + ((save-excursion + (beginning-of-line) + ;; If the current line is totally blank, and doesn't even + ;; have any face properties set, then delete the blank + ;; space. + (and (looking-at " *$") + (not (get-text-property (point) 'face)) + (not (= (next-single-property-change (point) 'face nil + (line-end-position)) + (line-end-position))))) + (delete-region (match-beginning 0) (match-end 0))) + (t + (insert "\n\n")))))) (defun shr-indent () (when (> shr-indentation 0) @@ -1406,6 +1415,7 @@ The preference is a float determined from `shr-prefer-media-type'." (shr-string-pixel-width bullet)))) (put-text-property start (1+ start) 'shr-continuation-indentation shr-indentation) + (put-text-property start (1+ start) 'shr-prefix-length (length bullet)) (shr-generic dom))))) (defun shr-mark-fill (start) commit 097e16e26663c1010db6f6dc2db7b5f1b7a4dbc0 Author: Lars Magne Ingebrigtsen Date: Wed Feb 11 05:58:14 2015 +0000 lisp/gnus/gnus-art.el (gnus-treat-buttonize): Don't buttonize URLs in HTML diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 94a55f4..f21d01f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2015-02-11 Lars Ingebrigtsen + + * gnus-art.el (gnus-treat-buttonize): Don't re-buttonize URLs in HTML + parts, because that breaks filling (since buttons are in a bold face). + 2015-02-10 Katsumi Yamaoka * mm-decode.el (mm-convert-shr-links): Delete useless variable `face'; diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 557c6a3..4ad0601 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -1139,7 +1139,7 @@ predicate. See Info node `(gnus)Customizing Articles'." :type gnus-article-treat-custom) (put 'gnus-treat-highlight-signature 'highlight t) -(defcustom gnus-treat-buttonize 100000 +(defcustom gnus-treat-buttonize '(and 100000 (typep "text/plain")) "Add buttons. Valid values are nil, t, `head', `first', `last', an integer or a predicate. See Info node `(gnus)Customizing Articles'." commit e6929b0b8a3c4a10023f700c6121f9e0b182aa8a Author: Lars Magne Ingebrigtsen Date: Wed Feb 11 15:34:07 2015 +1100 (shr-fill-line): Preserve background colours when indenting/folding. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7274c9d..7ec017c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * net/shr.el (shr-insert): Make sure the space inserted has the right font (for width). + (shr-fill-line): Preserve background colours when indenting/folding. 2015-02-10 Lars Ingebrigtsen diff --git a/lisp/net/shr.el b/lisp/net/shr.el index a432085..7a93c3a 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -550,7 +550,12 @@ size, and full-buffer size." (point) 'shr-continuation-indentation)) start) (put-text-property (point) (1+ (point)) 'shr-indentation nil) - (shr-indent) + (let ((face (get-text-property (point) 'face)) + (background-start (point))) + (shr-indent) + (when face + (put-text-property background-start (point) 'face + `,(shr-face-background face)))) (setq start (point)) (setq shr-indentation (or continuation shr-indentation)) (shr-vertical-motion shr-internal-width) @@ -570,8 +575,13 @@ size, and full-buffer size." ;; Success; continue. (when (= (preceding-char) ?\s) (delete-char -1)) - (insert "\n") - (shr-indent) + (let ((face (get-text-property (point) 'face)) + (background-start (point))) + (insert "\n") + (shr-indent) + (when face + (put-text-property background-start (point) 'face + `,(shr-face-background face)))) (setq start (point)) (shr-vertical-motion shr-internal-width) (when (looking-at " $") commit cbb6f138e661b11e03885f00041e6442ed12a6a5 Author: Lars Magne Ingebrigtsen Date: Wed Feb 11 14:34:21 2015 +1100 shr space widths fixup * lisp/net/shr.el (shr-insert): Make sure the space inserted has the right font (for width). diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eee6744..7274c9d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-02-11 Lars Ingebrigtsen + + * net/shr.el (shr-insert): Make sure the space inserted has the + right font (for width). + 2015-02-10 Lars Ingebrigtsen * net/shr.el (shr-use-fonts): New variable. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index a65f792..a432085 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -494,31 +494,32 @@ size, and full-buffer size." ((eq shr-folding-mode 'none) (insert text)) (t - (when (and (string-match "\\`[ \t\n\r ]" text) - (not (bolp)) - (not (eq (char-after (1- (point))) ? ))) - (insert " ")) - (let ((start (point)) - (bolp (bolp))) - (insert text) - (save-restriction - (narrow-to-region start (point)) - (goto-char start) - (when (looking-at "[ \t\n\r ]+") - (replace-match "" t t)) - (while (re-search-forward "[ \t\n\r ]+" nil t) - (replace-match " " t t)) - (goto-char (point-max))) - ;; We may have removed everything we inserted if if was just - ;; spaces. - (unless (= start (point)) - ;; Mark all lines that should possibly be folded afterwards. - (when bolp - (shr-mark-fill start)) - (when shr-use-fonts - (put-text-property start (point) - 'face - (or shr-current-font 'variable-pitch)))))))) + (let ((font-start (point))) + (when (and (string-match "\\`[ \t\n\r ]" text) + (not (bolp)) + (not (eq (char-after (1- (point))) ? ))) + (insert " ")) + (let ((start (point)) + (bolp (bolp))) + (insert text) + (save-restriction + (narrow-to-region start (point)) + (goto-char start) + (when (looking-at "[ \t\n\r ]+") + (replace-match "" t t)) + (while (re-search-forward "[ \t\n\r ]+" nil t) + (replace-match " " t t)) + (goto-char (point-max))) + ;; We may have removed everything we inserted if if was just + ;; spaces. + (unless (= font-start (point)) + ;; Mark all lines that should possibly be folded afterwards. + (when bolp + (shr-mark-fill start)) + (when shr-use-fonts + (put-text-property font-start (point) + 'face + (or shr-current-font 'variable-pitch))))))))) (defun shr-fill-lines (start end) (if (<= shr-internal-width 0) commit ecf8c30bd69f4e659229ace88ac201cc4c647cae Author: Glenn Morris Date: Tue Feb 10 15:01:13 2015 -0500 * package-test.el (package-test-signed): More informative failure messages Not that anyone appears to read them. diff --git a/test/ChangeLog b/test/ChangeLog index ff02bd6..74fc7ce 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,15 +1,17 @@ +2015-02-10 Glenn Morris + + * automated/package-test.el (package-test-signed): + More informative failure messages. + 2015-02-07 Fabián Ezequiel Gallina - * automated/python-tests.el - (python-eldoc--get-symbol-at-point-1) + * automated/python-tests.el (python-eldoc--get-symbol-at-point-1) (python-eldoc--get-symbol-at-point-2) (python-eldoc--get-symbol-at-point-3) (python-eldoc--get-symbol-at-point-4): New tests. -2015-02-07 Fabián Ezequiel Gallina - - * automated/python-tests.el - (python-tests-visible-string): New function. + * automated/python-tests.el (python-tests-visible-string): + New function. (python-parens-electric-indent-1) (python-triple-quote-pairing): Fix indentation, move require calls. (python-hideshow-hide-levels-1) diff --git a/test/automated/package-test.el b/test/automated/package-test.el index 7d2a343..5da3c36 100644 --- a/test/automated/package-test.el +++ b/test/automated/package-test.el @@ -419,13 +419,17 @@ Must called from within a `tar-mode' buffer." ;; Check if the installed package status is updated. (let ((buf (package-list-packages))) (package-menu-refresh) - (should (re-search-forward "^\\s-+signed-good\\s-+1\\.0\\s-+installed" - nil t))) + (should (re-search-forward + "^\\s-+signed-good\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-" + nil t)) + (should (string-equal (match-string-no-properties 1) "1.0")) + (should (string-equal (match-string-no-properties 2) "installed"))) ;; Check if the package description is updated. (with-fake-help-buffer (describe-package 'signed-good) (goto-char (point-min)) - (should (search-forward "signed-good is an installed package." nil t)) + (should (re-search-forward "signed-good is an? \\(\\S-+\\) package." nil t)) + (should (string-equal (match-string-no-properties 1) "installed")) (should (search-forward "Status: Installed in `~/signed-good-1.0/'." nil t))))))