From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Koch Newsgroups: gmane.emacs.bugs Subject: bug#12145: Fix causes problems with other processes Date: Thu, 2 Mar 2023 21:00:19 +0200 (EET) Message-ID: <432215292.266279.1677783619005@office.mailbox.org> References: <202231886.202734.1677754136372@office.mailbox.org> <1196619804.249665.1677773294263@office.mailbox.org> <87lekfxezv.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38148"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "12145@debbugs.gnu.org" <12145@debbugs.gnu.org>, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 02 20:01:29 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXoBE-0009k9-Lv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Mar 2023 20:01:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXoAq-0004AH-03; Thu, 02 Mar 2023 14:01:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXoAo-000481-Kv for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 14:01:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXoAo-0002Mi-Bw for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 14:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pXoAo-0004Be-30 for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 14:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Koch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2023 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12145 X-GNU-PR-Package: emacs Original-Received: via spool by 12145-submit@debbugs.gnu.org id=B12145.167778363116029 (code B ref 12145); Thu, 02 Mar 2023 19:01:02 +0000 Original-Received: (at 12145) by debbugs.gnu.org; 2 Mar 2023 19:00:31 +0000 Original-Received: from localhost ([127.0.0.1]:58394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXoAI-0004AT-Hz for submit@debbugs.gnu.org; Thu, 02 Mar 2023 14:00:30 -0500 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:50626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXoAF-0004A9-UE for 12145@debbugs.gnu.org; Thu, 02 Mar 2023 14:00:28 -0500 Original-Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PSL5b6fjnz9swd; Thu, 2 Mar 2023 20:00:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koch.ro; s=MBO0001; t=1677783620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8aIP5OJH996G5PsyFkiEGiErPlwEIArwKlP5/2NxehY=; b=qM3pyGdKLdS4z37X0xVp80XQo4cwLHaflIJZyzcYbxtKkaVuBB7l9Rred3rF+OtWab8GV4 8q5OTrNxLmFFPNO8ecTh9Wyc1yhCfTdhAjOXH6bOnM9NpCcfmxdOQnn5uRG3kL7fReohdT +ubgSCj3sJ9pXRoC0ZJcV6eEhdcu0LAgC19+x3TuYbzB5Eg1NB77tKNCgiLDS+eZ331Wz2 XqQHd5198ibdrKETv2SL851HzMJAj4WS4IgsW4SiJgpSKr5ouifaTzcJ+xB/KK/hkQfmy3 E+c+goqiBVTgsCuT/NFY43sTvrujAOP+fTs8/HYl/Ce52FEkaUQZA8A62NEdrA== In-Reply-To: <87lekfxezv.fsf@gmx.de> X-Priority: 3 Importance: Normal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257178 Archived-At: I've now also digged a bit into the second, longer backtrace with (wrong-type-argument "markerp nil"): - With (message) debugging I fount that the last line of this snippet in `comint-output-filter` is the one that causes the error: ;; We temporarily remove any buffer narrowing, in case the ;; process mark is outside of the restriction (save-restriction (widen) (goto-char (process-mark process)) (set-marker comint-last-output-start (point)) - comint-last-output start gets initialized in `define-derived-mode comint-mode`: (setq-local comint-last-output-start (make-marker)) -> Either, a) `comint-output-filter` gets called before `comint-mode` -> or b) `comint-last-output-start` gets reset after its initialization. These two lines from `find-dired`: (shell-command (concat args "&") (current-buffer)) ;; The next statement will bomb in classic dired (no optional arg allowed) (dired-mode dir (cdr find-ls-option)) 1. `shell-command` switches (current-buffer) to `shell-mode` which is derived from `comint-mode`. 2. `comint-mode` initializes `comint-last-output-start`. 3. `shell-command` sets `comint-output-filter` for the process it started 4. `find-dired` calls `dired-mode` 5. `dired-mode` calls (kill-all-local-variables) which probably sets `comint-last-output-start` to nil? It is however not too important whether the above analysis is right, given the following comment in shell-command: """In Elisp, you will often be better served by calling call-process or start-process directly, since they offer more control and do not impose the use of a shell (with its need to quote arguments).""" I believe, find-dired should be changed to not call shell-command anymore. I rest my case.