commit 402b175f358c948b5207924fd2f48c4666ca1c0a (HEAD, refs/remotes/origin/master) Author: Noam Postavsky Date: Thu Mar 12 21:07:56 2020 -0400 Make cl-equalp a bit more efficient at comparing strings * lisp/emacs-lisp/cl-extra.el (cl-equalp): Use compare-strings with the IGNORE-CASE argument, rather than creating downcased copies of the strings to be compared. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index e9bfe8df5f..323bbbbf94 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -72,8 +72,7 @@ strings case-insensitively." (cond ((eq x y) t) ((stringp x) (and (stringp y) (= (length x) (length y)) - (or (string-equal x y) - (string-equal (downcase x) (downcase y))))) ;Lazy but simple! + (eq (compare-strings x nil nil y nil nil t) t))) ((numberp x) (and (numberp y) (= x y))) ((consp x) commit 3758ff0f3ad365b7a56c3e63a8d0d5f00f3d5085 Author: Noam Postavsky Date: Thu Mar 12 21:03:45 2020 -0400 rcirc: Match NickServ messages case-insensitively (Bug#39345) Reported by Jake Nelson . * lisp/net/rcirc.el (rcirc-check-auth-status): NickServ will response will show the nick in the same case used during registration, but it allows case-insensitive matches when logging in. Therefore, we should accept response messages regardless of case. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index a223416690..1766e192f2 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2626,12 +2626,16 @@ the only argument." (and ;; nickserv (string= sender "NickServ") (string= target rcirc-nick) - (member message - (list - (format "You are now identified for \C-b%s\C-b." rcirc-nick) - (format "You are successfully identified as \C-b%s\C-b." rcirc-nick) - "Password accepted - you are now recognized." - ))) + (cl-member + message + (list + (format "You are now identified for \C-b%s\C-b." rcirc-nick) + (format "You are successfully identified as \C-b%s\C-b." + rcirc-nick) + "Password accepted - you are now recognized.") + ;; The nick may have a different case, so match + ;; case-insensitively (Bug#39345). + :test #'cl-equalp)) (and ;; quakenet (string= sender "Q") (string= target rcirc-nick) commit bbc48b263485c26c6823eabdbbd7e9af62178e34 Author: Andrii Kolomoiets Date: Tue Mar 10 10:14:59 2020 +0200 Fix NS child frame in native fullscreen (bug#36672) * lisp/frame.el (toggle-frame-fullscreen): Don't sleep on cocoa. Fullscreen animation waiting is moved to src/nsterm.m. * src/nsterm.h (EmacsView): Add in_fullscreen_transition, inFullScreenTransition, waitFullScreenTransition. (NSWindowCollectionBehaviorFullScreenAuxiliary): New define. * src/nsterm.m (ns_make_frame_visible): Wait for fullscreen animation. (ns_set_parent_frame): Set frame collection behavior; make child frames non-fullscreen; make non-child frames fullscreen if parent was fullscreen. ([EmacsView initFrameFromEmacs]): Set in_fullscreen_transition; set frame collection behavior according to parent frame. ([EmacsView windowDidMove]): Remove code by commenting with "fixme". ([EmacsView windowWillEnterFullScreen], [EmacsView windowDidEnterFullScreen]) ([EmacsView windowWillExitFullScreen], [EmacsView windowDidExitFullScreen]): Set in_fullscreen_transition. ([EmacsView inFullScreenTransition], [EmacsView waitFullScreenTransition]): New methods. ([EmacsView updateCollectionBehavior]): Set collection behavior according to parent frame. ([EmacsView toggleFullScreen]): Wait for fullscreen animation. diff --git a/lisp/frame.el b/lisp/frame.el index dc8dabc5a5..6c2f774709 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2688,11 +2688,7 @@ See also `toggle-frame-maximized'." (set-frame-parameter frame 'fullscreen fullscreen-restore) (set-frame-parameter frame 'fullscreen nil))) (modify-frame-parameters - frame `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))) - ;; Manipulating a frame without waiting for the fullscreen - ;; animation to complete can cause a crash, or other unexpected - ;; behavior, on macOS (bug#28496). - (when (featurep 'cocoa) (sleep-for 0.5)))) + frame `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))))) ;;;; Key bindings diff --git a/src/nsterm.h b/src/nsterm.h index db966e1581..8396a542f7 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -433,6 +433,7 @@ typedef id instancetype; int maximized_width, maximized_height; NSWindow *nonfs_window; BOOL fs_is_native; + BOOL in_fullscreen_transition; #ifdef NS_DRAW_TO_BUFFER CGContextRef drawingBuffer; #endif @@ -467,6 +468,8 @@ typedef id instancetype; - (void) toggleFullScreen: (id) sender; - (BOOL) fsIsNative; - (BOOL) isFullscreen; +- (BOOL) inFullScreenTransition; +- (void) waitFullScreenTransition; #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - (void) updateCollectionBehavior; #endif @@ -1286,6 +1289,7 @@ extern char gnustep_base_version[]; /* version tracking */ #if !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_7) #define NSFullScreenWindowMask (1 << 14) #define NSWindowCollectionBehaviorFullScreenPrimary (1 << 7) +#define NSWindowCollectionBehaviorFullScreenAuxiliary (1 << 8) #define NSApplicationPresentationFullScreen (1 << 10) #define NSApplicationPresentationAutoHideToolbar (1 << 11) #define NSAppKitVersionNumber10_7 1138 diff --git a/src/nsterm.m b/src/nsterm.m index 851a5617d7..96a7fdc018 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1571,9 +1571,12 @@ -(void)remove /* Making a new frame from a fullscreen frame will make the new frame fullscreen also. So skip handleFS as this will print an error. */ - if ([view fsIsNative] && f->want_fullscreen == FULLSCREEN_BOTH - && [view isFullscreen]) - return; + if ([view fsIsNative] && [view isFullscreen]) + { + // maybe it is not necessary to wait + [view waitFullScreenTransition]; + return; + } if (f->want_fullscreen != FULLSCREEN_NONE) { @@ -1959,19 +1962,55 @@ so some key presses (TAB) are swallowed by the system. */ block_input (); child = [FRAME_NS_VIEW (f) window]; +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); +#endif + if ([child parentWindow] != nil) { +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + parent = [child parentWindow]; +#endif + [[child parentWindow] removeChildWindow:child]; #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000 if ([child respondsToSelector:@selector(setAccessibilitySubrole:)]) #endif [child setAccessibilitySubrole:NSAccessibilityStandardWindowSubrole]; +#endif +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + if (NILP (new_value)) + { + NSTRACE ("child setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary"); + [child setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + // if current parent in fullscreen and no new parent make child fullscreen + while (parent) { + if (([parent styleMask] & NSWindowStyleMaskFullScreen) != 0) + { + [view toggleFullScreen:child]; + break; + } + // check all parents + parent = [parent parentWindow]; + } + } #endif } if (!NILP (new_value)) { +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + // child frame must not be in fullscreen + if ([view fsIsNative] && [view isFullscreen]) + { + // in case child is going fullscreen + [view waitFullScreenTransition]; + [view toggleFullScreen:child]; + } + NSTRACE ("child setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary"); + [child setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; +#endif parent = [FRAME_NS_VIEW (p) window]; [parent addChildWindow: child @@ -7398,6 +7437,7 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f #endif fs_is_native = ns_use_native_fullscreen; #endif + in_fullscreen_transition = NO; maximized_width = maximized_height = -1; nonfs_window = nil; @@ -7431,7 +7471,10 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7) #endif - [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + if (FRAME_PARENT_FRAME (f)) + [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; + else + [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; #endif wr = [win frame]; @@ -7554,11 +7597,12 @@ - (void)windowDidMove: sender emacsframe->top_pos = NS_PARENT_WINDOW_TOP_POS (emacsframe) - (r.origin.y + r.size.height); - if (emacs_event) - { - emacs_event->kind = MOVE_FRAME_EVENT; - EV_TRAILER ((id)nil); - } + // FIXME: after event part below didExitFullScreen is not received + // if (emacs_event) + // { + // emacs_event->kind = MOVE_FRAME_EVENT; + // EV_TRAILER ((id)nil); + // } } } @@ -7758,6 +7802,7 @@ - (NSApplicationPresentationOptions)window:(NSWindow *)window - (void)windowWillEnterFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowWillEnterFullScreen:]"); + in_fullscreen_transition = YES; [self windowWillEnterFullScreen]; } - (void)windowWillEnterFullScreen /* provided for direct calls */ @@ -7770,6 +7815,7 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowDidEnterFullScreen:]"); [self windowDidEnterFullScreen]; + in_fullscreen_transition = NO; } - (void)windowDidEnterFullScreen /* provided for direct calls */ @@ -7808,6 +7854,7 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */ - (void)windowWillExitFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowWillExitFullScreen:]"); + in_fullscreen_transition = YES; [self windowWillExitFullScreen]; } @@ -7827,6 +7874,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowDidExitFullScreen:]"); [self windowDidExitFullScreen]; + in_fullscreen_transition = NO; } - (void)windowDidExitFullScreen /* provided for direct calls */ @@ -7856,6 +7904,22 @@ - (void)windowDidExitFullScreen /* provided for direct calls */ [[self window] performZoom:self]; } +- (BOOL)inFullScreenTransition +{ + return in_fullscreen_transition; +} + +- (void)waitFullScreenTransition +{ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + while ([self inFullScreenTransition]) + { + NSTRACE ("wait for fullscreen"); + wait_reading_process_output (0, 300000000, 0, 1, Qnil, NULL, 0); + } +#endif +} + - (BOOL)fsIsNative { return fs_is_native; @@ -7894,9 +7958,22 @@ - (void)updateCollectionBehavior NSWindow *win = [self window]; NSWindowCollectionBehavior b = [win collectionBehavior]; if (ns_use_native_fullscreen) - b |= NSWindowCollectionBehaviorFullScreenPrimary; + { + if ([win parentWindow]) + { + b &= ~NSWindowCollectionBehaviorFullScreenPrimary; + b |= NSWindowCollectionBehaviorFullScreenAuxiliary; + } + else + { + b |= NSWindowCollectionBehaviorFullScreenPrimary; + b &= ~NSWindowCollectionBehaviorFullScreenAuxiliary; + } + } else - b &= ~NSWindowCollectionBehaviorFullScreenPrimary; + { + b &= ~NSWindowCollectionBehaviorFullScreenPrimary; + } [win setCollectionBehavior: b]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 @@ -7922,8 +7999,14 @@ - (void)toggleFullScreen: (id)sender #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 if ([[self window] respondsToSelector: @selector(toggleFullScreen:)]) + { +#endif + [[self window] toggleFullScreen:sender]; + // wait for fullscreen animation complete (bug#28496) + [self waitFullScreenTransition]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + } #endif - [[self window] toggleFullScreen:sender]; #endif return; } commit 3db5a51384d80306b3279c2c0ceaf48e18e49474 Author: Stefan Monnier Date: Thu Mar 12 18:21:19 2020 -0400 * lisp/emacs-lisp/eldoc.el: Remove redundant `:group` arguments diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 660fce4be0..4a2e7488eb 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -32,13 +32,9 @@ ;; the one-line documentation for that variable instead, to remind you of ;; that variable's meaning. -;; One useful way to enable this minor mode is to put the following in your -;; .emacs: -;; -;; (add-hook 'emacs-lisp-mode-hook 'eldoc-mode) -;; (add-hook 'lisp-interaction-mode-hook 'eldoc-mode) -;; (add-hook 'ielm-mode-hook 'eldoc-mode) -;; (add-hook 'eval-expression-minibuffer-setup-hook 'eldoc-mode) +;; This mode is now enabled by default in all major modes that provide +;; support for it, such as `emacs-lisp-mode'. +;; This is controlled by `global-eldoc-mode'. ;; Major modes for other languages may use ElDoc by adding an ;; appropriate function to the buffer-local value of @@ -57,20 +53,17 @@ If user input arrives before this interval of time has elapsed after the last input, no documentation will be printed. If this variable is set to 0, no idle time is required." - :type 'number - :group 'eldoc) + :type 'number) (defcustom eldoc-print-after-edit nil "If non-nil eldoc info is only shown when editing. Changing the value requires toggling `eldoc-mode'." - :type 'boolean - :group 'eldoc) + :type 'boolean) ;;;###autoload (defcustom eldoc-minor-mode-string (purecopy " ElDoc") "String to display in mode line when ElDoc Mode is enabled; nil for none." - :type '(choice string (const :tag "None" nil)) - :group 'eldoc) + :type '(choice string (const :tag "None" nil))) (defcustom eldoc-argument-case #'identity "Case to display argument names of functions, as a symbol. @@ -82,8 +75,7 @@ Note that this variable has no effect, unless `eldoc-documentation-function' handles it explicitly." :type '(radio (function-item upcase) (function-item downcase) - function) - :group 'eldoc) + function)) (make-obsolete-variable 'eldoc-argument-case nil "25.1") (defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit @@ -106,15 +98,13 @@ Note that this variable has no effect, unless :type '(radio (const :tag "Always" t) (const :tag "Never" nil) (const :tag "Yes, but truncate symbol names if it will\ - enable argument list to fit on one line" truncate-sym-name-if-fit)) - :group 'eldoc) + enable argument list to fit on one line" truncate-sym-name-if-fit))) (defface eldoc-highlight-function-argument '((t (:inherit bold))) "Face used for the argument at point in a function's argument list. Note that this face has no effect unless the `eldoc-documentation-function' -handles it explicitly." - :group 'eldoc) +handles it explicitly.") ;;; No user options below here. @@ -182,8 +172,7 @@ area displays information about a function or variable in the text where point is. If point is on a documented variable, it displays the first line of that variable's doc string. Otherwise it displays the argument list of the function called in the -expression point is on." - :group 'eldoc :lighter eldoc-minor-mode-string +expression point is on." :lighter eldoc-minor-mode-string (setq eldoc-last-message nil) (cond ((not (eldoc--supported-p)) @@ -193,19 +182,18 @@ expression point is on." (eldoc-mode (when eldoc-print-after-edit (setq-local eldoc-message-commands (eldoc-edit-message-commands))) - (add-hook 'post-command-hook 'eldoc-schedule-timer nil t) - (add-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area nil t)) + (add-hook 'post-command-hook #'eldoc-schedule-timer nil t) + (add-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area nil t)) (t (kill-local-variable 'eldoc-message-commands) - (remove-hook 'post-command-hook 'eldoc-schedule-timer t) - (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t) + (remove-hook 'post-command-hook #'eldoc-schedule-timer t) + (remove-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area t) (when eldoc-timer (cancel-timer eldoc-timer) (setq eldoc-timer nil))))) ;;;###autoload (define-globalized-minor-mode global-eldoc-mode eldoc-mode turn-on-eldoc-mode - :group 'eldoc :initialize 'custom-initialize-delay :init-value t ;; For `read--expression', the usual global mode mechanism of @@ -284,7 +272,7 @@ Otherwise work like `message'." (when (stringp format-string) (apply #'format-message format-string args))) (force-mode-line-update))) - (apply 'message format-string args))) + (apply #'message format-string args))) (defun eldoc-message (&optional string) "Display STRING as an ElDoc message if it's non-nil. @@ -292,9 +280,7 @@ Otherwise work like `message'." Also store it in `eldoc-last-message' and return that value." (let ((omessage eldoc-last-message)) (setq eldoc-last-message string) - ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages - ;; are recorded in a log. Do not put eldoc messages in that log since - ;; they are Legion. + ;; Do not put eldoc messages in the log since they are Legion. ;; Emacs way of preventing log messages. (let ((message-log-max nil)) (cond (eldoc-last-message @@ -307,12 +293,15 @@ Also store it in `eldoc-last-message' and return that value." (and (symbolp command) (intern-soft (symbol-name command) eldoc-message-commands))) -;; This function goes on pre-command-hook for XEmacs or when using idle -;; timers in Emacs. Motion commands clear the echo area for some reason, +;; This function goes on pre-command-hook. +;; Motion commands clear the echo area for some reason, ;; which make eldoc messages flicker or disappear just before motion ;; begins. This function reprints the last eldoc message immediately ;; before the next command executes, which does away with the flicker. ;; This doesn't seem to be required for Emacs 19.28 and earlier. +;; FIXME: The above comment suggests we don't really understand why +;; this is needed. Maybe it's not needed any more, but if it is +;; we should figure out why. (defun eldoc-pre-command-refresh-echo-area () "Reprint `eldoc-last-message' in the echo area." (and eldoc-last-message @@ -385,7 +374,7 @@ Meant as a value for `eldoc-documentation-function'." (defcustom eldoc-documentation-function #'eldoc-documentation-default "Function to call to return doc string. The function of no args should return a one-line string for displaying -doc about a function etc. appropriate to the context around point. +doc about a function etc. appropriate to the context around point. It should return nil if there's no doc appropriate for the context. Typically doc is returned if point is on a function-like name or in its arg list. @@ -398,8 +387,7 @@ effect." :type '(radio (function-item eldoc-documentation-default) (function-item eldoc-documentation-compose) (function :tag "Other function")) - :version "28.1" - :group 'eldoc) + :version "28.1") (defun eldoc--supported-p () "Non-nil if an ElDoc function is set for this buffer." commit 2d221c8d87185fd02a6eb7558ddc4c9524153d72 Author: Stefan Monnier Date: Thu Mar 12 11:18:07 2020 -0400 * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): Understand the "old" API diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 6e35018b10..660fce4be0 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -404,7 +404,16 @@ effect." (defun eldoc--supported-p () "Non-nil if an ElDoc function is set for this buffer." (and (not (memq eldoc-documentation-function '(nil ignore))) - eldoc-documentation-functions)) + (or eldoc-documentation-functions + ;; The old API had major modes set `eldoc-documentation-function' + ;; to provide eldoc support. It's impossible now to determine + ;; reliably whether the `eldoc-documentation-function' provides + ;; eldoc support (as in the old API) or whether it just provides + ;; a way to combine the results of the + ;; `eldoc-documentation-functions' (as in the new API). + ;; But at least if it's set buffer-locally it's a good hint that + ;; there's some eldoc support in the current buffer. + (local-variable-p 'eldoc-documentation-function)))) (defun eldoc-print-current-symbol-info () "Print the text produced by `eldoc-documentation-function'." commit f253ff7b780c68bd4d1d12a978a1215af1971320 Author: Stefan Monnier Date: Thu Mar 12 10:03:14 2020 -0400 * lisp/subr.el (cancel-change-group): Undo accidental change diff --git a/lisp/subr.el b/lisp/subr.el index 359f51c0d0..9c80c06a12 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2987,14 +2987,13 @@ This finishes the change group by reverting all of its changes." ;; the body of `atomic-change-group' all changes can be undone. (widen) (let ((old-car (car-safe elt)) - (old-cdr (cdr-safe elt)) - (start-pul pending-undo-list)) + (old-cdr (cdr-safe elt))) (unwind-protect (progn ;; Temporarily truncate the undo log at ELT. (when (consp elt) (setcar elt nil) (setcdr elt nil)) - (setq pending-undo-list buffer-undo-list) + (unless (eq last-command 'undo) (undo-start)) ;; Make sure there's no confusion. (when (and (consp elt) (not (eq elt (last pending-undo-list)))) (error "Undoing to some unrelated state")) @@ -3007,13 +3006,7 @@ This finishes the change group by reverting all of its changes." ;; Reset the modified cons cell ELT to its original content. (when (consp elt) (setcar elt old-car) - (setcdr elt old-cdr))) - ;; Let's not break a sequence of undos just because we - ;; tried to make a change and then undid it: preserve - ;; the original `pending-undo-list' if it's still valid. - (if (eq (undo--last-change-was-undo-p buffer-undo-list) - start-pul) - (setq pending-undo-list start-pul))))))) + (setcdr elt old-cdr)))))))) ;;;; Display-related functions. commit 4c3c175a63823d851c7e9326f4f70c81b9c0110e Author: Michael Albinus Date: Thu Mar 12 11:44:38 2020 +0100 * lisp/net/tramp-sh.el (tramp-find-shell): Skip for asynchronous processes. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index eaf6055440..7ac41d16c8 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4194,45 +4194,47 @@ file exists and nonzero exit status otherwise." (defun tramp-find-shell (vec) "Open a shell on the remote host which groks tilde expansion." - (with-current-buffer (tramp-get-buffer vec) - (let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell)) - shell) - (setq shell - (with-tramp-connection-property vec "remote-shell" - ;; CCC: "root" does not exist always, see my QNAP TS-459. - ;; Which check could we apply instead? - (tramp-send-command vec "echo ~root" t) - (if (or (string-match-p "^~root$" (buffer-string)) - ;; The default shell (ksh93) of OpenSolaris and - ;; Solaris is buggy. We've got reports for - ;; "SunOS 5.10" and "SunOS 5.11" so far. - (string-match-p - (eval-when-compile - (regexp-opt '("SunOS 5.10" "SunOS 5.11"))) - (tramp-get-connection-property vec "uname" ""))) - - (or (tramp-find-executable - vec "bash" (tramp-get-remote-path vec) t t) - (tramp-find-executable - vec "ksh" (tramp-get-remote-path vec) t t) - ;; Maybe it works at least for some other commands. - (prog1 - default-shell - (tramp-message - vec 2 + ;; If we are in `make-process', we don't need another shell. + (unless (tramp-get-connection-property vec "process-name" nil) + (with-current-buffer (tramp-get-buffer vec) + (let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell)) + shell) + (setq shell + (with-tramp-connection-property vec "remote-shell" + ;; CCC: "root" does not exist always, see my QNAP + ;; TS-459. Which check could we apply instead? + (tramp-send-command vec "echo ~root" t) + (if (or (string-match-p "^~root$" (buffer-string)) + ;; The default shell (ksh93) of OpenSolaris + ;; and Solaris is buggy. We've got reports + ;; for "SunOS 5.10" and "SunOS 5.11" so far. + (string-match-p (eval-when-compile - (concat - "Couldn't find a remote shell which groks tilde " - "expansion, using `%s'")) - default-shell))) + (regexp-opt '("SunOS 5.10" "SunOS 5.11"))) + (tramp-get-connection-property vec "uname" ""))) + + (or (tramp-find-executable + vec "bash" (tramp-get-remote-path vec) t t) + (tramp-find-executable + vec "ksh" (tramp-get-remote-path vec) t t) + ;; Maybe it works at least for some other commands. + (prog1 + default-shell + (tramp-message + vec 2 + (eval-when-compile + (concat + "Couldn't find a remote shell which groks tilde " + "expansion, using `%s'")) + default-shell))) - default-shell))) + default-shell))) - ;; Open a new shell if needed. - (unless (string-equal shell default-shell) - (tramp-message - vec 5 "Starting remote shell `%s' for tilde expansion" shell) - (tramp-open-shell vec shell))))) + ;; Open a new shell if needed. + (unless (string-equal shell default-shell) + (tramp-message + vec 5 "Starting remote shell `%s' for tilde expansion" shell) + (tramp-open-shell vec shell)))))) ;; Utility functions.