From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70198: M-x shell: deal with environment variables present when tab expanding Date: Thu, 11 Jul 2024 07:36:53 +0300 Message-ID: <86o774mtne.fsf@gnu.org> References: <87plrlz06s.fsf@gmx.de> <86wmltm994.fsf@gnu.org> <87frshyv5w.fsf@gmx.de> <86ttgxm6yc.fsf@gnu.org> <87cynlypay.fsf@gmx.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29694"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70198@debbugs.gnu.org, jidanni@jidanni.org To: Federico Tedin , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 11 06:38:12 2024 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 1sRlZL-0007V2-Sm for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jul 2024 06:38:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRlZE-00070O-40; Thu, 11 Jul 2024 00:38:04 -0400 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 1sRlZC-0006zw-Hn for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 00:38:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRlZC-0001Q9-7c for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 00:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRlZB-0004IN-LP for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 00:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2024 04:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70198 X-GNU-PR-Package: emacs Original-Received: via spool by 70198-submit@debbugs.gnu.org id=B70198.172067262316447 (code B ref 70198); Thu, 11 Jul 2024 04:38:01 +0000 Original-Received: (at 70198) by debbugs.gnu.org; 11 Jul 2024 04:37:03 +0000 Original-Received: from localhost ([127.0.0.1]:50664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRlYF-0004HD-7O for submit@debbugs.gnu.org; Thu, 11 Jul 2024 00:37:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRlYD-0004Gb-2F for 70198@debbugs.gnu.org; Thu, 11 Jul 2024 00:37:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRlY7-0001JJ-Hd; Thu, 11 Jul 2024 00:36:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oN2ASoGG0em/TkE82/108Ocu/r4mrMiHYiaSbzFUEhs=; b=gIHgv+d/qI1j xkgeB50b3zJmZR47k23X7ezgMYoNET5EHrr7Spwr45WFdEEgl9YK5fQ5G820EOJ1rjTpfIchONgBg PCczYG0c+nlKWR37vMT96ORgvUvU/qBLr9cCfDXXQxdHLEV88U7wUvtQ+TWJqEHwYm9+az8xqFEqm ZuGj3uVKJRUTEk3W+quBa9nn4E9lV8odn2SIyFIpmAH2j1z778hv9Al8nmNXPG6g6IZ3dGib35gBm f30R+3h8/l4G2OTSo3AKBhA/5CMI+7zMzOhPm5p6z+TEspa+1e0+ial+kVTY146qe9X5GNSZMEIn4 6UECjNknj/Gr4L4ft4Yn8g==; In-Reply-To: <87cynlypay.fsf@gmx.de> (message from Federico Tedin on Wed, 10 Jul 2024 22:17:41 +0200) 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:288710 Archived-At: > From: Federico Tedin > Cc: 70198@debbugs.gnu.org, jidanni@jidanni.org > Date: Wed, 10 Jul 2024 22:17:41 +0200 > > Eli Zaretskii writes: > > > If we want to detect FOO=BAR, we need to use syntax classes, and I'm > > not sure regexps are the best instrument for that. > > But then, just to make sure I'm on the right track: > > - When the word at point is a command (not an arg) > `shell-command-completion' should return the proper command completions. > > - When the word at point is *not* a command, `shell-command-completion' should > return nil so that other completion functions are attempted. > > And these two scenarios need to be decided on using syntax classes > instead of regexps. Yes, I think so. I added Stefan to the discussion in case he has comments or suggestions. Stefan, what do you think is the best method of parsing the beginning of the command line to detect where a program's name starts?