From d6542ea0f032d154da5a6e896a860adc9176a00a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 16 Nov 2018 21:52:34 +0200 Subject: [PATCH 1/9] Avoid errors in zone.el when there's overlay at EOB * lisp/play/zone.el (zone): Make sure the window-end position is calculated accurately, to avoid errors from buffer-substring. (Bug#33384) --- lisp/play/zone.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/play/zone.el b/lisp/play/zone.el index 4584d26f385..75f13646190 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el @@ -109,7 +109,7 @@ If the element is a function or a list of a function and a number, (save-window-excursion (let ((f (selected-frame)) (outbuf (get-buffer-create "*zone*")) - (text (buffer-substring (window-start) (window-end))) + (text (buffer-substring (window-start) (window-end nil t))) (wp (1+ (- (window-point) (window-start))))) (put 'zone 'orig-buffer (current-buffer)) From 88762b4063a42a69234bda74b1626b646734715a Mon Sep 17 00:00:00 2001 From: Gary Fredericks Date: Sun, 18 Nov 2018 09:15:00 +0100 Subject: [PATCH 2/9] Run 'window--adjust-process-windows' when frame size changes (Bug#32720) * lisp/window.el (window-size-change-functions): Run 'window--adjust-process-windows' from 'window-size-change-functions' too (Bug#32720, "another issue" in Bug#33230). Copyright-paperwork-exempt: yes --- lisp/window.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/window.el b/lisp/window.el index 92cd8c27380..94ac65cfc5b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9288,6 +9288,8 @@ displaying that processes's buffer." (set-process-window-size process (cdr size) (car size)))))))))) (add-hook 'window-configuration-change-hook 'window--adjust-process-windows) +(add-hook 'window-size-change-functions (lambda (_frame) + (window--adjust-process-windows))) ;; Some of these are in tutorial--default-keys, so update that if you From 72525076996cd709086b1afb47ab0d095322e9b7 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sun, 18 Nov 2018 09:24:10 +0100 Subject: [PATCH 3/9] Fix description of some window hooks * doc/lispref/windows.texi (Window Hooks): Remove text that warns against using 'save-window-excursion' while running 'window-size-change-functions', it's no more relevant. Clarify description of 'window-configuration-change-hook'. --- doc/lispref/windows.texi | 32 +++++++++++++++----------------- lisp/window.el | 7 ++++++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index e9bd0c7d83e..46f106838a5 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6016,26 +6016,24 @@ whether a specific window has changed size, compare the return values of @code{window-pixel-height} for that window (@pxref{Window Sizes}). These function are usually only called when at least one window was -added or has changed size since the last time this hook was run for the -associated frame. In some rare cases this hook also runs when a window -that was added intermittently has been deleted afterwards. In these -cases none of the windows on the frame will appear to have changed its -size. - -You may use @code{save-selected-window} in these functions -(@pxref{Selecting Windows}). However, do not use -@code{save-window-excursion} (@pxref{Window Configurations}); exiting -that macro counts as a size change, which would cause these functions to -be called again. +added or has changed size since the last time this hook was run for +the associated frame. In some rare cases this hook also runs when a +window that was added intermittently has been deleted afterwards. In +these cases none of the windows on the frame will appear to have +changed its size. @end defvar @defvar window-configuration-change-hook -A normal hook that is run every time the window configuration of a frame -changes. Window configuration changes include splitting and deleting -windows, and the display of a different buffer in a window. Resizing the -frame or individual windows do not count as configuration changes. Use -@code{window-size-change-functions}, see above, when you want to track -size changes that are not caused by the deletion or creation of windows. +A normal hook that is run every time the window configuration of a +frame changes. Window configuration changes include splitting and +deleting windows, and the display of a different buffer in a window. + +The hook can be also used for tracking changes of window sizes. It +is, however, not run when the size of a frame changes or automatic +resizing of a minibuffer window (@pxref{Minibuffer Windows}) changes +the size of another window. As a rule, adding a function to +@code{window-size-change-functions}, see above, is the recommended way +for reliably tracking size changes of any window. The buffer-local value of this hook is run once for each window on the affected frame, with the relevant window selected and its buffer diff --git a/lisp/window.el b/lisp/window.el index 94ac65cfc5b..f252b0e041a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9287,10 +9287,15 @@ displaying that processes's buffer." (when size (set-process-window-size process (cdr size) (car size)))))))))) +;; Remove the following call in Emacs 27, running +;; 'window-size-change-functions' should suffice. (add-hook 'window-configuration-change-hook 'window--adjust-process-windows) + +;; Catch any size changes not handled by +;; 'window-configuration-change-hook' (Bug#32720, "another issue" in +;; Bug#33230). (add-hook 'window-size-change-functions (lambda (_frame) (window--adjust-process-windows))) - ;; Some of these are in tutorial--default-keys, so update that if you ;; change these. From 195880834db3cf3dad2a1e184cb3fdaccf2dea4d Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Mon, 19 Nov 2018 16:21:41 +0100 Subject: [PATCH 4/9] * etc/AUTHORS: Update. --- etc/AUTHORS | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/AUTHORS b/etc/AUTHORS index 23c88d55909..07cdf0acfcf 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -1658,6 +1658,8 @@ Gary Delp: wrote mailpost.el (public domain) Gary D. Foster: wrote crisp.el scroll-all.el and changed gnus-group.el gnus-topic.el +Gary Fredericks: changed window.el + Gary Howell: changed server.el Gary Oberbrunner: changed gud.el @@ -3124,7 +3126,7 @@ Markus Triska: wrote linum.el and changed bytecomp.el byte-opt.el doctor.el image-mode.el processes.texi calc-math.el emacs.c expand.el flymake.el flymake.texi flyspell.el handwrite.el internals.texi proced.el prolog.el ps-mode.el - speedbar.el subr.el tumme.el widget.texi xterm.c + speedbar.el subr.el tumme.el widget.texi windows.texi xterm.c Mark W. Eichin: changed keyboard.c xterm.c @@ -3584,8 +3586,8 @@ Nicolas Graner: changed message.el Nicolas Petton: wrote map-tests.el map.el seq-tests.el seq.el thunk-tests.el thunk.el and co-wrote auth-source-pass.el auth-source-tests.el subr-tests.el -and changed sequences.texi README configure.ac sed2v2.inp authors.el - emacs.png README.W32 emacs23.png arc-mode.el cl-extra.el emacs.svg +and changed README sequences.texi configure.ac sed2v2.inp authors.el + README.W32 emacs.png emacs23.png arc-mode.el cl-extra.el emacs.svg manoj-dark-theme.el Emacs.icns HISTORY Makefile.in auth-source.el emacs.ico fns.c make-tarball.txt obarray-tests.el obarray.el and 35 other files From 7851ae8b443c62a41ea4f4440512aa56cc87b9b7 Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Mon, 19 Nov 2018 16:22:16 +0100 Subject: [PATCH 5/9] ; ChangeLog.3 update --- ChangeLog.3 | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/ChangeLog.3 b/ChangeLog.3 index 6e1f68fe994..194fa685c91 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -1,3 +1,104 @@ +2018-11-18 Martin Rudalics + + Fix description of some window hooks + + * doc/lispref/windows.texi (Window Hooks): Remove text that + warns against using 'save-window-excursion' while running + 'window-size-change-functions', it's no more relevant. + Clarify description of 'window-configuration-change-hook'. + +2018-11-18 Gary Fredericks (tiny change) + + Run 'window--adjust-process-windows' when frame size changes (Bug#32720) + + * lisp/window.el (window-size-change-functions): Run + 'window--adjust-process-windows' from + 'window-size-change-functions' too (Bug#32720, "another issue" + in Bug#33230). + +2018-11-16 Eli Zaretskii + + Avoid errors in zone.el when there's overlay at EOB + + * lisp/play/zone.el (zone): Make sure the window-end position + is calculated accurately, to avoid errors from + buffer-substring. (Bug#33384) + +2018-11-16 Eli Zaretskii + + Document Emacs 26 behavior of Dired's 'Z' on directories + + * doc/emacs/dired.texi (Operating on Files): Document behavior + of 'Z' on directories. + + * etc/NEWS: Belatedly announce the new behavior of Dired's 'Z' + on directory names and on .tar.gz archives. + +2018-11-15 Eli Zaretskii + + Fix a typo in the Emacs manual + + * doc/emacs/rmail.texi (Rmail Deletion): Fix a typo. + Reported by Jorge P. de Morais Neto + in emacs-manual-bugs@gnu.org + +2018-11-15 Paul Eggert + + Fix tempfile creation when byte compiling + + This improves on the recent fix for master failing to build + on FreeBSD. Suggested by Stefan Monnier in: + https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html + * lisp/emacs-lisp/bytecomp.el (byte-compile-file): + Put tempfile next to the target file, as was the original intent. + + (cherry picked from commit 64c846738617d1d037eac0cefb6586c04317b0a1) + +2018-11-14 Markus Triska + + Small documentation correction. + + * doc/lispref/windows.texi (Textual Scrolling): In the description of + scroll-up-aggressively, refer to scroll-down-aggressively instead of + a recursive reference to scroll-up-aggressively. (Bug#33369) + +2018-11-14 Eli Zaretskii + + * src/coding.c (Fcheck_coding_systems_region): Doc fix. (Bug#33372) + +2018-11-14 Michael Albinus + + Fix Bug#33364 + + * lisp/net/tramp.el (tramp-parse-sconfig-group): Support also + "Host host1 host2 ..." syntax. (Bug#33364) + +2018-11-13 Michael Albinus + + * test/README: Explain $REMOTE_TEMPORARY_FILE_DIRECTORY. + +2018-11-12 Glenn Morris + + Avoid kill-emacs-hook errors hanging batch mode + + * src/emacs.c (Fkill_emacs): Prevent errors from kill-emacs-hook + hanging Emacs in batch mode. (Bug#29955) + + (cherry picked from commit 109da684c5124e22505917fe0255ca66f2a6bfc9) + +2018-11-12 Nicolas Petton + + Bump Emacs version to 26.1.90 + + * README: + * configure.ac: + * msdos/sed2v2.inp: + * nt/README.W32: Bump Emacs version to 26.1.90. + +2018-11-12 Nicolas Petton + + * etc/AUTHORS: Update. + 2018-11-12 Paul Eggert Work around dumping bug on GNU/Linux ppc64le @@ -63347,7 +63448,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit 1d79c2ebd9bd9aa36586e57463502373c0296d11 (inclusive). +commit 72525076996cd709086b1afb47ab0d095322e9b7 (inclusive). See ChangeLog.1 for earlier changes. ;; Local Variables: From df7ed10e4f15d3ea8b4426f7721bafe60bf8deeb Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 19 Nov 2018 18:36:42 +0200 Subject: [PATCH 6/9] Fix decoding XML files encoded in ISO-8859 * lisp/international/mule.el (sgml-xml-auto-coding-function): Avoid signaling an error from coding-system-equal when the XML encoding tag specifies an encoding whose type is 'charset'. (Bug#33429) --- lisp/international/mule.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 14888100020..979845b7233 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -2500,7 +2500,11 @@ This function is intended to be added to `auto-coding-functions'." (let ((sym-type (coding-system-type sym)) (bfcs-type (coding-system-type buffer-file-coding-system))) - (if (and (coding-system-equal 'utf-8 sym-type) + ;; 'charset' will signal an error in + ;; coding-system-equal, since it isn't a + ;; coding-system. So test that up front. + (if (and (not (equal sym-type 'charset)) + (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system sym)) From ea1a0149825048da940365b79948e71cfc366385 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 19 Nov 2018 20:12:04 +0200 Subject: [PATCH 7/9] Fix window scrolling on TTY frames when there's no mode line * src/window.c (window_internal_height): Remove tests for next, prev, and parent pointers, as they are unrelated to whether a window has a mode line. (Bug#33363) --- src/window.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/window.c b/src/window.c index 9026a7b5f2a..9cde2c5ecc4 100644 --- a/src/window.c +++ b/src/window.c @@ -4934,25 +4934,21 @@ window_wants_header_line (struct window *w) : 0); } -/* Return number of lines of text (not counting mode lines) in W. */ +/* Return number of lines of text in window W, not counting the mode + line and header line, if any. Do NOT use this for windows on GUI + frames; use window_body_height instead. This function is only for + windows on TTY frames, where it is much more efficient. */ int window_internal_height (struct window *w) { int ht = w->total_lines; - if (!MINI_WINDOW_P (w)) - { - if (!NILP (w->parent) - || WINDOWP (w->contents) - || !NILP (w->next) - || !NILP (w->prev) - || window_wants_mode_line (w)) - --ht; + if (window_wants_mode_line (w)) + --ht; - if (window_wants_header_line (w)) - --ht; - } + if (window_wants_header_line (w)) + --ht; return ht; } From 60457d7ae0cc560115d3e8c83bb308f015e7088d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 19 Nov 2018 20:31:49 +0200 Subject: [PATCH 8/9] Improve documentation of the window tree * doc/lispref/windows.texi (Windows and Frames): More accurate wording regarding the relation of a mini-window to its frame's window tree. * src/window.h (struct window): Improve commentary to some fields. --- doc/lispref/windows.texi | 13 +++++++------ src/window.h | 12 ++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 46f106838a5..04689f1c5e2 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -198,12 +198,13 @@ relationships between live windows. The root node of a window tree is called the @dfn{root window}. It can be either a live window (if the frame has just one window), or an internal window. - A minibuffer window (@pxref{Minibuffer Windows}) is not part of its -frame's window tree unless the frame is a minibuffer-only frame. -Nonetheless, most of the functions in this section accept the -minibuffer window as an argument. Also, the function -@code{window-tree} described at the end of this section lists the -minibuffer window alongside the actual window tree. + A minibuffer window (@pxref{Minibuffer Windows}) that is not alone +on its frame does not have a parent window, so it strictly speaking is +not part of its frame's window tree. Nonetheless, it is a sibling +window of the frame's root window, and thus can be reached via +@code{window-next-sibling}. Also, the function @code{window-tree} +described at the end of this section lists the minibuffer window +alongside the actual window tree. @defun frame-root-window &optional frame-or-window This function returns the root window for @var{frame-or-window}. The diff --git a/src/window.h b/src/window.h index 629283ac40c..c7f525e2704 100644 --- a/src/window.h +++ b/src/window.h @@ -93,12 +93,14 @@ struct window /* The frame this window is on. */ Lisp_Object frame; - /* Following (to right or down) and preceding (to left or up) child - at same level of tree. */ + /* Following (to right or down) and preceding (to left or up) + child at same level of tree. Whether this is left/right or + up/down is determined by the 'horizontal' flag, see below. + A minibuffer window has the frame's root window pointed by 'prev'. */ Lisp_Object next; Lisp_Object prev; - /* The window this one is a child of. */ + /* The window this one is a child of. For a minibuffer window: nil. */ Lisp_Object parent; /* The normal size of the window. These are fractions, but we do @@ -113,7 +115,9 @@ struct window Lisp_Object new_normal; Lisp_Object new_pixel; - /* May be buffer, window, or nil. */ + /* For a leaf window: a buffer; for an internal window: a window; + for a pseudo-window (such as menu bar or tool bar): nil. It is + a buffer for a minibuffer window as well. */ Lisp_Object contents; /* A marker pointing to where in the text to start displaying. From 070e82b96bfadb5a3622607a8c5c97c127ec62db Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 19 Nov 2018 20:35:28 +0200 Subject: [PATCH 9/9] ; * src/window.c (window_scroll): Improve commentary. --- src/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.c b/src/window.c index 9cde2c5ecc4..5d99098cba1 100644 --- a/src/window.c +++ b/src/window.c @@ -4977,8 +4977,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) if (whole && Vfast_but_imprecise_scrolling) specbind (Qfontification_functions, Qnil); - /* If we must, use the pixel-based version which is much slower than - the line-based one but can handle varying line heights. */ + /* On GUI frames, use the pixel-based version which is much slower + than the line-based one but can handle varying line heights. */ if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) window_scroll_pixel_based (window, n, whole, noerror); else