From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Small shell-mode patch to handle auto-cd (e.g. shells like zsh) Date: Thu, 06 May 2021 10:10:06 +0200 Message-ID: <87sg30471d.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="950"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: jason.kim@revtera.com, shivers@cs.cmu.edu, emacs-devel@gnu.org To: Jason Kim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 06 10:12:42 2021 Return-path: Envelope-to: ged-emacs-devel@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 1leZ7h-00006d-Ub for ged-emacs-devel@m.gmane-mx.org; Thu, 06 May 2021 10:12:41 +0200 Original-Received: from localhost ([::1]:35544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leZ7h-00045g-1X for ged-emacs-devel@m.gmane-mx.org; Thu, 06 May 2021 04:12:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leZ5b-0002ZH-3L for emacs-devel@gnu.org; Thu, 06 May 2021 04:10:31 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:41473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leZ5W-0001pg-5g for emacs-devel@gnu.org; Thu, 06 May 2021 04:10:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620288608; bh=Mkt8/5xOg0ZEaH2OKdjVNVZJ5a944Ak6uPCNNfvPIDI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=U1Dj+5JD7gMsIZIk/+hrTzlYJxdFfn3djhJyFJKHGch7g4qcJ9HJGdQuvGMyEZimt lwgZD4fR1WNRAqPpvK9mkCmCS7jcVgMW9uUzTgQ4iDRaXWrDA25i4K/uy2zfFrsd7C xZ6jy5PlKWOxGmhSVtVXmsShKUKosIZgiaFJxHx4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.118.236]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MmDEg-1lDzm33hbM-00iCXh; Thu, 06 May 2021 10:10:08 +0200 In-Reply-To: (Jason Kim's message of "Wed, 5 May 2021 12:55:07 -0700") X-Provags-ID: V03:K1:1qexrEGY2lngBCYUyKuSclFa99bPtRAPbXNW/WprDpyku0IVy05 sBJPdetiDs8fLtekQ5Uv11/WN1T3q27f809LSMGYR/piDr6Hyg0sIW0C2ImUTB58Ewadpa9 /nGx+Az/4YqLqqL6oM/OI/m/lYN6pPcTDAj99Pybp9833DGHj0Aax6HGQ3180pIo2FoIXEB Psu19gyB6ibDuWH4i3wEA== X-UI-Out-Filterresults: notjunk:1;V03:K0:OIAJOUdoKf4=:1+VuBQKjXmll/g/Y+yHw7V ddMvzelyo+tHCy0e7o4hZS8hR14KLjKyb9OFUbrwkfi8DtS3umH9j6S64phvYA7RdFWOenEWQ OvQbr89WlQA0UdG9PToJiEpF8BxsuJTdDwMrvIjcd2NUdLmnWbXZ7rV+rF3TMAU/iH1VPlbol EkA2ksGZ+8TzMf92bu5qm3QKRz1OrdIhs34bu8hsP95CgwUmdRLj32g9/IduacEpKeRbTaPSl UB7G1B+uawtnXnc2rHden2+vRASOqbhqBtSVijx0rKSHP1QNjfA1jVNU4O6q7JdEpmfdD9E/f SPUBFHzy5dCEVjyuqm6eSkC4MeBJBgPu2QFTZNGOW8VMsTrOy63c4ArrW6hsjj4gGaQovbX1m DbfFczLTpTwuTYaU92XzZ5k4QnoQniLwjndgIWIU0+0JZu7ZqzfMqM5lBs4dHfj8Hpb1bTgz3 nPv7KTvaVIeliC+Q4Et3WNRBQjzeeNW+NOPpWPmzwiiYxlUuCYBpBDiQySGGdcT43QFsoV8vs W0ZjnuJBaUhkPcxgnut/b0+DGcWIGqIEetJmzNku/g2kyzoE4uwqgw7Ta1akek6Idq9h5RGA/ jxbHvh3vNhEc/RlGZ3FR+KD0BYp2nHTmBa3gsblY95fTmJdosJ26sLJj2eWWZZMJ7G3v1PsIj W+YyeV/Yn8nQ+tFOjRCWgjSNxSJDQmT9xmZfEdi0x3AFNl8OrvG4adctdSP/n8QMePX5FNg3e xRqgScqBbdakXkWIoM61b31ep/xzxcOKudlvFiKkMSrgHIMvqdrT4gPvxFlngsBD0YZw3dVw Received-SPF: pass client-ip=212.227.15.15; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268950 Archived-At: Jason Kim writes: Hi Jason, > Hi, Please find enclosed a small patch against emacs-lisp (packaged > with emacs 26.3 on recent emacsen on recent ubuntu (20.4.0.2 ?) Thanks for this proposal. I don't use shell-process-cd myself, at least not explicitly, but I have some few comments: +(defvar shell-has-auto-cd nil + "if set to true, shell-mode assumes that a command that resolves to a d= irectory +is an implicit cd command. Useful for shells like zsh that has this featu= re.") - The docstring must be a complete sentence in the first line, starting with a capital letter, and finishing with a period. The separator between two sentences are newline or two (!) spaces. See the emacs documentation standards (info "(elisp) Documentation Tips") - I suppose you want to let people change this. So it should be rather a defcustom but a defvar. - The initial value could be more intelligent. Instead of using nil, you might check the used shell file name whether it matches, for example, "zsh$". - Several different shells could be used in an Emacs session, depending where you run the shell, locally or on a remote host. So it might be problematic to have just one fixed global value. > Thank you > -Jason Best regards, Michael.