Merge from origin/emacs-28

a50f8dec09 Follow OpenSSH changes in Tramp
e86eae21a9 Document better how to reset attributes of faces for new f...
This commit is contained in:
Stefan Kangas 2022-02-27 06:31:54 +01:00
commit 2fdc7d5044
3 changed files with 42 additions and 31 deletions

View file

@ -3021,12 +3021,21 @@ names (such as @code{:family} or @code{:underline}) and values. Thus,
sets the attribute @code{:weight} to @code{bold} and the attribute
@code{:slant} to @code{italic}.
If @var{frame} is @code{t}, this function sets the default attributes
for newly created frames; they will effectively override the attribute
values specified by @code{defface}. If @var{frame} is @code{nil},
this function sets the attributes for all existing frames, as well as
for newly created frames.
for newly created frames. However, if you want to @emph{reset} the
value of an attribute to @code{unspecified} in a way that also affects
newly created frames, you @emph{must} explicitly call this function
with @var{frame} set to @code{t} and the value of the attribute set to
@code{unspecified} (@emph{not} @code{nil}!@:), in addition to the call
with @var{frame} set to @code{nil}. This is because the default
attributes for newly created frames are merged with the face's spec in
@code{defface} when a new frame is created, and so having
@code{unspecified} in the default attributes for new frames will be
unable to override @code{defface}; the special call to this function
as described above will arrange for @code{defface} to be overridden.
@end defun
The following commands and functions mostly provide compatibility

View file

@ -663,7 +663,12 @@ face spec. It is mostly intended for internal use only.
If FRAME is nil, set the attributes for all existing frames, as
well as the default for new frames. If FRAME is t, change the
default for new frames only.
default for new frames only. As an exception, to reset the value
of some attribute to `unspecified' in a way that overrides the
non-`unspecified' value defined by the face's spec in `defface',
for new frames, you must explicitly call this function with FRAME
set to t and the attribute's value set to `unspecified'; just
using FRAME of nil will not affect new frames in this case.
ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a
valid face attribute name. All attributes can be set to

View file

@ -4783,36 +4783,33 @@ Goes through the list `tramp-inline-compress-commands'."
(t (setq tramp-ssh-controlmaster-options "")
(let ((case-fold-search t))
(ignore-errors
(when (executable-find "ssh")
(with-tramp-progress-reporter
vec 4 "Computing ControlMaster options"
(with-temp-buffer
(tramp-call-process vec "ssh" nil t nil "-o" "ControlMaster")
(goto-char (point-min))
(when (search-forward-regexp "\\(missing\\|no\\).+argument" nil t)
(setq tramp-ssh-controlmaster-options
"-o ControlMaster=auto")))
(unless (zerop (length tramp-ssh-controlmaster-options))
(with-temp-buffer
;; We use a non-existing IP address, in order to
;; avoid useless connections, and DNS timeouts.
;; Setting ConnectTimeout is needed since OpenSSH 7.
(tramp-call-process
vec "ssh" nil t nil
"-o" "ConnectTimeout=1" "-o" "ControlPath=%C" "0.0.0.1")
(goto-char (point-min))
(with-tramp-progress-reporter
vec 4 "Computing ControlMaster options"
;; We use a non-existing IP address, in order to avoid
;; useless connections, and DNS timeouts.
(when (zerop
(tramp-call-process
vec "ssh" nil nil nil
"-G" "-o" "ControlMaster=auto" "0.0.0.1"))
(setq tramp-ssh-controlmaster-options
"-o ControlMaster=auto")
(if (zerop
(tramp-call-process
vec "ssh" nil nil nil
"-G" "-o" "ControlPath='tramp.%C'" "0.0.0.1"))
(setq tramp-ssh-controlmaster-options
(concat tramp-ssh-controlmaster-options
(if (search-forward-regexp "unknown.+key" nil t)
" -o ControlPath='tramp.%%r@%%h:%%p'"
" -o ControlPath='tramp.%%C'"))))
(with-temp-buffer
(tramp-call-process vec "ssh" nil t nil "-o" "ControlPersist")
(goto-char (point-min))
(when (search-forward-regexp "missing.+argument" nil t)
(setq tramp-ssh-controlmaster-options
(concat tramp-ssh-controlmaster-options
" -o ControlPersist=no")))))))))
" -o ControlPath='tramp.%%C'"))
(setq tramp-ssh-controlmaster-options
(concat tramp-ssh-controlmaster-options
" -o ControlPath='tramp.%%r@%%h:%%p'")))
(when (zerop
(tramp-call-process
vec "ssh" nil nil nil
"-G" "-o" "ControlPersist=no" "0.0.0.1"))
(setq tramp-ssh-controlmaster-options
(concat tramp-ssh-controlmaster-options
" -o ControlPersist=no")))))))
tramp-ssh-controlmaster-options)))
(defun tramp-scp-strict-file-name-checking (vec)