Received: (at 16260) by debbugs.gnu.org; 20 Jan 2021 02:36:10 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 19 21:36:10 2021 Received: from localhost ([127.0.0.1]:52279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1l23Lt-0004w1-Or for submit <at> debbugs.gnu.org; Tue, 19 Jan 2021 21:36:09 -0500 Received: from quimby.gnus.org ([95.216.78.240]:38900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1l23Lr-0004vl-Bd for 16260 <at> 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=; 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 <larsi@HIDDEN>) id 1l23Li-00085E-7h; Wed, 20 Jan 2021 03:36:00 +0100 From: Lars Ingebrigtsen <larsi@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#16260: 24.3.50; shell-command-completion and removal of exec-directory from exec-path References: <83txdv4ave.fsf@HIDDEN> X-Now-Playing: Idowu Odeyemi's _Nigeria 70 (No Wahala: Highlife, Afro-Funk & Juju 1973-1987)_: "Oni Suru" Date: Wed, 20 Jan 2021 03:35:56 +0100 In-Reply-To: <83txdv4ave.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 26 Dec 2013 22:26:29 +0200") Message-ID: <87k0s85o8j.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii <eliz@HIDDEN> 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-part [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16260 Cc: 16260 <at> debbugs.gnu.org, Jarek Czekalski <jarekczek@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Eli Zaretskii <eliz@HIDDEN> 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
bug-gnu-emacs@HIDDEN
:bug#16260
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 26 Dec 2013 20:26:55 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 26 15:26:55 2013 Received: from localhost ([127.0.0.1]:44529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1VwHWB-0005kT-4y for submit <at> debbugs.gnu.org; Thu, 26 Dec 2013 15:26:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49868) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <eliz@HIDDEN>) id 1VwHW9-0005kL-Ct for submit <at> debbugs.gnu.org; Thu, 26 Dec 2013 15:26:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1VwHVz-0003I7-RT for submit <at> debbugs.gnu.org; Thu, 26 Dec 2013 15:26:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1VwHVz-0003I3-PC for submit <at> debbugs.gnu.org; Thu, 26 Dec 2013 15:26:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1VwHVs-0000Gf-CK for bug-gnu-emacs@HIDDEN; Thu, 26 Dec 2013 15:26:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1VwHVk-0003H4-OY for bug-gnu-emacs@HIDDEN; Thu, 26 Dec 2013 15:26:36 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:52193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1VwHVk-0003G1-GG for bug-gnu-emacs@HIDDEN; Thu, 26 Dec 2013 15:26:28 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MYF00100KMWSG00@HIDDEN> for bug-gnu-emacs@HIDDEN; Thu, 26 Dec 2013 22:26:27 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MYF001ZWKS2OM50@HIDDEN>; Thu, 26 Dec 2013 22:26:27 +0200 (IST) Date: Thu, 26 Dec 2013 22:26:29 +0200 From: Eli Zaretskii <eliz@HIDDEN> Subject: 24.3.50; shell-command-completion and removal of exec-directory from exec-path X-012-Sender: halo1@HIDDEN To: bug-gnu-emacs@HIDDEN Message-id: <83txdv4ave.fsf@HIDDEN> X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: submit Cc: Jarek Czekalski <jarekczek@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii <eliz@HIDDEN> List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.6 (-----) 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'? As Jarek pointed out in his patch for bug #15461, the doc string of shell-dynamic-complete-command hints on the reason: This function is similar to `comint-dynamic-complete-filename', except that it searches `exec-path' (minus the trailing Emacs library path) for completion candidates. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It talks about "Emacs library path", but actually means the libexec directory, which is normally the value of exec-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. 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. In GNU Emacs 24.3.50.187 (i686-pc-mingw32) of 2013-12-26 on HOME-C4E4A596F7 Bzr revision: 115758 fgallina@HIDDEN Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --prefix=/d/usr --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-2 -g3'' Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x r e p o r t - e m <tab> <return> Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process w32notify w32 multi-tty emacs)
Eli Zaretskii <eliz@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#16260
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.