From f4acd7a924fbb6400130e5091ea37e50e2d0fac2 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 7 Nov 2020 09:20:14 +0100 Subject: [PATCH 1/5] Split windows evenly when 'min-margins' parameter was set (Bug#44483) * lisp/window.el (split-window): Make new window inherit any 'min-margins' parameter from WINDOW so that horizontal splits reliably produce windows of same width (Bug#44483). --- lisp/window.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index 48005fc93e0..ba56dedf046 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5412,7 +5412,13 @@ frame. The selected window is not changed by this function." (set-window-parameter (window-parent new) 'window-atom t)) (set-window-parameter new 'window-atom t))) - ;; Sanitize sizes unless SIZE was specified. + ;; Make the new window inherit the `min-margins' parameter of + ;; WINDOW (Bug#44483). + (let ((min-margins (window-parameter window 'min-margins))) + (when min-margins + (set-window-parameter new 'min-margins min-margins))) + + ;; Sanitize sizes unless SIZE was specified. (unless size (window--sanitize-window-sizes horizontal)) From a6fcba783e48a232fe8c60e6fb4803334dabddcc Mon Sep 17 00:00:00 2001 From: Earl Hyatt Date: Wed, 4 Nov 2020 07:26:06 -0500 Subject: [PATCH 2/5] Fix documentation of 'windmove-swap-states-default-keybindings' * doc/emacs/windows.texi (Window Convenience): Fix description of 'windmove-swap-states-default-keybindings' and related index entry. (Bug#44441) --- doc/emacs/windows.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 4c67660b92d..d2bac51a7b2 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -579,7 +579,7 @@ buffer. @xref{Follow Mode}. @findex windmove-default-keybindings @findex windmove-display-default-keybindings @findex windmove-delete-default-keybindings -@findex windmove-swap-states-in-direction +@findex windmove-swap-states-default-keybindings The Windmove package defines commands for moving directionally between neighboring windows in a frame. @kbd{M-x windmove-right} selects the window immediately to the right of the currently selected @@ -593,7 +593,7 @@ keybindings for commands that specify in what direction to display the window for the buffer that the next command is going to display. Also there is @w{@kbd{M-x windmove-delete-default-keybindings}} to define keybindings for commands that delete windows directionally, and -@w{@kbd{M-x windmove-swap-states-in-direction}} that define +@w{@kbd{M-x windmove-swap-states-default-keybindings}} that defines keybindings for commands that swap the window contents of the selected window with the window in the specified direction. From 9da0f4026c62ac917e84780a27a00eefc0f1c0c6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Nov 2020 11:10:36 +0200 Subject: [PATCH 3/5] * lisp/subr.el (read-char-from-minibuffer): Doc fix. (Bug#44451) --- lisp/subr.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 2b3231b879b..fcbd06a449f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2712,12 +2712,14 @@ Also discard all previous input in the minibuffer." (defvar empty-history) (defun read-char-from-minibuffer (prompt &optional chars history) - "Read a character from the minibuffer, prompting for PROMPT. + "Read a character from the minibuffer, prompting for it with PROMPT. Like `read-char', but uses the minibuffer to read and return a character. -When CHARS is non-nil, any input that is not one of CHARS is ignored. -When HISTORY is a symbol, then allows navigating in a history. -The navigation commands are `M-p' and `M-n', with `RET' to select -a character from history." +Optional argument CHARS, if non-nil, should be a list of characters; +the function will ignore any input that is not one of CHARS. +Optional argument HISTORY, if non-nil, should be a symbol that +specifies the history list variable to use for navigating in input +history using `M-p' and `M-n', with `RET' to select a character from +history." (let* ((empty-history '()) (map (if (consp chars) (or (gethash chars read-char-from-minibuffer-map-hash) From d4242177daaee9078245570125c5a99e65f55163 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Nov 2020 11:19:44 +0200 Subject: [PATCH 4/5] Fix 'send-string-to-terminal' writing very long strings * src/dispnew.c (Fsend_string_to_terminal): Prevent partial writes by blocking SIGIO while 'fwrite' runs. (Bug#44320) --- src/dispnew.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dispnew.c b/src/dispnew.c index 5b6fa51a563..df55b32c718 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5904,8 +5904,12 @@ when TERMINAL is nil. */) } out = tty->output; } + /* STRING might be very long, in which case fwrite could be + interrupted by SIGIO. So we temporarily block SIGIO. */ + unrequest_sigio (); fwrite (SDATA (string), 1, SBYTES (string), out); fflush (out); + request_sigio (); unblock_input (); return Qnil; } From f5d7fb3a2dee3f9ae49151e3d01483aad7fb734b Mon Sep 17 00:00:00 2001 From: Kazuhiro Ito Date: Thu, 5 Nov 2020 19:48:08 +0900 Subject: [PATCH 5/5] Fix 'uudecode-decode-region-internal' in multibyte buffers * lisp/mail/uudecode.el (uudecode-decode-region-internal): Fix inserting the decoded string into a multibyte buffer. Optimize by working with characters, not strings. (Bug#44411) Copyright-paperwork-exempt: yes --- lisp/mail/uudecode.el | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el index 9423275b2e5..8bcb3925a9b 100644 --- a/lisp/mail/uudecode.el +++ b/lisp/mail/uudecode.el @@ -162,12 +162,10 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (setq counter (1+ counter) inputpos (1+ inputpos)) (cond ((= counter 4) - (setq result (cons - (concat - (char-to-string (ash bits -16)) - (char-to-string (logand (ash bits -8) 255)) - (char-to-string (logand bits 255))) - result)) + (setq result (cons (logand bits 255) + (cons (logand (ash bits -8) 255) + (cons (ash bits -16) + result)))) (setq bits 0 counter 0)) (t (setq bits (ash bits 6))))))) (cond @@ -179,26 +177,26 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." ;;(error "uucode ends unexpectedly") (setq done t)) ((= counter 3) - (setq result (cons - (concat - (char-to-string (logand (ash bits -16) 255)) - (char-to-string (logand (ash bits -8) 255))) - result))) + (setq result (cons (logand (ash bits -8) 255) + (cons (logand (ash bits -16) 255) + result)))) ((= counter 2) - (setq result (cons - (char-to-string (logand (ash bits -10) 255)) - result)))) + (setq result (cons (logand (ash bits -10) 255) + result)))) (skip-chars-forward non-data-chars end)) (if file-name (with-temp-file file-name (set-buffer-multibyte nil) - (insert (apply #'concat (nreverse result)))) + (apply #'insert (nreverse result))) (or (markerp end) (setq end (set-marker (make-marker) end))) (goto-char start) - (if enable-multibyte-characters - (dolist (x (nreverse result)) - (insert (decode-coding-string x 'binary))) - (insert (apply #'concat (nreverse result)))) + (apply #'insert + (nreverse + (if enable-multibyte-characters + (mapcar (lambda (ch) + (or (decode-char 'eight-bit ch) ch)) + result) + result))) (delete-region (point) end)))))) ;;;###autoload