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: Sat, 04 Jan 2014 06:33:02 +0100 Organization: Emacs Helm Message-ID: <874n5kfh0x.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388813649 27574 80.91.229.3 (4 Jan 2014 05:34:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jan 2014 05:34:09 +0000 (UTC) Cc: 16197@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 04 06:34:16 2014 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 1VzJsF-0002p4-BF for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jan 2014 06:34:15 +0100 Original-Received: from localhost ([::1]:53262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzJsE-0002gF-Qe for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jan 2014 00:34:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzJs7-0002fA-Gn for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 00:34:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzJs2-000468-CP for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 00:34:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzJs2-000464-8D for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 00:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VzJs1-0001AA-L7 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 00:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2014 05:34:01 +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: Original-Received: via spool by 16197-submit@debbugs.gnu.org id=B16197.13888136054409 (code B ref 16197); Sat, 04 Jan 2014 05:34:01 +0000 Original-Received: (at 16197) by debbugs.gnu.org; 4 Jan 2014 05:33:25 +0000 Original-Received: from localhost ([127.0.0.1]:32851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzJrQ-000192-TZ for submit@debbugs.gnu.org; Sat, 04 Jan 2014 00:33:25 -0500 Original-Received: from mail-wi0-f179.google.com ([209.85.212.179]:36860) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzJrP-00018s-5f for 16197@debbugs.gnu.org; Sat, 04 Jan 2014 00:33:23 -0500 Original-Received: by mail-wi0-f179.google.com with SMTP id z2so1138301wiv.0 for <16197@debbugs.gnu.org>; Fri, 03 Jan 2014 21:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=DmTNOfS6nXZwy//j3LYpZ4Mmvk0QiGzLuI4WPeKTr0c=; b=YIKkJqLjJ/+EgwtQeHJwTmLgMCZxQ/fzAHTl7ZxlSJ8eTA4RdBKDYDe2DRbNGAhlxz o+hTgfrZM3lfQuBVIDIpp3zA3BffCt51267SpxZmUma+5QvLA1IOn9NAwCeGFaMK5tST N2X/j6dIzKC6jDh6ulBEqazkDMaOICXMkNvxUDShEQSzRcteV7ebBNTcExZw06qm6ezf yI+Bx1rRuPgVP839srCAYcAjh6w8sR+cdTPq4mJiXMIXJV/asG+9fshp3sG3R47QQ0T0 d4kRjWJddWTt5Fw6kqNWbcHzAZfdoOs5jy1mQRlWFT1ShNCwzkNJV4+Pu2ctAoEpu0tf ayWQ== X-Received: by 10.180.149.175 with SMTP id ub15mr4521639wib.44.1388813602169; Fri, 03 Jan 2014 21:33:22 -0800 (PST) Original-Received: from dell-14z ([37.162.86.180]) by mx.google.com with ESMTPSA id cy10sm37019924wjb.6.2014.01.03.21.33.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 03 Jan 2014 21:33:21 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Fri, 03 Jan 2014 17:53:00 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:82891 Archived-At: Stefan Monnier writes: >> Maybe because you are using pcomplete-match with an hard coded value of >> 0 for index.(Not tested) > > Not sure who "you" is. Whoever wrote pcomplete/tar. > I'm afraid your description of the problem, solutions, and problems of > those solutions is a bit too cryptic for me. > > Here's my starting point: > - I understand that currently pcomplete does not provide completion for > "sudo" and it would be nice to add it. > - "sudo" is not particularly special, so whatever solution is used for > it should also work for many other commands. > - There is already pcomplete/xargs and pcomplete/rsh. Don't know what */rsh does, but */xargs is actually not working. Same for tar as described in previous posts. > Can pcomplete/sudo use the same approach as pcomplete/xargs and pcomplete/rsh? > If not, why not? Well I didn't read */xargs, but here are the problems: - `pcomplete-command-name' actually is always returning the first arg of command line e.g for "sudo apt-get" it is returning "sudo". - `shell-command-completion' is trying to complete after what `shell-backward-command' returns, which is actually the first command near prompt or "[&;|]+ ", so when you try to complete after sudo or xargs, you call the completion against "sudo" or "xargs" which returns nothing of course. Actually the fix made to these two functions is affecting only sudo, but I can easily fix it to handle also 'xargs'. > If yes but there are still problems, do those problems also affect > pcomplete/xargs and pcomplete/rsh? > If not, why not? > > If yes, then let's first focus on fixing pcomplete/xargs. Don't think so, I think the problem should be fixed at another level as descripted above. You can look at the code here: https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997