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: [PATCH] em-cmpl: fix completion of command paths Date: Wed, 25 Jan 2023 19:15:12 +0200 Message-ID: <83ilgufsdb.fsf@gnu.org> References: <20230107121943.44658-1-nicolas@n16f.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38788"; mail-complaints-to="usenet@ciao.gmane.io" Cc: nicolas@n16f.net, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 25 18:15:22 2023 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 1pKjMn-0009rv-ID for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Jan 2023 18:15:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKjMU-0001VY-4k; Wed, 25 Jan 2023 12:15:02 -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 1pKjMT-0001V5-9X for emacs-devel@gnu.org; Wed, 25 Jan 2023 12:15:01 -0500 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 1pKjMS-0002x1-6X; Wed, 25 Jan 2023 12:15:00 -0500 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=O+MCZkpLE1Vh8es7odZvmgkExKZewr+TqidDMBnDW1I=; b=eZNewqFJeGMN Smpi1zU8EYuS89y7czFB1hSFzofpMP3z18+vJ5Lh8BUlI/AObtC8bzMwnNKqW5SdIX5pQgj/q7Wiq 3CvSjdQlCtb6911w5hlx4009djKRJ+tvqMcZAuAI4qgrRx1KAIZAFtqR2jH1nDtn7+hyvQd54geLv 9UXwUl/eiUsCf9e1ZNV9sDQxSxGgE6A7fYZv/fHomPlWhm3qlL9h1g72hvx90MyO77dc7iJLI5Mx4 hdORM+j4l47FciGyd8N1M7EhEpgycoLSpmiXn0rc8A4YAWKikhy9uAcP6RxUCZFbtnTXMHg1uaFdv 3s12Seyw0Zk3msjX5Bbo7g==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKjMR-0006gS-BE; Wed, 25 Jan 2023 12:14:59 -0500 In-Reply-To: (message from Stefan Monnier on Wed, 25 Jan 2023 12:03:38 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302654 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Wed, 25 Jan 2023 12:03:38 -0500 > > Hi Nicolas, > > Terribly sorry for the long delay to answer. > > > The use of `completion-table-dynamic' was introduced in 899055e to fix > > bug#48995. However the following issue remains: when completing a command > > path, absolute ("/usr/bin/") or relative ("./subdir/"), a space is > > automatically added at the end. > > Bypassing `completion-table-dynamic' for filenames containing a directory > > part fixes the final space bug and does not reintroduce bug#48995. > > This looks very good. > IIUC this fixes a regression w.r.t Emacs-28, so it would be nice to > install it into `emacs-29`. > > Eli, what do you think? Yes, this is okay for emacs-29. Just one nit: > > + ;; Do not use `completion-table-dynamic' when completing a command path > > + ;; (absolute or relative): doing so assumes that the subpath in the input > > + ;; string is always a command, and appends a space character, which is > > + ;; incorrect (i.e. "/usr/bi" should yield "/usr/bin/" after completion, > > + ;; not "/usr/bin/ "). Please use "file name", not "path", when referring to file or directory names. If you need to make it clear you are talking about absolute file name, use "absolute file name" or "file name with leading directories". GNU coding standards frown on using "path" for anything but PATH-style lists of directories. (Yes, I know that most of this text came from a comment in the original code.)