diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index f134a4fe842..95e00e140da 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -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 diff --git a/lisp/faces.el b/lisp/faces.el index 3a434b3251c..76da210280e 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -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 diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c7ebb4d81b6..5f72b5c0329 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -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)