From 548a5db61160ceb996b0b4fd65d0427143184852 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 19 Oct 2021 18:49:38 +0200 Subject: [PATCH 01/20] ; etc/NEWS fix wording --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index b410ef77cfa..7031be311e6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3224,7 +3224,7 @@ Type 'M-x repeat-mode RET' to enable this mode. You can then type 'C-x u u' instead of 'C-x u C-x u' to undo many changes, 'C-x o o' instead of 'C-x o C-x o' to switch windows, 'C-x { { } } ^ ^ v v' to resize the selected window interactively, 'M-g n n p p' to navigate -next-error matches. Any other key exits transient mode and then is +next-error matches. Any other key exits repeat mode and then is executed normally. 'repeat-exit-key' defines an additional key to exit mode like 'isearch-exit' ('RET'). The user option 'repeat-exit-timeout' specifies the number of seconds of idle time to From d7f595cc89b813b2bc3f2696a39562c64b225cb4 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 19 Oct 2021 18:50:12 +0200 Subject: [PATCH 02/20] Code cleanup in tramp-tests.el * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process) (tramp-test30-make-process): Extend tests. (tramp--test-out-of-band-p): New defun. (tramp--test-windows-nt-and-out-of-band-p) (tramp-test42-utf8-with-stat, tramp-test42-utf8-with-perl) (tramp-test42-utf8-with-ls): Use it. (tramp--test-windows-nt-or-smb-p): Use `tramp--test-windows-nt-p'. --- test/lisp/net/tramp-tests.el | 92 ++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 8c7fc48848b..0ad50144dc8 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4588,23 +4588,25 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Cleanup. (ignore-errors (delete-process proc))) - (unwind-protect - (with-temp-buffer - (setq proc (start-file-process "test3" (current-buffer) "cat")) - (should (processp proc)) - (should (equal (process-status proc) 'run)) - (set-process-filter proc t) - (process-send-string proc "foo\n") - (process-send-eof proc) - ;; Read output. - (with-timeout (10 (tramp--test-timeout-handler)) - (while (process-live-p proc) - (while (accept-process-output proc 0 nil t)))) - ;; No output due to process filter. - (should (= (point-min) (point-max)))) + ;; `telnet' does not cooperate with disabled filter. + (unless (tramp--test-telnet-p) + (unwind-protect + (with-temp-buffer + (setq proc (start-file-process "test3" (current-buffer) "cat")) + (should (processp proc)) + (should (equal (process-status proc) 'run)) + (set-process-filter proc t) + (process-send-string proc "foo\n") + (process-send-eof proc) + ;; Read output. + (with-timeout (10 (tramp--test-timeout-handler)) + (while (process-live-p proc) + (while (accept-process-output proc 0 nil t)))) + ;; No output due to process filter. + (should (= (point-min) (point-max)))) - ;; Cleanup. - (ignore-errors (delete-process proc))) + ;; Cleanup. + (ignore-errors (delete-process proc)))) ;; Process connection type. (when (and (tramp--test-sh-p) @@ -4779,27 +4781,29 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." ;; Cleanup. (ignore-errors (delete-process proc))) - (unwind-protect - (with-temp-buffer - (setq proc - (with-no-warnings - (make-process - :name "test3" :buffer (current-buffer) :command '("cat") - :filter t - :file-handler t))) - (should (processp proc)) - (should (equal (process-status proc) 'run)) - (process-send-string proc "foo\n") - (process-send-eof proc) - ;; Read output. - (with-timeout (10 (tramp--test-timeout-handler)) - (while (process-live-p proc) - (while (accept-process-output proc 0 nil t)))) - ;; No output due to process filter. - (should (= (point-min) (point-max)))) + ;; `telnet' does not cooperate with disabled filter. + (unless (tramp--test-telnet-p) + (unwind-protect + (with-temp-buffer + (setq proc + (with-no-warnings + (make-process + :name "test3" :buffer (current-buffer) :command '("cat") + :filter t + :file-handler t))) + (should (processp proc)) + (should (equal (process-status proc) 'run)) + (process-send-string proc "foo\n") + (process-send-eof proc) + ;; Read output. + (with-timeout (10 (tramp--test-timeout-handler)) + (while (process-live-p proc) + (while (accept-process-output proc 0 nil t)))) + ;; No output due to process filter. + (should (= (point-min) (point-max)))) - ;; Cleanup. - (ignore-errors (delete-process proc))) + ;; Cleanup. + (ignore-errors (delete-process proc)))) ;; Process sentinel. (unwind-protect @@ -6191,6 +6195,10 @@ This does not support external Emacs calls." (string-equal "mock" (file-remote-p tramp-test-temporary-file-directory 'method))) +(defun tramp--test-out-of-band-p () + "Check, whether an out-of-band method is used." + (tramp-method-out-of-band-p tramp-test-vec 1)) + (defun tramp--test-rclone-p () "Check, whether the remote host is offered by rclone. This requires restrictions of file name syntax." @@ -6246,13 +6254,13 @@ This does not support special file names." (defun tramp--test-windows-nt-and-out-of-band-p () "Check, whether the locale host runs MS Windows and an out-of-band method. This does not support utf8 based file transfer." - (and (eq system-type 'windows-nt) - (tramp-method-out-of-band-p tramp-test-vec 1))) + (and (tramp--test-windows-nt-p) + (tramp--test-out-of-band-p))) (defun tramp--test-windows-nt-or-smb-p () "Check, whether the locale or remote host runs MS Windows. This requires restrictions of file name syntax." - (or (eq system-type 'windows-nt) + (or (tramp--test-windows-nt-p) (tramp--test-smb-p))) (defun tramp--test-smb-p () @@ -6662,7 +6670,7 @@ Use the `stat' command." (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-docker-p))) (skip-unless (not (tramp--test-rsync-p))) - (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p))) + (skip-unless (not (tramp--test-out-of-band-p))) ; SLOW (skip-unless (not (tramp--test-ksh-p))) (skip-unless (not (tramp--test-crypt-p))) ;; We cannot use `tramp-test-vec', because this fails during compilation. @@ -6685,7 +6693,7 @@ Use the `perl' command." (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-docker-p))) (skip-unless (not (tramp--test-rsync-p))) - (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p))) + (skip-unless (not (tramp--test-out-of-band-p))) ; SLOW (skip-unless (not (tramp--test-ksh-p))) (skip-unless (not (tramp--test-crypt-p))) ;; We cannot use `tramp-test-vec', because this fails during compilation. @@ -6711,7 +6719,7 @@ Use the `ls' command." (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-docker-p))) (skip-unless (not (tramp--test-rsync-p))) - (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p))) + (skip-unless (not (tramp--test-out-of-band-p))) ; SLOW (skip-unless (not (tramp--test-ksh-p))) (skip-unless (not (tramp--test-crypt-p))) From 5c1a575ef49f3548eb0fa164360b58c1fd28fbb8 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 18 Oct 2021 12:34:38 +0200 Subject: [PATCH 03/20] Don't use color escape sequences in vc-git-expanded-log-entry * lisp/vc/vc-git.el (vc-git-expanded-log-entry): Use '--no-color' flag in git invocation. (Bug#51262) Copyright-paperwork-exempt: yes --- lisp/vc/vc-git.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 35c0838dd6f..3f89fad2351 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1323,7 +1323,7 @@ or BRANCH^ (where \"^\" can be repeated)." (defun vc-git-expanded-log-entry (revision) (with-temp-buffer - (apply #'vc-git-command t nil nil (list "log" revision "-1" "--")) + (apply #'vc-git-command t nil nil (list "log" revision "-1" "--no-color" "--")) (goto-char (point-min)) (unless (eobp) ;; Indent the expanded log entry. From 91d71b38a333c9b3dc411547c1ad61f0ee63d4e6 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 17 Oct 2021 19:30:59 +0100 Subject: [PATCH 04/20] Fix inset rectangle corners when sides aren't drawn (bug#51251) * src/nsterm.m (ns_draw_relief): Make the inner rectangle line up with the outer rectangle's edges where the edges aren't drawn. --- src/nsterm.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index c6f80f80350..aa29c13eb22 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3512,7 +3512,12 @@ ns_draw_relief (NSRect outer, int hthickness, int vthickness, char raised_p, } /* Calculate the inner rectangle. */ - inner = NSInsetRect (outer, hthickness, vthickness); + inner = NSMakeRect (NSMinX (outer) + (left_p ? hthickness : 0), + NSMinY (outer) + (top_p ? vthickness : 0), + NSWidth (outer) - (left_p ? hthickness : 0) + - (right_p ? hthickness : 0), + NSHeight (outer) - (top_p ? vthickness : 0) + - (bottom_p ? vthickness : 0)); [(raised_p ? lightCol : darkCol) set]; From 8e7cd29712996a97a698ac666bdcf2aa8474e464 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 20 Oct 2021 10:05:04 +0200 Subject: [PATCH 05/20] Revert "Revert back to using ESC as viper-ESC-key again" This reverts commit 5d522b430bd5ecfb8f082906cd634883dbb68f3e. The change led to M-x not working in non-gui Emacsen (bug#51253). --- lisp/emulation/viper-keym.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 2bb24f662fc..2f7d17351dc 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -182,7 +182,7 @@ In insert mode, this key also functions as Meta." :type 'string :group 'viper) -(defconst viper-ESC-key (kbd "ESC") +(defconst viper-ESC-key [escape] "Key used to ESC.") From 1bb14f93f128b0e70e84b142d1b9a8ae1532a3ed Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Tue, 19 Oct 2021 16:01:15 -0700 Subject: [PATCH 06/20] Convert ANSI color definitions in themes to use faces (e.g. 'ansi-color-red') * etc/themes/dichromacy-theme.el: * etc/themes/leuven-theme.el: * etc/themes/misterioso-theme.el: * etc/themes/tango-theme.el: * etc/themes/tango-dark-theme.el: * etc/themes/wombat-theme.el: Convert ANSI color definitions to use faces. --- etc/themes/dichromacy-theme.el | 34 +++++++++++++++++++++++++++------ etc/themes/leuven-theme.el | 25 ++++++++++++++++++------ etc/themes/misterioso-theme.el | 33 ++++++++++++++++++++++++++------ etc/themes/tango-dark-theme.el | 35 +++++++++++++++++++++++++++------- etc/themes/tango-theme.el | 35 +++++++++++++++++++++++++++------- etc/themes/wombat-theme.el | 24 +++++++++++++++++------ 6 files changed, 148 insertions(+), 38 deletions(-) diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el index 09f4454f9b1..c59b24bef50 100644 --- a/etc/themes/dichromacy-theme.el +++ b/etc/themes/dichromacy-theme.el @@ -113,12 +113,34 @@ Ansi-Color faces are included.") `(flyspell-duplicate ((,class (:weight unspecified :foreground unspecified :slant unspecified :underline ,orange)))) `(flyspell-incorrect ((,class (:weight unspecified :foreground unspecified - :slant unspecified :underline ,redpurple))))) - - (custom-theme-set-variables - 'dichromacy - `(ansi-color-names-vector ["black" ,vermillion ,bluegreen ,yellow - ,blue ,redpurple ,skyblue "white"]))) + :slant unspecified :underline ,redpurple)))) + ;; ANSI color + `(ansi-color-black ((,class (:background "black" :foreground "black")))) + `(ansi-color-red ((,class (:background ,vermillion + :foreground ,vermillion)))) + `(ansi-color-green ((,class (:background ,bluegreen + :foreground ,bluegreen)))) + `(ansi-color-yellow ((,class (:background ,yellow :foreground ,yellow)))) + `(ansi-color-blue ((,class (:background ,blue :foreground ,blue)))) + `(ansi-color-magenta ((,class (:background ,redpurple + :foreground ,redpurple)))) + `(ansi-color-cyan ((,class (:background ,skyblue :foreground ,skyblue)))) + `(ansi-color-white ((,class (:background "gray90" :foreground "gray90")))) + `(ansi-color-bright-black ((,class (:background "black" + :foreground "black")))) + `(ansi-color-bright-red ((,class (:background ,vermillion + :foreground ,vermillion)))) + `(ansi-color-bright-green ((,class (:background ,bluegreen + :foreground ,bluegreen)))) + `(ansi-color-bright-yellow ((,class (:background ,yellow + :foreground ,yellow)))) + `(ansi-color-bright-blue ((,class (:background ,blue :foreground ,blue)))) + `(ansi-color-bright-magenta ((,class (:background ,redpurple + :foreground ,redpurple)))) + `(ansi-color-bright-cyan ((,class (:background ,skyblue + :foreground ,skyblue)))) + `(ansi-color-bright-white ((,class (:background "gray90" + :foreground "gray90")))))) (provide-theme 'dichromacy) diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el index f643dd560cf..95ec303f706 100644 --- a/etc/themes/leuven-theme.el +++ b/etc/themes/leuven-theme.el @@ -287,6 +287,25 @@ more...") `(message-header-xheader ((,class ,mail-header-other))) `(message-mml ((,class (:foreground "forest green")))) + ;; ANSI colors. + `(ansi-color-bold ((,class (:weight bold)))) + `(ansi-color-black ((,class (:foreground "black" :background "black")))) + `(ansi-color-red ((,class (:foreground "red3" :background "red3")))) + `(ansi-color-green ((,class (:foreground "forest green" :background "forest green")))) + `(ansi-color-yellow ((,class (:foreground "yellow3" :background "yellow3")))) + `(ansi-color-blue ((,class (:foreground "blue" :background "blue")))) + `(ansi-color-magenta ((,class (:foreground "magenta3" :background "magenta3")))) + `(ansi-color-cyan ((,class (:foreground "deep sky blue" :background "deep sky blue")))) + `(ansi-color-white ((,class (:foreground "gray60" :background "gray60")))) + `(ansi-color-bright-black ((,class (:foreground "gray30" :background "gray30")))) + `(ansi-color-bright-red ((,class (:foreground "red1" :background "red1")))) + `(ansi-color-bright-green ((,class (:foreground "lime green" :background "lime green")))) + `(ansi-color-bright-yellow ((,class (:foreground "yellow2" :background "yellow2")))) + `(ansi-color-bright-blue ((,class (:foreground "dodger blue" :background "dodger blue")))) + `(ansi-color-bright-magenta ((,class (:foreground "magenta" :background "magenta")))) + `(ansi-color-bright-cyan ((,class (:foreground "sky blue" :background "sky blue")))) + `(ansi-color-bright-white ((,class (:foreground "gray80" :background "gray80")))) + ;; Diff. `(diff-added ((,class ,diff-added))) `(diff-changed ((,class ,diff-changed))) @@ -1035,12 +1054,6 @@ more...") ;; highlight-sexp-mode. '(hl-sexp-background-color "#efebe9") - '(ansi-color-faces-vector - [default default default italic underline success warning error]) - - ;; Colors used in Shell mode. - '(ansi-color-names-vector - ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"]) ) ;;;###autoload diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el index e7a66c5650d..26a5946d30c 100644 --- a/etc/themes/misterioso-theme.el +++ b/etc/themes/misterioso-theme.el @@ -101,12 +101,33 @@ `(message-header-subject ((,class (:foreground "#dbdb95")))) `(message-header-to ((,class (:foreground "#00ede1")))) `(message-cited-text ((,class (:foreground "#74af68")))) - `(message-separator ((,class (:foreground "#23d7d7")))))) - -(custom-theme-set-variables - 'misterioso - '(ansi-color-names-vector ["#2d3743" "#ff4242" "#74af68" "#dbdb95" - "#34cae2" "#008b8b" "#00ede1" "#e1e1e0"])) + `(message-separator ((,class (:foreground "#23d7d7")))) + ;; ANSI colors + `(ansi-color-black ((,class (:background "#2d3743" :foreground "#2d3743")))) + `(ansi-color-red ((,class (:background "#da3938" :foreground "#da3938")))) + `(ansi-color-green ((,class (:background "#74af68" :foreground "#74af68")))) + `(ansi-color-yellow ((,class (:background "#dbdb95" :foreground "#dbdb95")))) + `(ansi-color-blue ((,class (:background "#34cae2" :foreground "#34cae2")))) + `(ansi-color-magenta ((,class (:background "#b33c97" + :foreground "#b33c97")))) + `(ansi-color-cyan ((,class (:background "#008b8b" :foreground "#008b8b")))) + `(ansi-color-white ((,class (:background "#e1e1e0" :foreground "#e1e1e0")))) + `(ansi-color-bright-black ((,class (:background "#415160" + :foreground "#415160")))) + `(ansi-color-bright-red ((,class (:background "#ff4242" + :foreground "#ff4242")))) + `(ansi-color-bright-green ((,class (:background "#74cd65" + :foreground "#74cd65")))) + `(ansi-color-bright-yellow ((,class (:background "#ffad29" + :foreground "#ffad29")))) + `(ansi-color-bright-blue ((,class (:background "#59e9ff" + :foreground "#59e9ff")))) + `(ansi-color-bright-magenta ((,class (:background "#ed74cd" + :foreground "#ed74cd")))) + `(ansi-color-bright-cyan ((,class (:background "#00ede1" + :foreground "#00ede1")))) + `(ansi-color-bright-white ((,class (:background "#eeeeec" + :foreground "#eeeeec")))))) (provide-theme 'misterioso) diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el index 1a33676eba7..fe4a24746e6 100644 --- a/etc/themes/tango-dark-theme.el +++ b/etc/themes/tango-dark-theme.el @@ -45,7 +45,9 @@ Semantic, and Ansi-Color faces are included.") (alum-4 "#888a85") (alum-5 "#555753") (alum-6 "#2e3436") ;; Not in Tango palette; used for better contrast. (cham-0 "#b4fa70") (blue-0 "#8cc4ff") (plum-0 "#e9b2e3") - (red-0 "#ff4b4b") (alum-5.5 "#41423f") (alum-7 "#212526")) + (red-0 "#ff4b4b") (alum-5.5 "#41423f") (alum-7 "#212526") + ;; Not in Tango palette; used for ANSI cyan. + (cyan-1 "#34e2e2") (cyan-2 "#06989a")) (custom-theme-set-faces 'tango-dark @@ -162,12 +164,31 @@ Semantic, and Ansi-Color faces are included.") `(semantic-decoration-on-unparsed-includes ((,class (:background ,alum-5.5)))) `(semantic-tag-boundary-face ((,class (:overline ,blue-1)))) - `(semantic-unmatched-syntax-face ((,class (:underline ,red-1))))) - - (custom-theme-set-variables - 'tango-dark - `(ansi-color-names-vector [,alum-7 ,red-0 ,cham-0 ,butter-1 - ,blue-1 ,plum-1 ,blue-0 ,alum-1]))) + `(semantic-unmatched-syntax-face ((,class (:underline ,red-1)))) + ;; ANSI colors + `(ansi-color-black ((,class (:background ,alum-7 :foreground ,alum-7)))) + `(ansi-color-red ((,class (:background ,red-1 :foreground ,red-1)))) + `(ansi-color-green ((,class (:background ,cham-2 :foreground ,cham-2)))) + `(ansi-color-yellow ((,class (:background ,butter-2 :foreground ,butter-2)))) + `(ansi-color-blue ((,class (:background ,blue-2 :foreground ,blue-2)))) + `(ansi-color-magenta ((,class (:background ,plum-1 :foreground ,plum-1)))) + `(ansi-color-cyan ((,class (:background ,cyan-2 :foreground ,cyan-2)))) + `(ansi-color-white ((,class (:background ,alum-2 :foreground ,alum-2)))) + `(ansi-color-bright-black ((,class (:background ,alum-5 + :foreground ,alum-5)))) + `(ansi-color-bright-red ((,class (:background ,red-0 :foreground ,red-0)))) + `(ansi-color-bright-green ((,class (:background ,cham-1 + :foreground ,cham-1)))) + `(ansi-color-bright-yellow ((,class (:background ,butter-1 + :foreground ,butter-1)))) + `(ansi-color-bright-blue ((,class (:background ,blue-0 + :foreground ,blue-0)))) + `(ansi-color-bright-magenta ((,class (:background ,plum-0 + :foreground ,plum-0)))) + `(ansi-color-bright-cyan ((,class (:background ,cyan-1 + :foreground ,cyan-1)))) + `(ansi-color-bright-white ((,class (:background ,alum-1 + :foreground ,alum-1)))))) (provide-theme 'tango-dark) diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el index 9ee2619ce24..5c429b0b70c 100644 --- a/etc/themes/tango-theme.el +++ b/etc/themes/tango-theme.el @@ -44,7 +44,9 @@ Semantic, and Ansi-Color faces are included.") (alum-1 "#eeeeec") (alum-2 "#d3d7cf") (alum-3 "#babdb6") (alum-4 "#888a85") (alum-5 "#5f615c") (alum-6 "#2e3436") ;; Not in Tango palette; used for better contrast. - (cham-4 "#346604") (blue-0 "#8cc4ff") (orange-4 "#b35000")) + (cham-4 "#346604") (blue-0 "#8cc4ff") (orange-4 "#b35000") + ;; Not in Tango palette; used for ANSI cyan. + (cyan-1 "#34e2e2") (cyan-2 "#06989a")) (custom-theme-set-faces 'tango @@ -145,12 +147,31 @@ Semantic, and Ansi-Color faces are included.") `(semantic-decoration-on-unparsed-includes ((,class (:underline ,orange-3)))) `(semantic-tag-boundary-face ((,class (:overline ,blue-1)))) - `(semantic-unmatched-syntax-face ((,class (:underline ,red-1))))) - - (custom-theme-set-variables - 'tango - `(ansi-color-names-vector [,alum-6 ,red-3 ,cham-3 ,butter-3 - ,blue-3 ,plum-3 ,blue-1 ,alum-1]))) + `(semantic-unmatched-syntax-face ((,class (:underline ,red-1)))) + ;; ANSI colors + `(ansi-color-black ((,class (:background ,alum-6 :foreground ,alum-6)))) + `(ansi-color-red ((,class (:background ,red-2 :foreground ,red-2)))) + `(ansi-color-green ((,class (:background ,cham-3 :foreground ,cham-3)))) + `(ansi-color-yellow ((,class (:background ,butter-3 :foreground ,butter-3)))) + `(ansi-color-blue ((,class (:background ,blue-2 :foreground ,blue-2)))) + `(ansi-color-magenta ((,class (:background ,plum-2 :foreground ,plum-2)))) + `(ansi-color-cyan ((,class (:background ,cyan-2 :foreground ,cyan-2)))) + `(ansi-color-white ((,class (:background ,alum-2 :foreground ,alum-2)))) + `(ansi-color-bright-black ((,class (:background ,alum-5 + :foreground ,alum-5)))) + `(ansi-color-bright-red ((,class (:background ,red-1 :foreground ,red-1)))) + `(ansi-color-bright-green ((,class (:background ,cham-1 + :foreground ,cham-1)))) + `(ansi-color-bright-yellow ((,class (:background ,butter-1 + :foreground ,butter-1)))) + `(ansi-color-bright-blue ((,class (:background ,blue-1 + :foreground ,blue-1)))) + `(ansi-color-bright-magenta ((,class (:background ,plum-1 + :foreground ,plum-1)))) + `(ansi-color-bright-cyan ((,class (:background ,cyan-1 + :foreground ,cyan-1)))) + `(ansi-color-bright-white ((,class (:background ,alum-1 + :foreground ,alum-1)))))) (provide-theme 'tango) diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el index 922114fb64a..d769c337214 100644 --- a/etc/themes/wombat-theme.el +++ b/etc/themes/wombat-theme.el @@ -95,12 +95,24 @@ are included.") `(message-header-subject ((,class (:foreground "#cae682")))) `(message-header-to ((,class (:foreground "#cae682")))) `(message-cited-text ((,class (:foreground "#99968b")))) - `(message-separator ((,class (:foreground "#e5786d" :weight bold)))))) - -(custom-theme-set-variables - 'wombat - '(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" - "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])) + `(message-separator ((,class (:foreground "#e5786d" :weight bold)))) + ;; ANSI colors + `(ansi-color-black ((,class (:background "#242424" :foreground "#242424")))) + `(ansi-color-red ((,class (:background "#b85149" :foreground "#b85149")))) + `(ansi-color-green ((,class (:background "#92a65e" :foreground "#92a65e")))) + `(ansi-color-yellow ((,class (:background "#ccaa8f" :foreground "#ccaa8f")))) + `(ansi-color-blue ((,class (:background "#5b98c2" :foreground "#5b98c2")))) + `(ansi-color-magenta ((,class (:background "#64619a" :foreground "#64619a")))) + `(ansi-color-cyan ((,class (:background "#3f9f9e" :foreground "#3f9f9e")))) + `(ansi-color-white ((,class (:background "#f6f3e8" :foreground "#f6f3e8")))) + `(ansi-color-bright-black ((,class (:background "#444444" :foreground "#444444")))) + `(ansi-color-bright-red ((,class (:background "#e5786d" :foreground "#e5786d")))) + `(ansi-color-bright-green ((,class (:background "#95e454" :foreground "#95e454")))) + `(ansi-color-bright-yellow ((,class (:background "#edc4a3" :foreground "#edc4a3")))) + `(ansi-color-bright-blue ((,class (:background "#8ac6f2" :foreground "#8ac6f2")))) + `(ansi-color-bright-magenta ((,class (:background "#a6a1de" :foreground "#a6a1de")))) + `(ansi-color-bright-cyan ((,class (:background "#70cecc" :foreground "#70cecc")))) + `(ansi-color-bright-white ((,class (:background "#ffffff" :foreground "#ffffff")))))) (provide-theme 'wombat) From c9160409218bd8d96b8d5180719b77708917e315 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 20 Oct 2021 18:14:00 +0200 Subject: [PATCH 07/20] Adapt Tramp tests * test/lisp/net/tramp-archive-tests.el (tramp-archive-test45-auto-load): Adapt code snippet. * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process) (tramp-test30-make-process): Adapt tests. (tramp--test-supports-set-file-modes-p): Renamed from `tramp--test-supports-file-modes-p'. Adapt all callees. (tramp-test35-exec-path): Use it. --- test/lisp/net/tramp-archive-tests.el | 5 ++- test/lisp/net/tramp-tests.el | 64 ++++++++++++++-------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index aac1b13bd0e..98012f4e909 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -923,9 +923,10 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." "(progn \ (message \"tramp-archive loaded: %%s\" \ (featurep 'tramp-archive)) \ - (file-attributes %S \"/\") \ + (let ((inhibit-message t)) \ + (file-attributes %S \"/\")) \ (message \"tramp-archive loaded: %%s\" \ - (featurep 'tramp-archive)))")) + (featurep 'tramp-archive))))")) (dolist (default-directory `(,temporary-file-directory ;; Starting Emacs in a directory which has diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 0ad50144dc8..d50111d4041 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2786,7 +2786,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." :type 'file-already-exists) (should (file-directory-p tmp-name1)) (should (file-accessible-directory-p tmp-name1)) - (when (tramp--test-supports-file-modes-p) + (when (tramp--test-supports-set-file-modes-p) (should (equal (format "%#o" unusual-file-mode-1) (format "%#o" (file-modes tmp-name1))))) (should-error @@ -2796,7 +2796,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (make-directory tmp-name2 'parents)) (should (file-directory-p tmp-name2)) (should (file-accessible-directory-p tmp-name2)) - (when (tramp--test-supports-file-modes-p) + (when (tramp--test-supports-set-file-modes-p) (should (equal (format "%#o" unusual-file-mode-2) (format "%#o" (file-modes tmp-name2))))) ;; If PARENTS is non-nil, `make-directory' shall not @@ -3160,7 +3160,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (length (directory-files tmp-name1))))))) ;; Check error cases. - (when (and (tramp--test-supports-file-modes-p) + (when (and (tramp--test-supports-set-file-modes-p) ;; With "sshfs", directories with zero file ;; modes are still "accessible". (not (tramp--test-sshfs-p)) @@ -3385,7 +3385,7 @@ This tests also `access-file', `file-readable-p', (tramp-get-remote-gid tramp-test-vec 'integer))) (delete-file tmp-name1)) - (when (and (tramp--test-supports-file-modes-p) + (when (and (tramp--test-supports-set-file-modes-p) ;; A file is always accessible for user "root". (not (zerop (tramp-compat-file-attribute-user-id (file-attributes @@ -3628,7 +3628,8 @@ They might differ only in time attributes or directory size." "Check `file-modes'. This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (skip-unless (tramp--test-enabled)) - (skip-unless (tramp--test-supports-file-modes-p)) + (skip-unless (tramp--test-supports-set-file-modes-p)) + (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted))) @@ -3963,7 +3964,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (make-symbolic-link tmp-name2 tmp-name1) (should (file-symlink-p tmp-name1)) (if (tramp--test-smb-p) - ;; The symlink command of `smbclient' detects the + ;; The symlink command of "smbclient" detects the ;; cycle already. (should-error (make-symbolic-link tmp-name1 tmp-name2) @@ -4074,6 +4075,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (ert-deftest tramp-test24-file-acl () "Check that `file-acl' and `set-file-acl' work proper." (skip-unless (tramp--test-enabled)) + ;; The following test checks also whether `set-file-modes' will work. (skip-unless (file-acl tramp-test-temporary-file-directory)) (skip-unless (not (tramp--test-crypt-p))) @@ -4484,7 +4486,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (write-region "foo" nil tmp-name) (should (file-exists-p tmp-name)) (should (zerop (process-file "ls" nil t nil fnnd))) - ;; `ls' could produce colorized output. + ;; "ls" could produce colorized output. (goto-char (point-min)) (while (re-search-forward tramp-display-escape-sequence-regexp nil t) @@ -4495,7 +4497,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Second run. The output must be appended. (goto-char (point-max)) (should (zerop (process-file "ls" nil t t fnnd))) - ;; `ls' could produce colorized output. + ;; "ls" could produce colorized output. (goto-char (point-min)) (while (re-search-forward tramp-display-escape-sequence-regexp nil t) @@ -4508,7 +4510,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Cleanup. (ignore-errors (delete-file tmp-name)))))) -;; Must be a command, because used as `sigusr' handler. +;; Must be a command, because used as `sigusr1' handler. (defun tramp--test-timeout-handler (&rest _ignore) "Timeout handler, reporting a failed test." (interactive) @@ -4588,8 +4590,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Cleanup. (ignore-errors (delete-process proc))) - ;; `telnet' does not cooperate with disabled filter. - (unless (tramp--test-telnet-p) + ;; "telnet" and "sshfs" do not cooperate with disabled filter. + (unless (or (tramp--test-telnet-p) (tramp--test-sshfs-p)) (unwind-protect (with-temp-buffer (setq proc (start-file-process "test3" (current-buffer) "cat")) @@ -4638,7 +4640,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (if (and (memq process-connection-type '(nil pipe)) (not (tramp--test-macos-p))) ;; On macOS, there is always newline conversion. - ;; `telnet' converts \r to if `crlf' + ;; "telnet" converts \r to if `crlf' ;; flag is FALSE. See telnet(1) man page. "66\n6F\n6F\n0D\\(\n00\\)?\n0A\n" "66\n6F\n6F\n0A\\(\n00\\)?\n0A\n") @@ -4781,8 +4783,8 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." ;; Cleanup. (ignore-errors (delete-process proc))) - ;; `telnet' does not cooperate with disabled filter. - (unless (tramp--test-telnet-p) + ;; "telnet" and "sshfs" do not cooperate with disabled filter. + (unless (or (tramp--test-telnet-p) (tramp--test-sshfs-p)) (unwind-protect (with-temp-buffer (setq proc @@ -4830,7 +4832,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." ;; Cleanup. (ignore-errors (delete-process proc))) - ;; Process with stderr buffer. `telnet' does not cooperate with + ;; Process with stderr buffer. "telnet" does not cooperate with ;; three processes. (unless (or (tramp--test-telnet-p) (tramp-direct-async-process-p)) (let ((stderr (generate-new-buffer "*stderr*"))) @@ -4930,7 +4932,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." '(nil pipe)) (not (tramp--test-macos-p))) ;; On macOS, there is always newline conversion. - ;; `telnet' converts \r to if `crlf' + ;; "telnet" converts \r to if `crlf' ;; flag is FALSE. See telnet(1) man page. "66\n6F\n6F\n0D\\(\n00\\)?\n0A\n" "66\n6F\n6F\n0A\\(\n00\\)?\n0A\n") @@ -5034,7 +5036,7 @@ INPUT, if non-nil, is a string sent to the process." this-shell-command (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) - ;; `ls' could produce colorized output. + ;; "ls" could produce colorized output. (goto-char (point-min)) (while (re-search-forward tramp-display-escape-sequence-regexp nil t) @@ -5489,8 +5491,7 @@ Use direct async.") (ert-deftest tramp-test35-exec-path () "Check `exec-path' and `executable-find'." (skip-unless (tramp--test-enabled)) - (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p))) - (skip-unless (not (tramp--test-crypt-p))) + (skip-unless (tramp--test-supports-set-file-modes-p)) ;; Since Emacs 27.1. (skip-unless (fboundp 'exec-path)) @@ -5511,6 +5512,7 @@ Use direct async.") ;; found. (write-region "foo" nil tmp-name) (should (file-exists-p tmp-name)) + (set-file-modes tmp-name #o777) (should (file-executable-p tmp-name)) (should @@ -6268,8 +6270,8 @@ This requires restrictions of file name syntax." This requires restrictions of file name syntax." (tramp-smb-file-name-p tramp-test-temporary-file-directory)) -(defun tramp--test-supports-file-modes-p () - "Return whether the method under test supports file modes." +(defun tramp--test-supports-set-file-modes-p () + "Return whether the method under test supports setting file modes." ;; "smb" does not unless the SMB server supports "posix" extensions. ;; "adb" does not unless the Android device is rooted. (or (tramp--test-sh-p) (tramp--test-sshfs-p) (tramp--test-sudoedit-p) @@ -6372,9 +6374,9 @@ This requires restrictions of file name syntax." (kill-buffer buffer) ;; `substitute-in-file-name' could return different - ;; values. For `adb', there could be strange file + ;; values. For "adb", there could be strange file ;; permissions preventing overwriting a file. We don't - ;; care in this testcase. + ;; care in this test case. (dolist (elt files) (let ((file1 (substitute-in-file-name (expand-file-name elt tmp-name1))) @@ -6540,7 +6542,7 @@ This requires restrictions of file name syntax." (ert-deftest tramp-test41-special-characters-with-stat () "Check special characters in file names. -Use the `stat' command." +Use the \"stat\" command." :tags '(:expensive-test) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 287s (skip-unless (tramp--test-enabled)) @@ -6559,7 +6561,7 @@ Use the `stat' command." (ert-deftest tramp-test41-special-characters-with-perl () "Check special characters in file names. -Use the `perl' command." +Use the \"perl\" command." :tags '(:expensive-test) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 266s (skip-unless (tramp--test-enabled)) @@ -6581,7 +6583,7 @@ Use the `perl' command." (ert-deftest tramp-test41-special-characters-with-ls () "Check special characters in file names. -Use the `ls' command." +Use the \"ls\" command." :tags '(:expensive-test) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 287s (skip-unless (tramp--test-enabled)) @@ -6663,7 +6665,7 @@ Use the `ls' command." (ert-deftest tramp-test42-utf8-with-stat () "Check UTF8 encoding in file names and file contents. -Use the `stat' command." +Use the \"stat\" command." :tags '(:expensive-test) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 595s (skip-unless (tramp--test-enabled)) @@ -6686,7 +6688,7 @@ Use the `stat' command." (ert-deftest tramp-test42-utf8-with-perl () "Check UTF8 encoding in file names and file contents. -Use the `perl' command." +Use the \"perl\" command." :tags '(:expensive-test) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 620s (skip-unless (tramp--test-enabled)) @@ -6712,7 +6714,7 @@ Use the `perl' command." (ert-deftest tramp-test42-utf8-with-ls () "Check UTF8 encoding in file names and file contents. -Use the `ls' command." +Use the \"ls\" command." :tags '(:expensive-test) (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 690s (skip-unless (tramp--test-enabled)) @@ -7185,8 +7187,8 @@ If INTERACTIVE is non-nil, the tests are run interactively." ;; * Work on skipped tests. Make a comment, when it is impossible. ;; * Revisit expensive tests, once problems in `tramp-error' are solved. -;; * Fix `tramp-test06-directory-file-name' for `ftp'. -;; * Implement `tramp-test31-interrupt-process' for `adb', `sshfs' and +;; * Fix `tramp-test06-directory-file-name' for "ftp". +;; * Implement `tramp-test31-interrupt-process' for "adb", "sshfs" and ;; for direct async processes. ;; * Check, why direct async processes do not work for ;; `tramp-test44-asynchronous-requests'. From 2d647e88faeb53c15d00e2198da480dbd540a4ec Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Wed, 20 Oct 2021 18:22:40 +0200 Subject: [PATCH 08/20] Describe how to debug fontconfig issues * etc/PROBLEMS: Add FC_DEBUG usage pointers. --- etc/PROBLEMS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index f396dc3a000..2d3bc0c9401 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -751,6 +751,18 @@ Try removing or moving aside "$XDG_CONFIG_HOME/fontconfig/conf.d" and "$XDG_CONFIG_HOME/fontconfig/fonts.conf" ($XDG_CONFIG_HOME is treated as "~/.config" if not set) +Running Emacs as + + FC_DEBUG=1024 emacs + +will cause fontconfig to output information about which configuration +files it is reading. Running Emacs as + + FC_DEBUG=1 emacs + +will result in information about the results of fontconfig's font +matching (including the filename(s) of the resulting fonts). + *** This can occur when two different versions of FontConfig are used. For example, XFree86 4.3.0 has one version and Gnome usually comes with a newer version. Emacs compiled with Gtk+ will then use the From cf4394a397827ce7c21e47b872f0cd82408d555e Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Wed, 20 Oct 2021 18:27:36 +0200 Subject: [PATCH 09/20] * etc/PROBLEMS: Add hex codepoint for NO-BREAK SPACE --- etc/PROBLEMS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 2d3bc0c9401..ede83a6e7c0 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -775,7 +775,7 @@ same version of FontConfig as the rest of the system uses. For KDE, it is sufficient to recompile Qt. *** Some fonts have a missing glyph and no default character. This is -known to occur for character number 160 (no-break space) in some +known to occur for character number 160 (no-break space, U+A0) in some fonts, such as Lucida but Emacs sets the display table for the unibyte and Latin-1 version of this character to display a space. From 72365926685089791f97968b63b3632807abbdff Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 20 Oct 2021 16:53:44 +0200 Subject: [PATCH 10/20] Refer to mouse-highlight from make-pointer-invisible docstring * src/frame.c (syms_of_frame) : Doc fix; add reference to 'mouse-highlight'. (Bug#42889) --- src/frame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frame.c b/src/frame.c index f95566818af..2b1cb452efd 100644 --- a/src/frame.c +++ b/src/frame.c @@ -6238,7 +6238,10 @@ when the mouse is over clickable text. */); DEFVAR_LISP ("make-pointer-invisible", Vmake_pointer_invisible, doc: /* If non-nil, make mouse pointer invisible while typing. -The pointer becomes visible again when the mouse is moved. */); +The pointer becomes visible again when the mouse is moved. + +When using this, you might also want to disable highlighting of +clickable text. See `mouse-highlight'. */); Vmake_pointer_invisible = Qt; DEFVAR_LISP ("move-frame-functions", Vmove_frame_functions, From 29fdc65860e95a6e1c74147a3d310878080f6118 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 20 Oct 2021 15:36:59 +0800 Subject: [PATCH 11/20] Fix tab bar item highlight when a mouse click is dropped * src/xdisp.c (note_mouse_highlight): Clear last_tab_bar_item if the movement wasn't made on top of the tab bar. --- src/xdisp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 67946a56b47..97ba6721781 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -33652,6 +33652,14 @@ note_mouse_highlight (struct frame *f, int x, int y) else return; } + else + { + /* The mouse might have pressed into the tab bar, but might + also have been released outside the tab bar, so + f->last_tab_bar_item must be reset, in order to make sure the + item can be still highlighted again in the future. */ + f->last_tab_bar_item = -1; + } #endif #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR) From 8358da9c4c9079b93daffc1aebf3ea5e52b98593 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 20 Oct 2021 15:55:10 +0800 Subject: [PATCH 12/20] Display a tab bar item as sunken when appropriate When the mouse pointer is pressed on the tab bar, moved out of the tab bar, and moved back in, it would be more appropriate to behave like other programs by displaying the item as sunken. * src/xdisp.c (note_tab_bar_highlight): Display item as sunken if the mouse pointer returns to the tab bar down. --- src/xdisp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 97ba6721781..436153b2bae 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13861,12 +13861,17 @@ note_tab_bar_highlight (struct frame *f, int x, int y) bool mouse_down_p = false; #ifndef HAVE_NS - /* Mouse is down, but on different tab-bar item? */ + /* Mouse is down, but on different tab-bar item? Or alternatively, + the mouse might've been pressed somewhere we don't know about, + and then have moved onto the tab bar. In this case, + last_tab_bar_item is -1, so we DTRT and behave like other + programs by displaying the item as sunken. */ Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); mouse_down_p = (gui_mouse_grabbed (dpyinfo) && f == dpyinfo->last_mouse_frame); - if (mouse_down_p && f->last_tab_bar_item != prop_idx) + if (mouse_down_p && f->last_tab_bar_item != prop_idx + && f->last_tab_bar_item != -1) return; #endif draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; From 06fe499614dcb3e13ee795b5aa80ebc8687f2fe2 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 20 Oct 2021 19:50:29 +0300 Subject: [PATCH 13/20] * lisp/tab-bar.el (tab-bar-menu-bar): New command (bug#51247). (tab-bar-format): Rename option 'tab-bar-format-menu-global' to 'tab-bar-format-menu-bar'. (tab-bar-format-menu-bar): Rename from 'tab-bar-format-menu-global'. --- lisp/tab-bar.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 03556919b20..a3316bf4496 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -715,7 +715,7 @@ it will display time aligned to the right on the tab bar instead of the mode line. Replacing `tab-bar-format-tabs' with `tab-bar-format-tabs-groups' will group tabs on the tab bar." :type 'hook - :options '(tab-bar-format-menu-global + :options '(tab-bar-format-menu-bar tab-bar-format-history tab-bar-format-tabs tab-bar-format-tabs-groups @@ -730,22 +730,23 @@ of the mode line. Replacing `tab-bar-format-tabs' with :group 'tab-bar :version "28.1") -(defun tab-bar-format-menu-global () - "Produce the Menu button for the tab bar that shows a global menu." - `((add-tab menu-item (propertize "Menu" 'face 'tab-bar-tab-inactive) - (lambda (event) (interactive "e") - (let ((menu (make-sparse-keymap - (propertize "Global Menu" 'hide t)))) +(defun tab-bar-menu-bar (event) + "Pop up the same menu as displayed by the menu bar. +Used by `tab-bar-format-menu-bar'." + (interactive "e") + (let ((menu (make-sparse-keymap (propertize "Menu Bar" 'hide t)))) + (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) + (map-keymap (lambda (key binding) + (when (consp binding) + (define-key-after menu (vector key) + (copy-sequence binding)))) + (menu-bar-keymap)) + (popup-menu menu event))) - (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (map-keymap (lambda (key binding) - (when (consp binding) - (define-key-after menu (vector key) - (copy-sequence binding)))) - (lookup-key global-map [menu-bar])) - - (popup-menu menu event))) - :help "Global Menu"))) +(defun tab-bar-format-menu-bar () + "Produce the Menu button for the tab bar that shows the menu bar." + `((menu-bar menu-item (propertize "Menu" 'face 'tab-bar-tab-inactive) + tab-bar-menu-bar :help "Menu Bar"))) (defun tab-bar-format-history () "Produce back and forward buttons for the tab bar. From cb8b12b56d174e1a7b6e940debb8a9467285ab9e Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 20 Oct 2021 20:16:57 +0300 Subject: [PATCH 14/20] Improve docstrings and NEWS item of 'repeat-mode' * lisp/repeat.el (repeat-exit-timeout, repeat-echo-function) (repeat-in-progress, repeat-map): Update docstrings. --- etc/NEWS | 23 ++++++++++++----------- lisp/repeat.el | 10 +++++----- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 7031be311e6..4caf81d1681 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3219,21 +3219,22 @@ batch mode. * New Modes and Packages in Emacs 28.1 +++ -** New transient mode 'repeat-mode' to allow shorter key sequences. +** New mode 'repeat-mode' to allow shorter key sequences. Type 'M-x repeat-mode RET' to enable this mode. You can then type 'C-x u u' instead of 'C-x u C-x u' to undo many changes, 'C-x o o' instead of 'C-x o C-x o' to switch windows, 'C-x { { } } ^ ^ v v' to resize the selected window interactively, 'M-g n n p p' to navigate -next-error matches. Any other key exits repeat mode and then is -executed normally. 'repeat-exit-key' defines an additional key to -exit mode like 'isearch-exit' ('RET'). The user option -'repeat-exit-timeout' specifies the number of seconds of idle time to -break the repetition chain automatically. With 'repeat-keep-prefix' -you can keep the prefix arg of the previous command. For example, -this can help to reverse the window navigation direction with -e.g. 'C-x o M-- o o'. Also it can help to set a new step with -e.g. 'C-x { C-5 { { {', which will set the window resizing step to 5 -columns. +next-error matches. Any other key exits this temporarily enabled +transient mode that supports shorter keys, and then after exiting +from this mode the default key binding is used for the last typed key. +'repeat-exit-key' defines an additional key to exit mode like +'isearch-exit' ('RET'). The user option 'repeat-exit-timeout' +specifies the number of seconds of idle time to break the repetition +chain automatically. With 'repeat-keep-prefix' you can keep the +prefix arg of the previous command. For example, this can help to +reverse the window navigation direction with e.g. 'C-x o M-- o o'. +Also it can help to set a new step with e.g. 'C-x { C-5 { { {', +which will set the window resizing step to 5 columns. --- ** New themes 'modus-vivendi' and 'modus-operandi'. diff --git a/lisp/repeat.el b/lisp/repeat.el index ee9e14b5155..42590b7e6d9 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -344,8 +344,8 @@ For example, you can set it to like `isearch-exit'." (defcustom repeat-exit-timeout nil "Break the repetition chain of keys after specified timeout. -When a number, exit the repeat mode after idle time of the specified -number of seconds." +When a number, exit the transient repeating mode after idle time +of the specified number of seconds." :type '(choice (const :tag "No timeout to exit repeating sequence" nil) (number :tag "Timeout in seconds to exit repeating")) :group 'convenience @@ -363,7 +363,7 @@ number of seconds." (defcustom repeat-echo-function #'repeat-echo-message "Function to display a hint about available keys. Function is called after every repeatable command with one argument: -a repeating map, or nil after deactivating the repeat mode." +a repeating map, or nil after deactivating the transient repeating mode." :type '(choice (const :tag "Show hints in the echo area" repeat-echo-message) (const :tag "Show indicator in the mode line" @@ -374,11 +374,11 @@ a repeating map, or nil after deactivating the repeat mode." :version "28.1") (defvar repeat-in-progress nil - "Non-nil when the repeating map is active.") + "Non-nil when the repeating transient map is active.") ;;;###autoload (defvar repeat-map nil - "The value of the repeating map for the next command. + "The value of the repeating transient map for the next command. A command called from the map can set it again to the same map when the map can't be set on the command symbol property `repeat-map'.") From 59df93e2dda0c64ad36d21b600e56857003eed78 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 20 Oct 2021 20:54:57 +0300 Subject: [PATCH 15/20] * lisp/help.el (help--analyze-key): Add new arg BUFFER (bug#51173). * lisp/help.el (describe-key): Use BUFFER as arg for help--analyze-key. (describe-key-briefly): Change arg UNTRANSLATED deprecated in 27.1 to BUFFER. * lisp/gnus/gnus-art.el (gnus-article-describe-key) (gnus-article-describe-key-briefly): Call describe-key and describe-key-briefly with first arg as a cons with raw keys, and the BUFFER arg set to the current buffer. --- lisp/gnus/gnus-art.el | 8 ++++++-- lisp/help.el | 37 +++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 7b6e15d6f87..cdef73135c1 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6866,7 +6866,9 @@ KEY is a string or a vector." unread-command-events)) (let ((cursor-in-echo-area t) gnus-pick-mode) - (describe-key (read-key-sequence nil t)))) + (describe-key (cons (read-key-sequence nil t) + (this-single-command-raw-keys)) + (current-buffer)))) (describe-key key))) (defun gnus-article-describe-key-briefly (key &optional insert) @@ -6889,7 +6891,9 @@ KEY is a string or a vector." unread-command-events)) (let ((cursor-in-echo-area t) gnus-pick-mode) - (describe-key-briefly (read-key-sequence nil t) insert))) + (describe-key-briefly (cons (read-key-sequence nil t) + (this-single-command-raw-keys)) + insert (current-buffer)))) (describe-key-briefly key insert))) ;;`gnus-agent-mode' in gnus-agent.el will define it. diff --git a/lisp/help.el b/lisp/help.el index 7e2e492a368..92e22aecb5b 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -677,9 +677,11 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer." (defun help--binding-undefined-p (defn) (or (null defn) (integerp defn) (equal defn 'undefined))) -(defun help--analyze-key (key untranslated) +(defun help--analyze-key (key untranslated &optional buffer) "Get information about KEY its corresponding UNTRANSLATED events. -Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)." +Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG). +When BUFFER is nil, it defaults to the buffer displayed +in the selected window." (if (numberp untranslated) (error "Missing `untranslated'!")) (let* ((event (when (> (length key) 0) @@ -699,9 +701,8 @@ Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)." ;; is selected from the context menu that should describe KEY ;; at the position of mouse click that opened the context menu. ;; When no mouse was involved, don't use `mouse-set-point'. - (defn (if (consp event) - (save-excursion (mouse-set-point event) (key-binding key t)) - (key-binding key t)))) + (defn (if buffer (key-binding key t) + (save-excursion (mouse-set-point event) (key-binding key t))))) ;; Handle the case where we faked an entry in "Select and Paste" menu. (when (and (eq defn nil) (stringp (aref key (1- (length key)))) @@ -731,7 +732,7 @@ Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)." ;; If nothing left, then keep one (the last one). (last info-list))) -(defun describe-key-briefly (&optional key-list insert untranslated) +(defun describe-key-briefly (&optional key-list insert buffer) "Print the name of the functions KEY-LIST invokes. KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where RAW-SEQ is the untranslated form of the key sequence SEQ. @@ -739,8 +740,10 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer. While reading KEY-LIST interactively, this command temporarily enables menu items or tool-bar buttons that are disabled to allow getting help -on them." - (declare (advertised-calling-convention (key-list &optional insert) "27.1")) +on them. + +BUFFER is the buffer in which to lookup those keys; it defaults to the +current buffer." (interactive ;; Ignore mouse movement events because it's too easy to miss the ;; message while moving the mouse. @@ -748,15 +751,13 @@ on them." `(,key-list ,current-prefix-arg))) (when (arrayp key-list) ;; Old calling convention, changed - (setq key-list (list (cons key-list - (if (numberp untranslated) - (this-single-command-raw-keys) - untranslated))))) - (let* ((info-list (mapcar (lambda (kr) - (help--analyze-key (car kr) (cdr kr))) - key-list)) - (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n"))) - (if insert (insert msg) (message "%s" msg)))) + (setq key-list (list (cons key-list nil)))) + (with-current-buffer (if (buffer-live-p buffer) buffer (current-buffer)) + (let* ((info-list (mapcar (lambda (kr) + (help--analyze-key (car kr) (cdr kr) buffer)) + key-list)) + (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n"))) + (if insert (insert msg) (message "%s" msg))))) (defun help--key-binding-keymap (key &optional accept-default no-remap position) "Return a keymap holding a binding for KEY within current keymaps. @@ -916,7 +917,7 @@ current buffer." (mapcar (lambda (x) (pcase-let* ((`(,seq . ,raw-seq) x) (`(,brief-desc ,defn ,event ,_mouse-msg) - (help--analyze-key seq raw-seq)) + (help--analyze-key seq raw-seq buffer)) (locus (help--binding-locus seq (event-start event)))) From 4540130312b8e9dbbe930ba2ffb32e5e51560514 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 20 Oct 2021 20:52:43 +0200 Subject: [PATCH 16/20] ; Fix typo --- test/src/data-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 03dfae8cc3c..756c41b6ff3 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -757,7 +757,7 @@ comparing the subr with a much slower Lisp implementation." ;; forwarding, but this needs to happen before the var is accessed ;; from the Lisp side and before we switch to another buffer. ;; The trigger in bug#34318 doesn't exist any more because the C code has - ;; changes. Instead I found the trigger below. + ;; changed. Instead I found the trigger below. (with-temp-buffer (setq last-coding-system-used 'bug34318) (make-local-variable 'last-coding-system-used) From 8002fcd4b9678cbd732c92f26e01751687211911 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 21 Oct 2021 06:06:13 +0200 Subject: [PATCH 17/20] Fix socks test * test/lisp/net/socks-tests.el (socks-tests-v4-basic): Fix failure under native-comp (bug#51308). --- test/lisp/net/socks-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/net/socks-tests.el b/test/lisp/net/socks-tests.el index 9079c1bef2a..7fb885235c0 100644 --- a/test/lisp/net/socks-tests.el +++ b/test/lisp/net/socks-tests.el @@ -203,7 +203,7 @@ Vectors must match verbatim. Strings are considered regex patterns.") (should (equal host "example.com")) (list 93 184 216 34))) ((symbol-function 'user-full-name) - (lambda () "foo"))) + (lambda (&optional _) "foo"))) (socks-tests-perform-hello-world-http-request))))) ;; Replace first pattern below with ([5 3 0 1 2] . [5 2]) to validate From 8f42ff31f66afa03f7d16857ca588d95549b9cf4 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 21 Oct 2021 06:24:35 +0200 Subject: [PATCH 18/20] Fix hi-lock AOT test failures (bug#51308) --- test/lisp/hi-lock-tests.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/lisp/hi-lock-tests.el b/test/lisp/hi-lock-tests.el index 199512fe7de..200caa7e1ad 100644 --- a/test/lisp/hi-lock-tests.el +++ b/test/lisp/hi-lock-tests.el @@ -31,7 +31,8 @@ (with-temp-buffer (insert "a A b B\n") (cl-letf (((symbol-function 'completing-read) - (lambda (_prompt _coll _x _y _z _hist defaults) + (lambda (_prompt _coll + &optional _x _y _z _hist defaults _inherit) (car defaults)))) (dotimes (_ 2) (let ((face (hi-lock-read-face-name))) @@ -43,7 +44,8 @@ (with-temp-buffer (insert "foo bar") (cl-letf (((symbol-function 'completing-read) - (lambda (_prompt _coll _x _y _z _hist defaults) + (lambda (_prompt _coll + &optional _x _y _z _hist defaults _inherit) (car defaults)))) (hi-lock-set-pattern "9999" (hi-lock-read-face-name)) ; No match (hi-lock-set-pattern "foo" (hi-lock-read-face-name))) @@ -89,7 +91,8 @@ (let ((search-spaces-regexp search-whitespace-regexp)) (highlight-regexp "a a")) (should (= (length (overlays-in (point-min) (point-max))) 1)) (cl-letf (((symbol-function 'completing-read) - (lambda (_prompt _coll _x _y _z _hist defaults) + (lambda (_prompt _coll + &optional _x _y _z _hist defaults _inherit) (car defaults)))) (call-interactively 'unhighlight-regexp)) (should (= (length (overlays-in (point-min) (point-max))) 0)) @@ -142,7 +145,8 @@ (font-lock-ensure) (should (memq 'hi-yellow (get-text-property 1 'face))) (cl-letf (((symbol-function 'completing-read) - (lambda (_prompt _coll _x _y _z _hist defaults) + (lambda (_prompt _coll + &optional _x _y _z _hist defaults _inherit) (car defaults))) (font-lock-fontified t)) (call-interactively 'unhighlight-regexp)) @@ -155,7 +159,8 @@ (insert "aAbB\n") (cl-letf (((symbol-function 'completing-read) - (lambda (_prompt _coll _x _y _z _hist defaults) + (lambda (_prompt _coll + &optional _x _y _z _hist defaults _inherit) (car defaults)))) (highlight-regexp "a") From 805ed8d3188d11750b6f1612dde14f845d894679 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 21 Oct 2021 06:26:30 +0200 Subject: [PATCH 19/20] Fix todo-mode AOT test failures (bug#51308) --- test/lisp/calendar/todo-mode-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el index 0538368fc82..9b5d990b9bd 100644 --- a/test/lisp/calendar/todo-mode-tests.el +++ b/test/lisp/calendar/todo-mode-tests.el @@ -567,7 +567,7 @@ The remaining arguments (except _ARG, which is ignored) specify item insertion parameters. This provides a noninteractive API for todo-insert-item for use in automatic testing." (cl-letf (((symbol-function 'read-from-minibuffer) - (lambda (_prompt) item)) + (lambda (_prompt &rest _) item)) ((symbol-function 'read-number) ; For todo-set-item-priority (lambda (_prompt &optional _default) (or priority 1)))) (todo-insert-item--basic nil diary-type date-type time where))) From 0545c70c168d2cc3f4fa794312b23f2616f67327 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Oct 2021 10:53:20 +0300 Subject: [PATCH 20/20] ; * src/keyboard.c (readable_events): Add a comment. --- src/keyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index 6895a249f22..a99d14cb4cf 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3462,6 +3462,8 @@ readable_events (int flags) READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */ if (kbd_fetch_ptr != kbd_store_ptr) { + /* See https://lists.gnu.org/r/emacs-devel/2005-05/msg00297.html + for why we treat toolkit scroll-bar events specially here. */ if (flags & (READABLE_EVENTS_FILTER_EVENTS #ifdef USE_TOOLKIT_SCROLL_BARS | READABLE_EVENTS_IGNORE_SQUEEZABLES