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.devel Subject: Re: Small shell-mode patch to handle auto-cd (e.g. shells like zsh) Date: Thu, 06 May 2021 11:23:01 +0300 Message-ID: <83v97we0ey.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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:24:28 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 1leZJ5-0004qx-H2 for ged-emacs-devel@m.gmane-mx.org; Thu, 06 May 2021 10:24:27 +0200 Original-Received: from localhost ([::1]:56302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leZJ4-0004ks-HF for ged-emacs-devel@m.gmane-mx.org; Thu, 06 May 2021 04:24:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leZHv-0003rn-Lw for emacs-devel@gnu.org; Thu, 06 May 2021 04:23:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50114) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leZHu-0001Ox-Uw; Thu, 06 May 2021 04:23:14 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3823 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1leZHt-0002qA-Ie; Thu, 06 May 2021 04:23:14 -0400 In-Reply-To: (message from Jason Kim on Wed, 5 May 2021 12:55:07 -0700) 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:268951 Archived-At: > From: Jason Kim > Date: Wed, 5 May 2021 12:55:07 -0700 > > 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 ?) > > I'd be more than happy to do the leg work to get it "install ready" but > may need some advice on how to do that. Thanks. Some comments on your patch: . We prefer patches relative to the current development sources on the master branch of the Emacs Git repository. Would it be possible for you to update the patch so it is relative to the latest sources? If so, please also send the diffs using the command "git format-patch", as it makes it easier to apply the diffs. . Please accompany the changeset with a ChangeLog-style commit log message; see the file CONTRIBUTE for the details of how to format the log message according to our conventions. . A few comments on the code itself: > +(defvar shell-has-auto-cd nil > + "if set to true, shell-mode assumes that a command that resolves to a directory > +is an implicit cd command. Useful for shells like zsh that has this feature.") This should be a defcustom, so that users could customize it easily. The first line of the doc string should be a single complete sentence. Something like this: If non-nil, `shell-mode' will automatically process implicit \"cd\" commands. (Then in the following text of the doc string explain what does "implicit cd command" mean in this context.) Should this variable's value be computed automatically based on the shell's name? > - end cmd arg1) > + end cmd arg1 cmdS) I wonder if you could find a more descriptive name for the cmdS variable.