commit eee0ed8442aa78320a3e578ab290df145fb49624 (HEAD, refs/remotes/origin/master) Merge: ea550488233 347750461e7 Author: Stefan Monnier Date: Sun Nov 17 17:50:44 2024 -0500 Merge remote-tracking branch 'refs/remotes/origin/master' commit ea550488233833baafda90a3f258f96953381274 Author: Stefan Monnier Date: Sun Nov 17 17:49:49 2024 -0500 * cus-face.el: Provide completion for font families (bug#74362) * lisp/cus-edit.el (custom-face--font-cache-timeout): New var. (custom-face--font-completion): New function. * lisp/cus-face.el (custom-face-attributes): Use it. diff --git a/etc/NEWS b/etc/NEWS index cb2ba2a78ff..55487aeb3a6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -167,6 +167,8 @@ GNU ELPA instead. This inherits from the 'header-line' face, but is the face actually used on the header lines (along with 'header-line-inactive'). +** In 'customize-face', the "Font family" attribute now supports completion. + * Editing Changes in Emacs 31.1 diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 8eba4270bcb..12d9315c52b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3425,6 +3425,28 @@ to switch between two values." ;;; The `custom-face-edit' Widget. +(defvar custom-face--font-cache-timeout 60 + "Refresh the cache of font families after at most this many seconds.") + +(defalias 'custom-face--font-completion + (let ((lastlist nil) + (lasttime nil) + (lastframe nil)) + (completion-table-case-fold + (completion-table-dynamic + (lambda (_string) + ;; Flush the cache timeout after a while. + (let ((time (float-time))) + (if (and lastlist (eq (selected-frame) lastframe) + (> custom-face--font-cache-timeout (- time lasttime))) + lastlist + ;; (message "last list time: %s" (if lasttime (- time lasttime))) + (setq lasttime time) + (setq lastframe (selected-frame)) + (setq lastlist + (nconc (mapcar #'car face-font-family-alternatives) + (font-family-list)))))))))) + (define-widget 'custom-face-edit 'checklist "Widget for editing face attributes. The following properties have special meanings for this widget: diff --git a/lisp/cus-face.el b/lisp/cus-face.el index d0a1a66e29f..478092c30cb 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -48,7 +48,8 @@ (defconst custom-face-attributes `((:family (string :tag "Font Family" - :help-echo "Font family or fontset alias name.")) + :completions custom-face--font-completion + :help-echo "Font family or fontset alias name (with completion).")) (:foundry (string :tag "Font Foundry" commit 347750461e71eec4668fb265cd29cffce45783f2 Author: Stefan Monnier Date: Sun Nov 17 16:52:33 2024 -0500 man.el: Guess flags for `man -k` to fix bug#73656 * lisp/man.el (Man-man-k-flags): New var. (Man-completion-table): Use it. diff --git a/lisp/man.el b/lisp/man.el index 816c75d749c..d5ac8b93d99 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -973,6 +973,27 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description" (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t))))) (nreverse table))) +(defvar Man-man-k-flags + ;; It's not clear which man page will "always" be available, `man -k man' + ;; seems like the safest choice, but `man -k apropos' seems almost as safe + ;; and usually returns a much shorter output. + (with-temp-buffer + (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos")) + (let ((lines (count-lines (point-min) (point-max))) + (completions (Man-parse-man-k))) + (if (>= (length completions) lines) + '("-k") ;; "-k" seems to return sane results: look no further! + (erase-buffer) + ;; Try "-k -l" (bug#73656). + (with-demoted-errors "%S" (call-process "man" nil t nil + "-k" "-l" "apropos")) + (let ((lines (count-lines (point-min) (point-max))) + (completions (Man-parse-man-k))) + (if (and (> lines 0) (>= (length completions) lines)) + '("-k" "-l") ;; "-k -l" seems to return sane results. + '("-k")))))) + "List of arguments to pass to get the expected \"man -k\" output.") + (defun Man-completion-table (string pred action) (cond ;; This ends up returning t for pretty much any string, and hence leads to @@ -1007,9 +1028,13 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description" ;; error later. (when (eq 0 (ignore-errors - (process-file + (apply + #'process-file manual-program nil '(t nil) nil - "-k" (concat (when (or Man-man-k-use-anchor + ;; FIXME: When `process-file' runs on a remote hosts, + ;; `Man-man-k-flags' may be wrong. + `(,@Man-man-k-flags + ,(concat (when (or Man-man-k-use-anchor (string-equal prefix "")) "^") (if (string-equal prefix "") @@ -1021,7 +1046,7 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description" ;; But we don't have that, and ;; shell-quote-argument does ;; the job... - (shell-quote-argument prefix)))))) + (shell-quote-argument prefix))))))) (setq table (Man-parse-man-k))))) ;; Cache the table for later reuse. (when table commit b6181c9ec9f7dcbb1c5657537ccc52dc7a3bf6ac Author: Michael Albinus Date: Sun Nov 17 11:37:10 2024 +0100 ; Fix last change diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index a87cfd3b27c..59b4bbb7c6a 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -277,7 +277,7 @@ being the result.") ;; trouble. (string-match-p (rx bos (literal tramp-temp-name-prefix) (| "rclone" "fuse") ".") - (file-name-nondirectory file)) + (file-name-nondirectory file))) (tramp--test-message "Delete %s" file) (if (file-directory-p file) (delete-directory file 'recursive) commit b6e78f7d8cc6ac6b2fdea0761879e0d65f493191 Author: Michael Albinus Date: Sun Nov 17 11:15:30 2024 +0100 Tramp: Be more conservative in removing temporary files * test/lisp/net/tramp-tests.el (Commentary): Extend. (tramp--test-enabled): Exclude also old FUSE mount points from deletion. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index d658b061116..a87cfd3b27c 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -45,6 +45,12 @@ ;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper ;; value less than 10 could help. +;; This test suite obeys the environment variables $EMACS_HYDRA_CI and +;; $EMACS_EMBA_CI, used on the Emacs CI/CD platforms. + +;; The following test tags are used: `:expensive-test', +;; `:tramp-asynchronous-processes' and `:unstable'. + ;; A whole test run can be performed calling the command `tramp-test-all'. ;;; Code: @@ -82,7 +88,7 @@ (defvar tramp-remote-process-environment) (defvar tramp-use-connection-share) -;; Declared in Emacs 30. +;; Declared in Emacs 30.1. (defvar remote-file-name-access-timeout) (defvar remote-file-name-inhibit-delete-by-moving-to-trash) @@ -264,7 +270,14 @@ being the result.") "srw" (file-attribute-modes (file-attributes file))) (string-match-p (rx bos (literal tramp-fuse-name-prefix) (regexp tramp-method-regexp) ".") - (file-name-nondirectory file))) + (file-name-nondirectory file)) + ;; Prior Emacs 31.1, the FUSE mount points where + ;; "tramp-rclone.*" and "tramp-sshfs.*". We should + ;; exclude them as well, in order not to make + ;; trouble. + (string-match-p (rx bos (literal tramp-temp-name-prefix) + (| "rclone" "fuse") ".") + (file-name-nondirectory file)) (tramp--test-message "Delete %s" file) (if (file-directory-p file) (delete-directory file 'recursive) @@ -7945,7 +7958,7 @@ process sentinels. They shall not disturb each other." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-crypt-p))) - ;; Starting with Emacs 29.1, `dired-compress-file' is performed by + ;; Starting with Emacs 29.1, `dired-compress-dir' is performed by ;; default handler. (skip-unless (not (tramp--test-emacs29-p))) commit cd490c6470d93bf4093a8e3ea411fa179b235f07 Author: Eli Zaretskii Date: Sun Nov 17 10:22:17 2024 +0200 ; Fix documentation of new header-line faces (bug#73862) * doc/emacs/display.texi (Standard Faces): Fix wording. * etc/NEWS: Fix entry about new header-line faces. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index c022321f8dc..65e462576da 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -783,7 +783,7 @@ Most windows do not have a header line---only some special modes, such Info mode, create one. The @code{header-line-active} and @code{header-line-inactive} faces (which -are the ones used on the header lines) inherit from this face. +are the ones actually used on the header lines) inherit from this face. @cindex faces for header lines @item header-line-active diff --git a/etc/NEWS b/etc/NEWS index cb2ba2a78ff..048a90be560 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -163,9 +163,10 @@ obsolete. Use 'M-x list-packages' to install the 'idlwave' package from GNU ELPA instead. +++ -** New face 'header-line-active'. -This inherits from the 'header-line' face, but is the face actually used -on the header lines (along with 'header-line-inactive'). +** New faces 'header-line-active' and 'header-line-inactive'. +These inherit from the 'header-line' face, but the faces actually used +on the header lines are now these two: the selected window uses +'header-line-active', non-selected windows use 'header-line-inactive'. * Editing Changes in Emacs 31.1