From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Tue, 24 Dec 2013 07:59:05 +0100 Organization: Emacs Helm Message-ID: <8738lispja.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387868416 28302 80.91.229.3 (24 Dec 2013 07:00:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2013 07:00:16 +0000 (UTC) To: 16197@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 24 08:00:22 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VvLyY-0004AS-1d for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 08:00:22 +0100 Original-Received: from localhost ([::1]:36811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvLyX-0000O1-J2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 02:00:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvLyN-0000Np-OJ for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 02:00:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvLyH-0008Gh-50 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 02:00:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvLyH-0008GC-2f for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 02:00:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VvLyE-0007rc-JE for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 02:00:03 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87fvpolyuk.fsf@gmail.com> Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2013 07:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138786838130170 (code B ref -1); Tue, 24 Dec 2013 07:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Dec 2013 06:59:41 +0000 Original-Received: from localhost ([127.0.0.1]:37478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvLxs-0007qY-HV for submit@debbugs.gnu.org; Tue, 24 Dec 2013 01:59:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50555) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvLxo-0007qL-CG for submit@debbugs.gnu.org; Tue, 24 Dec 2013 01:59:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvLxh-00082N-DP for submit@debbugs.gnu.org; Tue, 24 Dec 2013 01:59:35 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvLxh-00082I-A7 for submit@debbugs.gnu.org; Tue, 24 Dec 2013 01:59:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvLxb-0000HE-CU for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 01:59:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvLxV-00080m-C3 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 01:59:23 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:35518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvLxV-00080i-53 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 01:59:17 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VvLxT-0003DW-Q3 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 07:59:15 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Dec 2013 07:59:15 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Dec 2013 07:59:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:xNm1kjmU9MS7Ud+HnXEgSj/1ecU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82490 Archived-At: Thierry Volpiatto writes: > Thierry Volpiatto writes: > >> With this I have completion on arguments of commands entered after >> "sudo" (only in eshell though, not shell for the moment) and emacs is >> not crashing when hitting TAB. > > Now I have the completion in shell also, for this > `shell-command-completion' have to be redefined. > > (defun shell-command-completion () > "Return the completion data for the command at point, if any." > (let ((filename (comint-match-partial-filename)) > (args (split-string > (buffer-substring-no-properties > (point) (save-excursion (shell-backward-command 1) (point)))))) > (if (and filename > (save-match-data (not (string-match "[~/]" filename))) > (and (string= (car args) "sudo") > (string= filename (cadr args)))) > (shell--command-completion-data)))) > > HTH, though the crash happening above should not happen. So now my completion commands are working both with sudo and without, the needed modifications are here if somebody is interested to fix this bug: https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el Note that all pcomplete/* commands provided in emacs are not working with "sudo". -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997