From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#16260: 24.3.50; shell-command-completion and removal of exec-directory from exec-path Date: Wed, 20 Jan 2021 03:35:56 +0100 Message-ID: <87k0s85o8j.fsf@gnus.org> References: <83txdv4ave.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17900"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 16260@debbugs.gnu.org, Jarek Czekalski To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 20 03:37:14 2021 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 1l23Mw-0004Yh-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jan 2021 03:37:14 +0100 Original-Received: from localhost ([::1]:49224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l23Mv-00045L-6k for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jan 2021 21:37:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l23Mj-00041V-RV for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2021 21:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l23Mj-0001jL-Km for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2021 21:37:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l23Mj-0004xQ-ID for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2021 21:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jan 2021 02:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16260 X-GNU-PR-Package: emacs Original-Received: via spool by 16260-submit@debbugs.gnu.org id=B16260.161111017018977 (code B ref 16260); Wed, 20 Jan 2021 02:37:01 +0000 Original-Received: (at 16260) by debbugs.gnu.org; 20 Jan 2021 02:36:10 +0000 Original-Received: from localhost ([127.0.0.1]:52279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l23Lt-0004w1-Or for submit@debbugs.gnu.org; Tue, 19 Jan 2021 21:36:09 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:38900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l23Lr-0004vl-Bd for 16260@debbugs.gnu.org; Tue, 19 Jan 2021 21:36:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9bJD1mLLKVeV3+2iDnneddrRuByPR7wqGSYCDIKGUks=; b=oO2UT8beDEe1YptHQ+CXs9uAun +pbDFiOY4BB2dfhVkJO1zNJ1F1AVotScOzdER6wYoc1M3jBhjsz4c77DCbUGnMSFbioZKpN6B7SV6 9a9GSAeakXkjwFUmnkaO33IPY1GaIKxAhp69DLpffYD51HfeHJxiuMQooJhoMxoPIhiU=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l23Li-00085E-7h; Wed, 20 Jan 2021 03:36:00 +0100 X-Now-Playing: Idowu Odeyemi's _Nigeria 70 (No Wahala: Highlife, Afro-Funk & Juju 1973-1987)_: "Oni Suru" In-Reply-To: <83txdv4ave.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Dec 2013 22:26:29 +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" Xref: news.gmane.io gmane.emacs.bugs:198227 Archived-At: Eli Zaretskii writes: > shell--command-completion-data has this FIXME comment: > > (defun shell--command-completion-data () > "Return the completion data for the command at point." > (let* ((filename (or (comint-match-partial-filename) "")) > (start (if (zerop (length filename)) (point) (match-beginning 0))) > (end (if (zerop (length filename)) (point) (match-end 0))) > (filenondir (file-name-nondirectory filename)) > (path-dirs (cdr (reverse exec-path))) ;FIXME: Why `cdr'? This code now looks like: (path-dirs ;; Ignore `exec-directory', the last entry in `exec-path'. (append (cdr (reverse (exec-path))) (if (and (memq system-type '(windows-nt ms-dos)) (not (file-remote-p default-directory))) '(".")))) [...] > However, just clipping away the last member of exec-path list only > does TRT in the default case. It will not work if either of the > following happens: > > . The user changes epaths.h to specify more than a single directory > > . EMACSPATH is set in the environment > > To get this right, we should record at startup time the value of > exec-path before appending $PATH to it, and then filter out the > directories recorded at that time in shell--command-completion-data. I haven't looked further at this (since the FIXME is gone), but it this something that needs further work? > As a minor nit, the doc string of shell-dynamic-complete-command > should not talk about "library path", which is a non-existing term in > Emacs, but instead mention exec-directory. This doc string doesn't mention "library path" any more. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no