commit 83a4e4c2a92aa7bcfc7419469b1153f100fe019f (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Tue Sep 22 23:55:45 2020 -0400 test/src/xdisp-tests.el: New file diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el new file mode 100644 index 0000000000..3d0d0f5830 --- /dev/null +++ b/test/src/xdisp-tests.el @@ -0,0 +1,52 @@ +;;; xdisp-tests.el --- tests for xdisp.c functions -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) + +(ert-deftest xdisp-tests--minibuffer-resizing () ;; bug#43519 + ;; FIXME: This test returns success when run in batch but + ;; it's only a lucky accident: it also returned success + ;; when bug#43519 was not fixed. + (should + (equal + t + (catch 'result + (minibuffer-with-setup-hook + (lambda () + (insert "hello") + (let ((ol (make-overlay (point) (point))) + (max-mini-window-height 1) + (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh")) + ;; (save-excursion (insert text)) + ;; (sit-for 2) + ;; (delete-region (point) (point-max)) + (put-text-property 0 1 'cursor t text) + (overlay-put ol 'after-string text) + (redisplay 'force) + (throw 'result + ;; Make sure we do the see "hello" text. + (prog1 (equal (window-start) (point-min)) + ;; (list (window-start) (window-end) (window-width)) + (delete-overlay ol))))) + (let ((executing-kbd-macro t)) ;Force real minibuffer in `read-string'. + (read-string "toto: "))))))) + +;;; xdisp-tests.el ends here commit 8af6b01d10308d7d90d6cc87dc9416afa654ff3b Author: Andrew G Cohen Date: Wed Sep 23 08:25:56 2020 +0800 Use gnus-extra-headers in nnselect header parsing * lisp/gnus/nnselect.el (nnselect-retrieve-headers): Bind nnmail-extra-headers to gnus-extra-headers before parsing retrieved headers. diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 94dd93b354..9bff9fdd0c 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -328,11 +328,12 @@ If this variable is nil, or if the provided function returns nil, (nnheader-parse-nov)) (forward-line 1))) ('headers - (goto-char (point-min)) - (while (not (eobp)) - (nnselect-add-novitem - (nnheader-parse-head)) - (forward-line 1))) + (let ((nnmail-extra-headers gnus-extra-headers)) + (goto-char (point-min)) + (while (not (eobp)) + (nnselect-add-novitem + (nnheader-parse-head)) + (forward-line 1)))) ((pred listp) (dolist (novitem gnus-headers-retrieved-by) (nnselect-add-novitem novitem))) commit 44bb59f79e7ea7928b12a1f3eb8b5ada0265c1d0 Author: Lars Ingebrigtsen Date: Tue Sep 22 17:32:51 2020 +0200 Ensure that the game directory exists before trying to write to it * lisp/play/gamegrid.el (gamegrid-add-score-insecure): Make the directory if it doesn't exist (bug#37836). diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index 9b74eb913e..74e6c2d034 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -635,6 +635,8 @@ FILE is created there." (save-excursion (setq file (expand-file-name file (or directory temporary-file-directory))) + (unless (file-exists-p (file-name-directory file)) + (make-directory (file-name-directory file) t)) (find-file-other-window file) (setq buffer-read-only nil) (goto-char (point-max)) commit 10696d0ac51b9a92359ab7cb2c2e0a28d186dd52 Author: martin rudalics Date: Tue Sep 22 16:44:15 2020 +0200 Make delete-pair only delete pairs that are part of insert-pair-alist * lisp/emacs-lisp/lisp.el (delete-pair): Only delete pairs that are part of `insert-pair-alist' (bug#4136). diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 8c18557c79..ac4ba78897 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -735,12 +735,37 @@ This command assumes point is not in a string or comment." (insert-pair arg ?\( ?\))) (defun delete-pair (&optional arg) - "Delete a pair of characters enclosing ARG sexps following point. -A negative ARG deletes a pair of characters around preceding ARG sexps." - (interactive "p") - (unless arg (setq arg 1)) - (save-excursion (forward-sexp arg) (delete-char (if (> arg 0) -1 1))) - (delete-char (if (> arg 0) 1 -1))) + "Delete a pair of characters enclosing ARG sexps that follow point. +A negative ARG deletes a pair around the preceding ARG sexps instead." + (interactive "P") + (if arg + (setq arg (prefix-numeric-value arg)) + (setq arg 1)) + (if (< arg 0) + (save-excursion + (skip-chars-backward " \t") + (save-excursion + (let ((close-char (char-before))) + (forward-sexp arg) + (unless (member (list (char-after) close-char) + (mapcar (lambda (p) + (if (= (length p) 3) (cdr p) p)) + insert-pair-alist)) + (error "Not after matching pair")) + (delete-char 1))) + (delete-char -1)) + (save-excursion + (skip-chars-forward " \t") + (save-excursion + (let ((open-char (char-after))) + (forward-sexp arg) + (unless (member (list open-char (char-before)) + (mapcar (lambda (p) + (if (= (length p) 3) (cdr p) p)) + insert-pair-alist)) + (error "Not before matching pair")) + (delete-char -1))) + (delete-char 1)))) (defun raise-sexp (&optional arg) "Raise ARG sexps higher up the tree." diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el index a2b8304c96..1476574552 100644 --- a/test/lisp/emacs-lisp/lisp-tests.el +++ b/test/lisp/emacs-lisp/lisp-tests.el @@ -136,8 +136,7 @@ (text-mode) (insert "\"foo\"") (goto-char (point-min)) - (delete-pair) - (should (string-equal "fo\"" (buffer-string))))) + (should-error (delete-pair)))) (ert-deftest lisp-delete-pair-quotes-text-mode-syntax-table () "Test \\[delete-pair] with modified Text Mode syntax for #15014." commit 73f77558ccd5f0d83af294676eedfce3aa1bb4cb Author: Lars Ingebrigtsen Date: Tue Sep 22 16:20:05 2020 +0200 Fix off-by-one error in eldoc--handle-docs * lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): We have one extra line to use if we don't show the truncation message (bug#43543). diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 8fc8db6222..9e38e5908e 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -510,6 +510,10 @@ Honor most of `eldoc-echo-area-use-multiline-p'." (> (+ (length single-doc) (length single-doc-sym) 2) width)) single-doc) ((> available 1) + ;; The message takes one extra line, so if we don't + ;; display that, we have one extra line to use. + (unless eldoc-display-truncation-message + (setq available (1+ available))) (with-current-buffer (eldoc-doc-buffer) (cl-loop initially commit 096f5956be3091ac222db8a15b378a9aeb237352 Author: Lars Ingebrigtsen Date: Tue Sep 22 16:02:37 2020 +0200 Speed up shr-insert slightly * lisp/net/shr.el (shr-insert): Speed up regularising spaces -- the vast majority of the spaces are already OK, so transforming " " to " " just takes time. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index efa1dba953..88e691752a 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -678,8 +678,11 @@ size, and full-buffer size." (goto-char start) (when (looking-at "[ \t\n\r]+") (replace-match "" t t)) - (while (re-search-forward "[ \t\n\r]+" nil t) + (while (re-search-forward "[\t\n\r]+" nil t) (replace-match " " t t)) + (goto-char start) + (while (re-search-forward " +" nil t) + (replace-match " " t t)) (shr--translate-insertion-chars) (goto-char (point-max))) ;; We may have removed everything we inserted if it was just commit 69b5d5431157fdb6e83ca94b9e48cef0586ec902 Author: Lars Ingebrigtsen Date: Tue Sep 22 15:10:30 2020 +0200 Fix filling problem in shr due to zero-width id tagging * lisp/net/shr.el (shr-descend): Fix problem with filling lines that have a zero-width ID tag at the start. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index dcb64155d4..efa1dba953 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -555,7 +555,10 @@ size, and full-buffer size." ;; If the element was empty, we don't have anything to put the ;; anchor on. So just insert a dummy character. (when (= start (point)) - (insert ? ) + (if (not (bolp)) + (insert ? ) + (insert ? ) + (shr-mark-fill start)) (put-text-property (1- (point)) (point) 'display "")) (put-text-property start (1+ start) 'shr-target-id id)) ;; If style is set, then this node has set the color. commit de6844b62468258b3dc89ba40fc63480dc4d854c Author: Eli Zaretskii Date: Tue Sep 22 16:52:18 2020 +0300 Fix cursor display in mini-window under icomplete-mode * src/xdisp.c (resize_mini_window): When we show only part of the mini-window's contents, make sure the window-start position is at the beginning of a screen line. (Bug#43519) diff --git a/src/xdisp.c b/src/xdisp.c index ac5307f4ac..8fadff972f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11809,6 +11809,16 @@ resize_mini_window (struct window *w, bool exact_p) height = (max_height / unit) * unit; init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID); move_it_vertically_backward (&it, height - unit); + /* The following move is usually a no-op when the stuff + displayed in the mini-window comes entirely from buffer + text, but it is needed when some of it comes from overlay + strings, especially when there's an after-string at ZV. + This happens with some completion packages, like + icomplete, ido-vertical, etc. With those packages, if we + don't force w->start to be at the beginning of a screen + line, important parts of the stuff in the mini-window, + such as user prompt, will be hidden from view. */ + move_it_by_lines (&it, 0); start = it.current.pos; } else commit c5c29a9f0f60321304125a1f3b991ce724d868cc Author: David Reitter Date: Tue Sep 22 13:38:16 2020 +0100 Fix font-panel on NS (bug#43480) * lisp/term/ns-win.el (ns-respond-to-change-font): Set the font using customize. diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 6acf6cd199..dd0a986572 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -632,15 +632,21 @@ This function has been overloaded in Nextstep.") (defvar ns-input-fontsize) (defun ns-respond-to-change-font () - "Respond to changeFont: event, expecting `ns-input-font' and\n\ -`ns-input-fontsize' of new font." + "Set the font chosen in the font-picker panel. +Respond to changeFont: event, expecting ns-input-font and +ns-input-fontsize of new font." (interactive) - (modify-frame-parameters (selected-frame) - (list (cons 'fontsize ns-input-fontsize))) - (modify-frame-parameters (selected-frame) - (list (cons 'font ns-input-font))) - (set-frame-font ns-input-font)) - + (let ((face 'default)) + (set-face-attribute face t + :family ns-input-font + :height (* 10 ns-input-fontsize)) + (set-face-attribute face (selected-frame) + :family ns-input-font + :height (* 10 ns-input-fontsize)) + (let ((spec (list (list t (face-attr-construct 'default))))) + (put face 'customized-face spec) + (custom-push-theme 'theme-face face 'user 'set spec) + (put face 'face-modified nil)))) ;; Default fontset for macOS. This is mainly here to show how a fontset ;; can be set up manually. Ordinarily, fontsets are auto-created whenever commit 11a1c8b62fc3e82a6c7085ea70720b1f685662f9 Author: Stefan Kangas Date: Tue Sep 22 13:40:40 2020 +0200 Remove broken compat code from EDE * lisp/cedet/ede/detect.el: Remove broken Emacs 24.1 compat code. This would never have worked, since the fallback library is missing. diff --git a/lisp/cedet/ede/detect.el b/lisp/cedet/ede/detect.el index b870624f9a..f1152fd353 100644 --- a/lisp/cedet/ede/detect.el +++ b/lisp/cedet/ede/detect.el @@ -35,16 +35,6 @@ (require 'ede/auto) ;; Autoload settings. -(when (or (<= emacs-major-version 23) - ;; predicate as name added in Emacs 24.2 - (and (= emacs-major-version 24) - (< emacs-minor-version 2))) - (message "Loading CEDET fallback autoload library.") - (require 'cedet/dominate - (expand-file-name "../../../etc/fallback-libraries/dominate.el" - (file-name-directory load-file-name)))) - - ;;; BASIC PROJECT SCAN ;; (defun ede--detect-stop-scan-p (dir) commit 3376b08c2e17a9034a4951b20939d99022ee0208 Author: Mattias EngdegÄrd Date: Tue Sep 22 12:32:12 2020 +0200 ; * test/lisp/progmodes/ps-mode-tests.el: Add missing backslash diff --git a/test/lisp/progmodes/ps-mode-tests.el b/test/lisp/progmodes/ps-mode-tests.el index eedf3f7009..61cf4c6251 100644 --- a/test/lisp/progmodes/ps-mode-tests.el +++ b/test/lisp/progmodes/ps-mode-tests.el @@ -54,7 +54,7 @@ < 23 > %hex string <~a>a%a~> %base85 string (%)s -(sf\(g>a)sdg) +(sf\\(g>a)sdg) /foo { <<