From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jason Kim Newsgroups: gmane.emacs.devel Subject: Re: Small shell-mode patch to handle auto-cd (e.g. shells like zsh) Date: Fri, 7 May 2021 09:35:16 -0700 Message-ID: References: <83v97we0ey.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22838"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 Cc: emacs-devel@gnu.org, shivers@cs.cmu.edu, jason.kim@revtera.com To: Eli Zaretskii , michael.albinus@gmx.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 07 18:39:16 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 1lf3VU-0005pg-C1 for ged-emacs-devel@m.gmane-mx.org; Fri, 07 May 2021 18:39:16 +0200 Original-Received: from localhost ([::1]:51026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lf3VT-0003SH-CA for ged-emacs-devel@m.gmane-mx.org; Fri, 07 May 2021 12:39:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lf3Ri-0001w0-CT for emacs-devel@gnu.org; Fri, 07 May 2021 12:35:22 -0400 Original-Received: from mr85p00im-ztdg06021101.me.com ([17.58.23.180]:52579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lf3Rg-0001xK-SH for emacs-devel@gnu.org; Fri, 07 May 2021 12:35:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1620405318; bh=Or+1U9DvWxGwmNGMSwhfKeVpqdZqPI5NxhDbXYqKgQI=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type; b=v14YuxasO5wMelRUkAmL1RWny8vCC+Q90UMlhG4pV+OOsiOMVU/2xlwFNf5uJqDi5 Y4PTO7yaEppgKpaodWJKQbEcmZQmieo0aA13M6+WcPQz8UwXy9rMUI5l3qc6DxMV8u /3Ds2Qx7Jxz/N33GsXvGG/z2kn+jLD0jC/xOUKAZmpikNEwUEQgejZ6xFkMek959Ux xlMA7Agz25ZH4YWNBjekp1rHRUmUZvdOGVqC6Cd62pHPHHyy0EAqXKB6GQdglpMtoo Akv6f03KBqNOtwo1YG5RqR3T7QrZl0ORC/XfJYXiWDEjFYc4tTok30tVEOB5n/FGEz Sg29pmhr/nL7Q== Original-Received: from [10.58.18.13] (unknown [143.244.48.59]) by mr85p00im-ztdg06021101.me.com (Postfix) with ESMTPSA id B11E234087C; Fri, 7 May 2021 16:35:17 +0000 (UTC) In-Reply-To: <83v97we0ey.fsf@gnu.org> Content-Language: en-US X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.391,18.0.761,17.0.607.475.0000000_definitions?= =?UTF-8?Q?=3D2021-05-07=5F04:2021-05-06=5F01,2021-05-07=5F04,2020-04-07?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 adultscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2105070110 Received-SPF: pass client-ip=17.58.23.180; envelope-from=jason.w.kim@icloud.com; helo=mr85p00im-ztdg06021101.me.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:269005 Archived-At: Working on it now, Expect the git format-patch shortly But just to set the stage.... a few comments. On 5/6/21 1:23 AM, Eli Zaretskii wrote: > > . 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. > done. > 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. Yep that's lot better :-) thanks! > > (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? I don't think so... If only because its an option that needs enabling in zsh as well? > >> - end cmd arg1) >> + end cmd arg1 cmdS) > > I wonder if you could find a more descriptive name for the cmdS > variable. cmdS --> cmd-subst-fn > michael.albinus@gmx.de writes >- 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. I'm confused...? Would making the variable buffer-local in a user's .emacs address this? dir tracking (for things like auto completion) never worked for me if I ssh into a different host from emacs-shell. (maybe because pattern globbing rules are more complex (optionally) in zsh?) What am I missing here? Can we skip this issue for now? (or does making the var buffer-local get around it?) Thank!!! -jason