From unknown Sat Jun 21 10:27:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16197 <16197@debbugs.gnu.org> To: bug#16197 <16197@debbugs.gnu.org> Subject: Status: 24.3.50; no completion on commands following "sudo" in shell and eshell Reply-To: bug#16197 <16197@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:27:27 +0000 retitle 16197 24.3.50; no completion on commands following "sudo" in shell = and eshell reassign 16197 emacs submitter 16197 Thierry Volpiatto severity 16197 minor tag 16197 patch fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 20 03:19:04 2013 Received: (at submit) by debbugs.gnu.org; 20 Dec 2013 08:19:04 +0000 Received: from localhost ([127.0.0.1]:59439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VtvIU-0007Eg-SR for submit@debbugs.gnu.org; Fri, 20 Dec 2013 03:19:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33845) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VtvIR-0007EA-QI for submit@debbugs.gnu.org; Fri, 20 Dec 2013 03:19:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtvIL-0008PW-HC for submit@debbugs.gnu.org; Fri, 20 Dec 2013 03:18:59 -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.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvIL-0008PS-ED for submit@debbugs.gnu.org; Fri, 20 Dec 2013 03:18:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvIF-0002VQ-Ff for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtvI9-0008NV-Hz for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:18:47 -0500 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:43906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvI9-0008NM-6v for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:18:41 -0500 Received: by mail-wi0-f176.google.com with SMTP id hq4so8014783wib.15 for ; Fri, 20 Dec 2013 00:18:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=xeSDUoyEld042OPEG3xbltjlmT/Fb9PjJGRnUGZdAaw=; b=yg3x61XUgRLLRsOyWJl90EoIp8I6V+lX4nSMEgQTNuxwPw28Wtp2U35H2lRjLvvz/l VWLKjaMiiuuF/+16aLrmHVjd9l+E8V2XqYrukCE2twIWx/wga0mPiilIenMuqC+Lr3AD RIPh6tNRQ790wcGEEyQo27cBqwu1eblcKapbGGeHjOrItEQuA3Pq3C8nR4OpfGRKHaYp PqUdLxIiUMpEycvKfz4u9DJP/qO8GSfiPrV/Sp1UgCOQ92or0C2FLzMFZZAi0ntZg7tJ hq9EHCOAqQgT6FPNDzBwUF7raKMUZxg+jHjDLeK/X4zCY2cV5IqeDThQJ0y+qhbUFcYo wiwg== X-Received: by 10.194.84.72 with SMTP id w8mr980893wjy.55.1387527519928; Fri, 20 Dec 2013 00:18:39 -0800 (PST) Received: from dell-14z (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPSA id c1sm1867791wje.4.2013.12.20.00.18.38 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 00:18:39 -0800 (PST) From: Thierry Volpiatto To: bug-gnu-emacs@gnu.org Subject: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Fri, 20 Dec 2013 09:18:27 +0100 Message-ID: <87fvpolyuk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hi all, shell and eshell are not completing commands after "sudo". For eshell what is needed is a `pcomplete/sudo' function: --8<---------------cut here---------------start------------->8--- (defun pcomplete/sudo () (let ((prec (pcomplete-arg 'last -1))) (cond ((string= "sudo" prec) (while (pcomplete-here* (funcall pcomplete-command-completion-function) (pcomplete-arg 'last) t)))))) --8<---------------cut here---------------end--------------->8--- For shell modify `shell-command-completion' something like this: --8<---------------cut here---------------start------------->8--- (defun shell-command-completion () "Return the completion data for the command at point, if any." (let ((filename (comint-match-partial-filename)) start) (if (and filename (save-match-data (not (string-match "[~/]" filename))) (eq (setq start (match-beginning 0)) (save-excursion (shell-backward-command 1) (if (looking-at "sudo") start (point))))) (shell--command-completion-data)))) --8<---------------cut here---------------end--------------->8--- In GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, X toolkit) of 2013-12-19 on dell-14z Windowing system distributor `The X.Org Foundation', version 11.0.11103000 System Description: Ubuntu 12.04.3 LTS Configured using: `configure --with-x-toolkit=lucid --without-toolkit-scroll-bars --without-gconf --without-gsettings' Important settings: value of $LC_MONETARY: fr_FR.UTF-8 value of $LC_NUMERIC: fr_FR.UTF-8 value of $LC_TIME: fr_FR.UTF-8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: diff-auto-refine-mode: t TeX-PDF-mode: t psession-mode: t global-semanticdb-minor-mode: t global-semantic-idle-scheduler-mode: t semantic-mode: t golden-ratio-mode: t winner-mode: t global-undo-tree-mode: t undo-tree-mode: t auto-image-file-mode: t eldoc-in-minibuffer-mode: t show-paren-mode: t display-time-mode: t recentf-mode: t savehist-mode: t eldoc-mode: t minibuffer-depth-indicate-mode: t helm-mode: t helm-descbinds-mode: t shell-dirtrack-mode: t helm-adaptative-mode: t helm-match-plugin-mode: t helm-occur-match-plugin-mode: t tooltip-mode: t electric-indent-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: s t a r t C-M-x s h s u d o SPC f d C-x C-b C-M-SPC M-w s h c a t SPC . e m a c s SPC | SPC s u d o SPC g r e p C-x C-b s h s u d o SPC a p t - g SPC | SPC g r e C-x C-b M-x r e p o r t Recent messages: Result: 34 (#o42, #x22, ?\") Result: 34 (#o42, #x22, ?\") Result: nil Back to top level. Auto-saving... shell-command-completion [2 times] Mark set Auto-saving...done Load-path shadows: /usr/local/share/emacs/24.3.50/lisp/gnus/.dir-locals hides ~/elisp/magit/.dir-locals ~/elisp/auctex/lpath hides ~/elisp/emacs-wget/lpath /usr/local/share/emacs/24.3.50/lisp/emacs-lisp/tq hides ~/elisp/emms/lisp/tq Features: (shadow epa-mail emacsbug helm-command edebug debug helm-dabbrev cl-indent help-mode helm-eshell helm-ring helm-sys magit-cherry magit-bisect magit-log-edit log-edit add-log magit-key-mode magit view iswitchb ido ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff diff-mode magit-compat smiley gnus-cite flow-fill mm-archive mail-extr gnus-async gnus-bcklg gnus-ml nndraft nnmh utf-7 nnimap utf7 nnml nnfolder parse-time netrc network-stream starttls tls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-dired nnir gnus-sum gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range gnus-win semantic/bovine/c hideif semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc semantic/bovine semantic/analyze/refs semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs preview prv-emacs tex-buf reftex-dcr reftex-auc reftex imenu reftex-vars font-latex latex tex-style tex dbus crm latexenc vc-rcs sh-script smie executable vc-hg semantic/tag-file semantic/db-file data-debug cedet-files semantic/wisent/python semantic/decorate/include semantic/db-find semantic/db-ref semantic/decorate/mode semantic/decorate pulse semantic/dep semantic/wisent/python-wy semantic/wisent semantic/wisent/wisent markdown-mode vc-git naquadah-theme em-unix em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias align-let git-gutter server persistent-sessions semantic/db-mode semantic/db eieio-base semantic/idle semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet package golden-ratio winner undo-tree diff image-file newsticker newst-treeview newst-plainview newst-reader newst-ticker newst-backend shr xdvi-search preview-latex tex-site auto-loads pcomplete-extension em-term term disp-table ehelp helm-ipython helm-elisp helm-eval python rx eldoc-eval warnings whitespace paren time avoid recentf tree-widget savehist smtpmail-async smtpmail sendmail helm-async iterator simple-call-tree iedit-rect rect iedit iedit-lib smallurl mm-url gnus gnus-ems nnheader wid-edit rectangle-utils ledger-config ledger esh-var esh-io esh-cmd esh-opt esh-ext esh-proc eldoc esh-groups eshell esh-module esh-mode esh-arg esh-util tv-utils async pcvs vc-cvs pcvs-parse pcvs-info pcvs-defs pcvs-util ewoc mb-depth cl-info slime-autoloads esh-toggle flymake no-word htmlize dired-extension emms-mpd-config emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time emms-lyrics emms-url hl-line emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mplayer emms-info emms-streams later-do emms-source-playlist emms-source-file emms-player-simple emms-setup emms emms-compat org-config-thierry ob-sh cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs appt diary-lib diary-loaddefs org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m org-agenda org-annotation-helper addressbook-bookmark message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader firefox-protocol bookmark-firefox-handler bookmark-extensions init-helm-thierry helm-mode helm-dictionary helm-ls-git helm-descbinds helm-ls-hg helm-files image-dired tramp tramp-compat tramp-loaddefs trampver shell dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark helm-adaptative helm-info helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap helm-plugin bookmark pp helm-help helm-match-plugin helm-grep wgrep-helm wgrep helm-regexp grep helm-external helm-utils dired compile helm-locate helm vc vc-dispatcher helm-config helm-aliases epa-file epa derived epg epg-config auth-source eieio eieio-core gnus-util mm-util mail-prsvr password-cache info cl-macs gv edmacro kmacro org-crypt org byte-opt bytecomp byte-compile cconv advice help-fns org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities time-date noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu easymenu calendar cal-loaddefs net-utils cl cl-loaddefs cl-lib tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd 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 dbusbind gfilenotify dynamic-setting font-render-setting x-toolkit x multi-tty emacs) -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 03:36:53 2013 Received: (at submit) by debbugs.gnu.org; 23 Dec 2013 08:36:54 +0000 Received: from localhost ([127.0.0.1]:35292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv10O-00057c-UP for submit@debbugs.gnu.org; Mon, 23 Dec 2013 03:36:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49248) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv10K-00057R-TQ for submit@debbugs.gnu.org; Mon, 23 Dec 2013 03:36:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv10B-0008J3-33 for submit@debbugs.gnu.org; Mon, 23 Dec 2013 03:36:48 -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.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv10B-0008Iy-07 for submit@debbugs.gnu.org; Mon, 23 Dec 2013 03:36:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv103-00024a-KH for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 03:36:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv0zw-0008HL-4T for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 03:36:31 -0500 Received: from plane.gmane.org ([80.91.229.3]:38943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv0zv-0008GO-RE for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 03:36:24 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Vv0zu-0006vq-2G for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 09:36:22 +0100 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 ; Mon, 23 Dec 2013 09:36:22 +0100 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 ; Mon, 23 Dec 2013 09:36:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Mon, 23 Dec 2013 09:36:08 +0100 Organization: Emacs Helm Lines: 79 Message-ID: <87zjnshslj.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain 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:inclvf1r6y3m7JRUlXWRG20VG1I= 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Thierry Volpiatto writes: > Hi all, > shell and eshell are not completing commands after "sudo". > > For eshell what is needed is a `pcomplete/sudo' function: > > (defun pcomplete/sudo () > (let ((prec (pcomplete-arg 'last -1))) > (cond ((string= "sudo" prec) > (while (pcomplete-here* > (funcall pcomplete-command-completion-function) > (pcomplete-arg 'last) t)))))) > > For shell modify `shell-command-completion' something like this: > > (defun shell-command-completion () > "Return the completion data for the command at point, if any." > (let ((filename (comint-match-partial-filename)) > start) > (if (and filename > (save-match-data (not (string-match "[~/]" filename))) > (eq (setq start (match-beginning 0)) > (save-excursion (shell-backward-command 1) > (if (looking-at "sudo") > start (point))))) > (shell--command-completion-data)))) > However this is not enough if one wants completion on arguments entered after the command that is after "sudo". For this the pcomplete/sudo function should looks like this: --8<---------------cut here---------------start------------->8--- (defun pcomplete/sudo () (let ((prec (pcomplete-arg 'last -1))) (cond ((string= "sudo" prec) (while (pcomplete-here* (funcall pcomplete-command-completion-function) (pcomplete-arg 'last) t))) (t (funcall (or (pcomplete-find-completion-function (pcomplete-command-name)) pcomplete-default-completion-function)))))) --8<---------------cut here---------------end--------------->8--- However it still not working with this definition because `pcomplete-command-name' is bad defined, thus it is crashing emacs maybe because it sometimes try to do (file-name-nondirectory nil). (Haven't debugged this yet). So the function should be redefined something like this: --8<---------------cut here---------------start------------->8--- (defun pcomplete-command-name () "Return the command name of the first argument." (let ((com (pcomplete-arg 'first)) (com1 (pcomplete-arg 'first 1)) (com2 (pcomplete-arg 'last -1)) (com3 (pcomplete-arg 'last))) (cond ((and (stringp com) (stringp com1) (not (string= com1 "")) (string= com "sudo")) (file-name-nondirectory com1)) ((and (stringp com2) (string= com2 "sudo") (not (string= com3 ""))) (file-name-nondirectory com3)) (t (file-name-nondirectory com))))) --8<---------------cut here---------------end--------------->8--- 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. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 05:22:40 2013 Received: (at submit) by debbugs.gnu.org; 23 Dec 2013 10:22:40 +0000 Received: from localhost ([127.0.0.1]:35388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv2em-00011v-3t for submit@debbugs.gnu.org; Mon, 23 Dec 2013 05:22:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38514) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv2ek-00011o-Fw for submit@debbugs.gnu.org; Mon, 23 Dec 2013 05:22:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv2ea-0003yL-VL for submit@debbugs.gnu.org; Mon, 23 Dec 2013 05:22:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv2ea-0003yG-Rz for submit@debbugs.gnu.org; Mon, 23 Dec 2013 05:22:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv2eT-0008VF-C6 for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 05:22:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv2eJ-0003c6-50 for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 05:22:21 -0500 Received: from plane.gmane.org ([80.91.229.3]:54108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv2eI-0003bj-UM for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 05:22:11 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Vv2eH-0005ru-OQ for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 11:22:09 +0100 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 ; Mon, 23 Dec 2013 11:22:09 +0100 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 ; Mon, 23 Dec 2013 11:22:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Mon, 23 Dec 2013 11:21:59 +0100 Organization: Emacs Helm Lines: 29 Message-ID: <87vbyfoojc.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain 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:vDFB+b2Qr8qeEB9UxAA7ddB72Bg= 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) 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. --8<---------------cut here---------------start------------->8--- (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)))) --8<---------------cut here---------------end--------------->8--- HTH, though the crash happening above should not happen. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 24 01:59:41 2013 Received: (at submit) by debbugs.gnu.org; 24 Dec 2013 06:59:41 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 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 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 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 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 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 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 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/ To: bug-gnu-emacs@gnu.org From: Thierry Volpiatto Subject: Re: 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 Lines: 37 Message-ID: <8738lispja.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 24 05:50:11 2013 Received: (at submit) by debbugs.gnu.org; 24 Dec 2013 10:50:11 +0000 Received: from localhost ([127.0.0.1]:37858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvPYx-0008F0-47 for submit@debbugs.gnu.org; Tue, 24 Dec 2013 05:50:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56808) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvPYu-0008Er-4o for submit@debbugs.gnu.org; Tue, 24 Dec 2013 05:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvPYn-0000dK-IU for submit@debbugs.gnu.org; Tue, 24 Dec 2013 05:50:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvPYn-0000d7-GE for submit@debbugs.gnu.org; Tue, 24 Dec 2013 05:50:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvPYh-0004Ku-Ir for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 05:50:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvPYb-0000Zy-OA for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 05:49:55 -0500 Received: from plane.gmane.org ([80.91.229.3]:49038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvPYb-0000Zs-Hb for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 05:49:49 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VvPYZ-0000JV-RP for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 11:49:47 +0100 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 11:49:47 +0100 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 11:49:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Tue, 24 Dec 2013 11:49:37 +0100 Organization: Emacs Helm Lines: 31 Message-ID: <8738licym6.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain 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:6OcqdZfr2hA+o0a8A+tjjMfjZ6A= 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Thierry Volpiatto writes: > 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". They are now working (pcomplete/tar etc...) with the last version of pcomplete-extension.el, but entering multiples args (with and without sudo and from emacs- Q) is not working at all (on second arg it try to complete filenames) e.g (cursor is "!") emacs -Q M-x shell tar -! TAB => ok I have completion on options. tar -z -! TAB => I have completion on filenames. Maybe because you are using pcomplete-match with an hard coded value of 0 for index.(Not tested) Completions provided in pcomplete-extension.el are allowing doing this when needed. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 03 17:53:03 2014 Received: (at 16197) by debbugs.gnu.org; 3 Jan 2014 22:53:03 +0000 Received: from localhost ([127.0.0.1]:60672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzDbz-0005q5-78 for submit@debbugs.gnu.org; Fri, 03 Jan 2014 17:53:03 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52339) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzDbx-0005pW-Fw for 16197@debbugs.gnu.org; Fri, 03 Jan 2014 17:53:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rwsm/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSQuh3AGwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av8EABK/CFG4rwsm/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSQuh3AGwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="43928139" Received: from 184-175-11-38.dsl.teksavvy.com (HELO pastel.home) ([184.175.11.38]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Jan 2014 17:53:00 -0500 Received: by pastel.home (Postfix, from userid 20848) id 79D8E6013A; Fri, 3 Jan 2014 17:53:00 -0500 (EST) From: Stefan Monnier To: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Message-ID: References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> Date: Fri, 03 Jan 2014 17:53:00 -0500 In-Reply-To: <8738licym6.fsf@gmail.com> (Thierry Volpiatto's message of "Tue, 24 Dec 2013 11:49:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Maybe because you are using pcomplete-match with an hard coded value of > 0 for index.(Not tested) Not sure who "you" is. 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. Can pcomplete/sudo use the same approach as pcomplete/xargs and pcomplete/rsh? If not, why not? 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. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 04 00:33:25 2014 Received: (at 16197) by debbugs.gnu.org; 4 Jan 2014 05:33:25 +0000 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 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 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) 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) From: Thierry Volpiatto To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Organization: Emacs Helm References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> Date: Sat, 04 Jan 2014 06:33:02 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 03 Jan 2014 17:53:00 -0500") Message-ID: <874n5kfh0x.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 04 02:11:58 2014 Received: (at submit) by debbugs.gnu.org; 4 Jan 2014 07:11:58 +0000 Received: from localhost ([127.0.0.1]:32907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzLOo-0003y8-1h for submit@debbugs.gnu.org; Sat, 04 Jan 2014 02:11:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58768) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzLOl-0003xz-QR for submit@debbugs.gnu.org; Sat, 04 Jan 2014 02:11:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzLOe-0003tQ-Sm for submit@debbugs.gnu.org; Sat, 04 Jan 2014 02:11:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FSL_HELO_BARE_IP_2,RCVD_NUMERIC_HELO autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzLOe-0003tI-P5 for submit@debbugs.gnu.org; Sat, 04 Jan 2014 02:11:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzLOY-0003fu-R6 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 02:11:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzLOS-0003Z6-TT for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 02:11:42 -0500 Received: from plane.gmane.org ([80.91.229.3]:39411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzLOS-0003Yt-Nc for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 02:11:36 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VzLOQ-00078A-4E for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 08:11:34 +0100 Received: from 37.162.86.180 ([37.162.86.180]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Jan 2014 08:11:34 +0100 Received: from thierry.volpiatto by 37.162.86.180 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Jan 2014 08:11:34 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Sat, 04 Jan 2014 08:11:22 +0100 Organization: Emacs Helm Lines: 23 Message-ID: <87zjncdxwl.fsf@gmail.com> References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 37.162.86.180 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:bkZPN6bBaZRVtLxb/Doen1oGsK8= 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) Thierry Volpiatto writes: > You can look at the code here: > > https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el I have fixed code for xargs. I also have a look at `pcomplete/xargs': As explained previously it it just calling `shell-command-completion', which is looking at the first arg returned by `shell-backward-command'. At best it would work with a command line starting with 'xargs' which is not really useful, but it doesn't anyway, try it in emacs -Q. I also find pcomplete/ssh: It complete args but only the first not the second. i.e ssh -f -! =>no completions. Probably others have this problem. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 04 15:27:05 2014 Received: (at 16197) by debbugs.gnu.org; 4 Jan 2014 20:27:05 +0000 Received: from localhost ([127.0.0.1]:34356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzXoG-0003EX-JX for submit@debbugs.gnu.org; Sat, 04 Jan 2014 15:27:05 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:5121) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzXoC-0003E5-Ty for 16197@debbugs.gnu.org; Sat, 04 Jan 2014 15:27:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rwsm/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GDMEdBJEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFG4rwsm/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GDMEdBJEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="43994409" Received: from 184-175-11-38.dsl.teksavvy.com (HELO pastel.home) ([184.175.11.38]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Jan 2014 15:26:59 -0500 Received: by pastel.home (Postfix, from userid 20848) id BCF45604AC; Sat, 4 Jan 2014 15:26:59 -0500 (EST) From: Stefan Monnier To: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Message-ID: References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> Date: Sat, 04 Jan 2014 15:26:59 -0500 In-Reply-To: <874n5kfh0x.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 04 Jan 2014 06:33:02 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Don't know what */rsh does, but */xargs is actually not working. Aha! > 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. Can you describe those problems in terms of user-visible behavior (i.e. a recipe) so I can better understand what the code does (and should do instead)? > Actually the fix made to these two functions is affecting only sudo, but > I can easily fix it to handle also 'xargs'. That would be nice. > Don't think so, I think the problem should be fixed at another level as > descripted above. I missed the description, I'm afraid. > https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el Not sure what I should look at there. Can you send it as a patch against pcmpl-unix.el to fix pcomplete/xargs (and add pcomplete/sudo at the same time)? Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 05 02:36:10 2014 Received: (at 16197) by debbugs.gnu.org; 5 Jan 2014 07:36:10 +0000 Received: from localhost ([127.0.0.1]:35072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VziFl-00069r-6F for submit@debbugs.gnu.org; Sun, 05 Jan 2014 02:36:09 -0500 Received: from mail-we0-f178.google.com ([74.125.82.178]:59471) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VziFi-00069i-5P for 16197@debbugs.gnu.org; Sun, 05 Jan 2014 02:36:07 -0500 Received: by mail-we0-f178.google.com with SMTP id u57so14940478wes.9 for <16197@debbugs.gnu.org>; Sat, 04 Jan 2014 23:36:05 -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=QSi1Vd2zA2Gb4+zv6+Z4JzdZcvwh91BHm8EhXYFXM2c=; b=B51byCharqXRcbxlL7QNjhxLZ1VVwUQ+gQyDlVIGnHtDOFi0Ze5n1hASGAAluQxeNM hahTlw0livIXEf2ewZusYGw7CrN1knXYd7v4KpsRb1If0kixVTFcO3okGB7A6uTzvmwc eWI12Z3XBDYgGS5udC78dUD27/MoJVDSAwMeEzxDgEjkPAcbowAgCCruM84HqVvOs77J zZJceE8qYnVW2DRxWdCPKR0jbmyeJ2wXdElwlphqMf5Xa2o9qxZBTpsqx1LFjn99gM3W 2qfoV/UpZkP6BAC1BpXyAqx7FIZ0XPeCC0kbYX08IV17+wr4hf3qQJRne2EwMDTzmBub DpZQ== X-Received: by 10.180.13.74 with SMTP id f10mr7800222wic.34.1388907365212; Sat, 04 Jan 2014 23:36:05 -0800 (PST) Received: from dell-14z (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPSA id pl7sm39463345wjc.16.2014.01.04.23.36.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 04 Jan 2014 23:36:04 -0800 (PST) From: Thierry Volpiatto To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Organization: Emacs Helm References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> Date: Sun, 05 Jan 2014 08:35:57 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 04 Jan 2014 15:26:59 -0500") Message-ID: <8738l2hode.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: >> Don't know what */rsh does, but */xargs is actually not working. > > Aha! > >> 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. > > Can you describe those problems in terms of user-visible behavior > (i.e. a recipe) so I can better understand what the code does (and > should do instead)? (! is the cursor) emacs -Q M-x shell $ find . -name '*.el' | xargs et! Press TAB, nothing, no completion against "et". M-: (shell-backward-command) I have now the cursor at xargs: $ find . -name '*.el' | !xargs et To provide completion against "et" I should have the cursor at: $ find . -name '*.el' | xargs !et after evaling (shell-backward-command). Now download and load: https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el And repeat the same recipe. For `pcomplete-command-name' it is harder to give a recipe, the best is to edebug it to have an idea (be careful the actual version is crashing emacs sometimes). >> Actually the fix made to these two functions is affecting only sudo, but >> I can easily fix it to handle also 'xargs'. > > That would be nice. Done in pcomplete-extension.el. >> Don't think so, I think the problem should be fixed at another level as >> descripted above. > > I missed the description, I'm afraid. > >> https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el > > Not sure what I should look at there. - pcomplete/sudo - shell-backward-command - pcomplete-command-name > Can you send it as a patch against pcmpl-unix.el to fix pcomplete/xargs > (and add pcomplete/sudo at the same time)? Not only against pcmpl-unix.el I think: * pcmpl-unix.el: Add `pcomplete/sudo'. * pcomplete.el: Redefine `pcomplete-command-name'. * shell.el: Redefine `shell-backward-command'. Not urgent: I would be happy to give also pcomplete/find,hg,ls,apt-get. Not sure where they would go in this case, pcmpl-linux? unix? gnu? Also more things to fix are `pcomplete/tar', `pcomplete/ssh' and maybe others (allow completion on more than one arg), but I haven't worked on this already. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 08:12:00 2014 Received: (at 16197) by debbugs.gnu.org; 7 Jan 2014 13:12:01 +0000 Received: from localhost ([127.0.0.1]:40469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0WRr-0002Dw-6M for submit@debbugs.gnu.org; Tue, 07 Jan 2014 08:12:00 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:40526) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0WRo-0002Dl-LX for 16197@debbugs.gnu.org; Tue, 07 Jan 2014 08:11:57 -0500 Received: by mail-wg0-f45.google.com with SMTP id y10so121945wgg.12 for <16197@debbugs.gnu.org>; Tue, 07 Jan 2014 05:11:55 -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=c+Ab6lHu5jqNI/TDDi8XV/W9S3vjLx0lDBHW30eucyc=; b=ePrWb5wQVN7dFNeePODmw2VEaS/dJl3/u43O0qciVD3sJSWiMV95WzIyBNE867zyqW k73rb1bB+e3V4suXB8m1NEjnWbyLuN4iJCnRQPzNEE5tswqYIoOgt4kf8sgFjewWWf7s 7upp4vmXDlwcccab6k5fLmTo2TbWsb4k9sxi6C79DCoi394wzunXdV+6jfBAHPfeCU9e wyHDX014HBzLfihntqUUXR+h9x3NeCnfBS+PdoowK63eEt2dnC0InxkFodoVBS6qFh/A N1NoC5qaOLSkUcVamV1QJg+ASlh07zhHNjFeK1qlD7CDw3qeHUMov4tlqMdzj92F4x0K 5Gpg== X-Received: by 10.194.237.226 with SMTP id vf2mr6325338wjc.58.1389100315654; Tue, 07 Jan 2014 05:11:55 -0800 (PST) Received: from dell-14z ([37.160.108.159]) by mx.google.com with ESMTPSA id d2sm3469974wik.11.2014.01.07.05.11.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 07 Jan 2014 05:11:54 -0800 (PST) From: Thierry Volpiatto To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Organization: Emacs Helm References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> Date: Tue, 07 Jan 2014 14:11:39 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 04 Jan 2014 15:26:59 -0500") Message-ID: <87bnzoueb8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: >> https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el > > Not sure what I should look at there. For a quick test, you can load this file and do the following tests in `shell' and/or `eshell': ;; Tests ;; find . -name '*.el' | xargs et =>ok ;; sudo apt-g =>ok ;; sudo apt-get in =>ok ;; sudo apt-get -- =>ok ;; sudo apt-get - =>ok ;; sudo apt-get -V - =>ok ;; sudo apt-get -V -- =>ok ;; sudo apt-get --reinstall ins =>ok ;; sudo apt-get --reinstall install em =>ok ;; sudo - =>ok ;; sudo -p "pass" - =>ok ;; sudo -p "pass" apt-g =>ok ;; sudo -p "pass" apt-get ins =>ok ;; apt-get in =>ok ;; apt-get install em =>ok Tell me if something went wrong on these tests or if you have other cases that are not working. NOTE: [...] | xargs -0 foo is not working yet because args are not handled in pcomplete/xargs. I would do it later if you accept the patch below. > Can you send it as a patch against pcmpl-unix.el to fix pcomplete/xargs > (and add pcomplete/sudo at the same time)? * lisp/pcml-unix.el (pcomplete/sudo): New. * lisp/pcomplete.el (pcomplete-command-name): Allow extracting command-name in more complex command lines. * lisp/shell.el (shell-command-completion-function): Fix it (was not working at all). --8<---------------cut here---------------start------------->8--- Changes from master to stash 3 files changed, 52 insertions(+), 4 deletions(-) lisp/pcmpl-unix.el | 16 ++++++++++++++++ lisp/pcomplete.el | 35 ++++++++++++++++++++++++++++++++++- lisp/shell.el | 5 ++--- Modified lisp/pcmpl-unix.el diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index 6ac3e15..1c55f67 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -215,6 +215,22 @@ Includes files as well as host names followed by a colon." (pcmpl-ssh-hosts))))))) (complete-with-action action table string pred)))))) +(defun pcomplete/sudo () + (let ((pcomplete-cmd-name (pcomplete-command-name))) + (while (and (string= "sudo" pcomplete-cmd-name) + (pcomplete-match "^-" 'last)) + (when (< pcomplete-index pcomplete-last) + (pcomplete-next-arg)) + (pcomplete-opt "AbCDEegHhiKknPpSsUuVv-")) + (cond ((string= "sudo" pcomplete-cmd-name) + (while (pcomplete-here* + (funcall pcomplete-command-completion-function) + (pcomplete-arg 'last) t))) + (t + (funcall (or (pcomplete-find-completion-function + pcomplete-cmd-name) + pcomplete-default-completion-function)))))) + (provide 'pcmpl-unix) ;;; pcmpl-unix.el ends here Modified lisp/pcomplete.el diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index dbeefda..68351e2 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -633,9 +633,42 @@ user actually typed in." (message "No completions") (throw 'pcompleted nil)))) +(defvar pcomplete-special-commands '("sudo" "xargs")) (defun pcomplete-command-name () "Return the command name of the first argument." - (file-name-nondirectory (pcomplete-arg 'first))) + (let ((coms (cl-loop with lst = (reverse (pcomplete-parse-arguments)) + for str in (or (member "|" lst) + (member "||" lst) + (member "&" lst) + (member ";" lst) + lst) + for exec = (or (executable-find str) + ;; `executable-find' or 'which' + ;; doesn't return these paths. + (car (member str '("cd" "pushd" "popd")))) + when exec collect exec))) + (file-name-nondirectory + ;; we may have commands embeded in executables that looks + ;; like executables (e.g apt-get install). + ;; Assume that all executables are using only one command + ;; like this. + ;; e.g - if we have (install apt-get sudo) + ;; what we want is apt-get. + ;; - if we have (apt-get sudo) + ;; what we want is sudo, + ;; then pcomplete/sudo will check if + ;; a pcomplete handler exists for apt-get. + (cond (;; e.g (install apt-get sudo) + (> (length coms) 2) (cadr coms)) + (;; e.g (apt-get sudo) + (and (= (length coms) 2) + (member (file-name-nondirectory (cadr coms)) + pcomplete-special-commands)) + (car coms)) + (;; e.g (sudo) + (= (length coms) 1) (car coms)) + (t ;; e.g (install apt-get) + (cadr coms)))))) (defun pcomplete-match (regexp &optional index offset start) "Like `string-match', but on the current completion argument." Modified lisp/shell.el diff --git a/lisp/shell.el b/lisp/shell.el index 1d67f0b..5bb6a91 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -447,9 +447,8 @@ Thus, this does not include the shell's current directory.") This is the value of `pcomplete-command-completion-function' for --8<---------------cut here---------------end--------------->8--- Shell buffers. It implements `shell-completion-execonly' for `pcomplete' completion." - (pcomplete-here (pcomplete-entries nil - (if shell-completion-execonly - 'file-executable-p)))) + (let ((data (shell--command-completion-data))) + (and data (pcomplete-here (all-completions "" (nth 2 data)))))) (defun shell-completion-vars () "Setup completion vars for `shell-mode' and `read-shell-command'." -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 10:26:54 2014 Received: (at 16197) by debbugs.gnu.org; 7 Jan 2014 15:26:54 +0000 Received: from localhost ([127.0.0.1]:41132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0YYP-00065w-Dm for submit@debbugs.gnu.org; Tue, 07 Jan 2014 10:26:53 -0500 Received: from mail-wg0-f43.google.com ([74.125.82.43]:50083) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0YYN-00065n-Ly for 16197@debbugs.gnu.org; Tue, 07 Jan 2014 10:26:52 -0500 Received: by mail-wg0-f43.google.com with SMTP id k14so272331wgh.34 for <16197@debbugs.gnu.org>; Tue, 07 Jan 2014 07:26:50 -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=jAgy0doyO0CdUhXfM1H6kkI0zLk6rNiek960PSAk+3c=; b=OZs741aHxU8aGVGFZyGwFu1h9MSpzODp1+66I42RnuoMUimA3GZtZGieezVe4Dc/A2 pdgoDWBoU1K0LWbFGe06b9jh4g0NN6Y7PbAXtcxf03xxg5RCuaZwfiRkLJB9NdPTETCi 4c/IHIm9I58+ovpOYt+0/fA2zJtCrZ2yy+SuO2VlMZ9jDVwIO7UZP9iPgQb8G9VnfyBI i5g7h3b5qcpbNtZ1wDGby3EKR41ws9aCSVo0KiDgBGzaeF2NdxgBwe5i7smS848IDisC mXrHpwX6MKJgIptHkfBlf+ffJadtE9q7TKDH7q4Twbbn3wJzLltWasHa6bakIsZrqPQ6 /J1A== X-Received: by 10.180.20.100 with SMTP id m4mr17283182wie.32.1389108410671; Tue, 07 Jan 2014 07:26:50 -0800 (PST) Received: from dell-14z ([37.160.108.159]) by mx.google.com with ESMTPSA id ci4sm45683052wjc.21.2014.01.07.07.26.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 07 Jan 2014 07:26:50 -0800 (PST) From: Thierry Volpiatto To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Organization: Emacs Helm References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> Date: Tue, 07 Jan 2014 16:26:32 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 04 Jan 2014 15:26:59 -0500") Message-ID: <87siszdd93.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) After applying the patch on previous mail, that among other things fix: [...] | xargs but not [...] | xargs - This definition of pcomplete/xargs fix it: --8<---------------cut here---------------start------------->8--- (defun pcomplete/xargs () "Completion for `xargs'." (let ((pcomplete-cmd-name (pcomplete-command-name))) (cond ((string= "xargs" pcomplete-cmd-name) (while (pcomplete-here* (funcall pcomplete-command-completion-function) (pcomplete-arg 'last) t))) (t (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) pcomplete-default-completion-function)))))) --8<---------------cut here---------------end--------------->8--- Note that there is no completion on the args, but that could be done later (no urge for this). -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 25 06:44:44 2020 Received: (at 16197) by debbugs.gnu.org; 25 Sep 2020 10:44:44 +0000 Received: from localhost ([127.0.0.1]:42797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLlDX-0006j0-RH for submit@debbugs.gnu.org; Fri, 25 Sep 2020 06:44:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLlDU-0006if-CZ for 16197@debbugs.gnu.org; Fri, 25 Sep 2020 06:44:42 -0400 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=UHti5BpTll/1jyOLbbgs2yw/gESZah4DlROiezvBbF0=; b=L22EWHV1tCKoXSLEbNdEh/t1BF tvATFSVMq4GxnCRd2fJ9Y22OcfSeJ5gELvIIKcPZ4rVg7mHMptVqROL+IYsJkuUQEOvpQC/kVE0Ra ADX88Xo9GiKKdfHsxat2CuARCnY1HetMS0AcKel7KHx0Jawo2KhnUIqSONeprRBr5xtM=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLlDK-0001IB-Ov; Fri, 25 Sep 2020 12:44:33 +0200 From: Lars Ingebrigtsen To: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <87bnzoueb8.fsf@gmail.com> X-Now-Playing: Thievery Corporation's _The Mirror Conspiracy_: "The Mirror Conspiracy" Date: Fri, 25 Sep 2020 12:44:29 +0200 In-Reply-To: <87bnzoueb8.fsf@gmail.com> (Thierry Volpiatto's message of "Tue, 07 Jan 2014 14:11:39 +0100") Message-ID: <87y2kyqgoi.fsf@gnus.org> 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: Thierry Volpiatto writes: >> Can you send it as a patch against pcmpl-unix.el to fix pcomplete/xargs >> (and add pcomplete/sudo at the same time)? > > * lisp/pcml-unix.el (pcomplete/sudo): New. > * lisp/pcomplete.el (pcomplete [...] 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: 16197 Cc: 16197@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thierry Volpiatto writes: >> Can you send it as a patch against pcmpl-unix.el to fix pcomplete/xargs >> (and add pcomplete/sudo at the same time)? > > * lisp/pcml-unix.el (pcomplete/sudo): New. > * lisp/pcomplete.el (pcomplete-command-name): Allow extracting > command-name in more complex command lines. > * lisp/shell.el (shell-command-completion-function): Fix it (was not > working at all). There was unfortunately no followup to this at the time. I've now respun the patch and tried to do some testing, but... this doesn't seem to work? Here's how I tested: 1) Apply the patch 2) Build Emacs 3) emacs -Q f) M-x shell IV) sudo apt-g Result: "No match" I'm not very familiar with the completion framework, and the code has changed over the years... Anybody? diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index 74f45b9523..0096020ab4 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -82,9 +82,13 @@ pcomplete/rm ;;;###autoload (defun pcomplete/xargs () "Completion for `xargs'." - (pcomplete-here (funcall pcomplete-command-completion-function)) - (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) - pcomplete-default-completion-function))) + (let ((pcomplete-cmd-name (pcomplete-command-name))) + (cond ((string= "xargs" pcomplete-cmd-name) + (while (pcomplete-here* + (funcall pcomplete-command-completion-function) + (pcomplete-arg 'last) t))) + (t (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) + pcomplete-default-completion-function)))))) ;;;###autoload (defalias 'pcomplete/time 'pcomplete/xargs) @@ -240,6 +244,22 @@ pcomplete/rsh (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) pcomplete-default-completion-function))) +(defun pcomplete/sudo () + (let ((pcomplete-cmd-name (pcomplete-command-name))) + (while (and (string= "sudo" pcomplete-cmd-name) + (pcomplete-match "^-" 'last)) + (when (< pcomplete-index pcomplete-last) + (pcomplete-next-arg)) + (pcomplete-opt "AbCDEegHhiKknPpSsUuVv-")) + (cond ((string= "sudo" pcomplete-cmd-name) + (while (pcomplete-here* + (funcall pcomplete-command-completion-function) + (pcomplete-arg 'last) t))) + (t + (funcall (or (pcomplete-find-completion-function + pcomplete-cmd-name) + pcomplete-default-completion-function)))))) + (provide 'pcmpl-unix) ;;; pcmpl-unix.el ends here diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 014f9628b9..9ac4652126 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -119,6 +119,7 @@ ;;; Code: (require 'comint) +(eval-when-compile (require 'cl-lib)) (defgroup pcomplete nil "Programmable completion." @@ -674,9 +675,42 @@ pcomplete-next-arg (message "No completions") (throw 'pcompleted nil)))) +(defvar pcomplete-special-commands '("sudo" "xargs")) (defun pcomplete-command-name () "Return the command name of the first argument." - (file-name-nondirectory (pcomplete-arg 'first))) + (let ((coms (cl-loop with lst = (reverse (pcomplete-parse-arguments)) + for str in (or (member "|" lst) + (member "||" lst) + (member "&" lst) + (member ";" lst) + lst) + for exec = (or (executable-find str) + ;; `executable-find' or 'which' + ;; doesn't return these paths. + (car (member str '("cd" "pushd" "popd")))) + when exec collect exec))) + (file-name-nondirectory + ;; we may have commands embeded in executables that looks + ;; like executables (e.g apt-get install). + ;; Assume that all executables are using only one command + ;; like this. + ;; e.g - if we have (install apt-get sudo) + ;; what we want is apt-get. + ;; - if we have (apt-get sudo) + ;; what we want is sudo, + ;; then pcomplete/sudo will check if + ;; a pcomplete handler exists for apt-get. + (cond (;; e.g (install apt-get sudo) + (> (length coms) 2) (cadr coms)) + (;; e.g (apt-get sudo) + (and (= (length coms) 2) + (member (file-name-nondirectory (cadr coms)) + pcomplete-special-commands)) + (car coms)) + (;; e.g (sudo) + (= (length coms) 1) (car coms)) + (t ;; e.g (install apt-get) + (cadr coms)))))) (defun pcomplete-match (regexp &optional index offset start) "Like `string-match', but on the current completion argument." diff --git a/lisp/shell.el b/lisp/shell.el index 9667dab2af..48eb69f0b6 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -460,9 +460,8 @@ shell-command-completion-function This is the value of `pcomplete-command-completion-function' for Shell buffers. It implements `shell-completion-execonly' for `pcomplete' completion." - (pcomplete-here (pcomplete-entries nil - (if shell-completion-execonly - 'file-executable-p)))) + (let ((data (shell--command-completion-data))) + (and data (pcomplete-here (all-completions "" (nth 2 data)))))) (defun shell-completion-vars () "Setup completion vars for `shell-mode' and `read-shell-command'." -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 25 06:44:51 2020 Received: (at control) by debbugs.gnu.org; 25 Sep 2020 10:44:51 +0000 Received: from localhost ([127.0.0.1]:42800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLlDf-0006jL-6x for submit@debbugs.gnu.org; Fri, 25 Sep 2020 06:44:51 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLlDd-0006j8-Nb for control@debbugs.gnu.org; Fri, 25 Sep 2020 06:44:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NEuSNVTP6cENMPGaoADF75+COMKwxdUerRPFzKfLSwY=; b=KhPjDv/g2/DneRbQHwLNGzKtIU uTmlSm2U1QeNebOryeh4SNb6bnmCvauhN4QOsjQQ5452RdKevGXr05zR0sDYivQhR4JriQDaQy7Wv vVpmmbHZkkeRkc/Go6t65IgcFEuCOqZZvZCsQ/tmRlvpKHvZScp6npCV5VmDCgJNr5dY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLlDV-0001IR-U3 for control@debbugs.gnu.org; Fri, 25 Sep 2020 12:44:44 +0200 Date: Fri, 25 Sep 2020 12:44:40 +0200 Message-Id: <87wo0iqgo7.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #16197 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: tags 16197 + patch quit 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: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 16197 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 25 13:51:16 2020 Received: (at 16197) by debbugs.gnu.org; 25 Sep 2020 17:51:16 +0000 Received: from localhost ([127.0.0.1]:45267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLrsK-0005ID-Ce for submit@debbugs.gnu.org; Fri, 25 Sep 2020 13:51:16 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLrsI-0005Ht-P5 for 16197@debbugs.gnu.org; Fri, 25 Sep 2020 13:51:15 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 046614407C0; Fri, 25 Sep 2020 13:51:09 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 55F6D4407A9; Fri, 25 Sep 2020 13:51:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1601056267; bh=NA9ri54rG5J10O13bafTdzeklS1CYftE3yEdkntzlWs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=nYjTGIo5G5Mxm75J8RVqIzk9/BJj63Ivv3RcFkUUFSg9lRPyGNybVtjac74rpRq32 kG+s6tShMclOsJx2m7LOcFDWZazZIy0di1gMZWhFDxLJfR3CyvbZQmTNNBcyFx1Qul EoWJ/2egZnVepjOYzA42QQfqc63BBvSxShqQXVWMu47kNL8KyREBOkV0OR4YOF5lR2 dGf/GQfnbC177HMc+eqRsjFzFaIIITW/4nvKXXRJ7nKzkiks38bxcdZ8LiTRU8rRw6 yBUbjBC43snakYJDg8HNAY9coVikCr+fpsG5LFtEJ7/Vu8VLqu28IJiE0ujFHkyihV vdc0I6pwXHYGA== Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DEDC612021C; Fri, 25 Sep 2020 13:51:06 -0400 (EDT) From: Stefan Monnier To: Thierry Volpiatto Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Message-ID: References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <8738l2hode.fsf@gmail.com> Date: Fri, 25 Sep 2020 13:51:05 -0400 In-Reply-To: <8738l2hode.fsf@gmail.com> (Thierry Volpiatto's message of "Sun, 05 Jan 2014 08:35:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.057 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 16197 Cc: 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > emacs -Q > M-x shell > $ find . -name '*.el' | xargs et! > Press TAB, nothing, no completion against "et". The patch below seems to address this problem for me. Now I can do M-x shell % xargs cv TAB and I get a list is commands starting with "cv"; and % xargs cvs TAB lists `cvs`s subcommands. > M-: (shell-backward-command) > I have now the cursor at xargs: That seems right to me. I think changing it the way you describe could lead to more problems down the line for cases where `shell-backward-command` is used for other purposes. > $ find . -name '*.el' | !xargs et > To provide completion against "et" I should have the cursor at: > $ find . -name '*.el' | xargs !et > after evaling (shell-backward-command). The beginning of the command is definitely "xargs" and not "et". The fact that the first arg to the command is itself a command shouldn't change where is the beginning of the command here, I think. > For `pcomplete-command-name' it is harder to give a recipe, the best is > to edebug it to have an idea (be careful the actual version is crashing > emacs sometimes). Same here, I'd think that the "command name" is "xargs", but rather than argue about this philosophical point, it's probably better to focus on more concrete cases where this return value is a problem. Stefan diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index dc0d729849..27584c27a7 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -83,7 +83,7 @@ pcomplete/rm ;;;###autoload (defun pcomplete/xargs () "Completion for `xargs'." - (pcomplete-here (funcall pcomplete-command-completion-function)) + (funcall pcomplete-command-completion-function) (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) pcomplete-default-completion-function))) diff --git a/lisp/shell.el b/lisp/shell.el index e574aac99d..d2c41a9690 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -461,9 +461,12 @@ shell-command-completion-function This is the value of `pcomplete-command-completion-function' for Shell buffers. It implements `shell-completion-execonly' for `pcomplete' completion." - (pcomplete-here (pcomplete-entries nil - (if shell-completion-execonly - 'file-executable-p)))) + (if (pcomplete-match "/") + (pcomplete-here (pcomplete-entries nil + (if shell-completion-execonly + 'file-executable-p))) + (pcomplete-here + (nth 2 (shell--command-completion-data))))) (defun shell-completion-vars () "Setup completion vars for `shell-mode' and `read-shell-command'." From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 26 09:09:48 2020 Received: (at 16197) by debbugs.gnu.org; 26 Sep 2020 13:09:48 +0000 Received: from localhost ([127.0.0.1]:46105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kM9xU-0003Lt-0G for submit@debbugs.gnu.org; Sat, 26 Sep 2020 09:09:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:51578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kM9xQ-0003Le-Gu for 16197@debbugs.gnu.org; Sat, 26 Sep 2020 09:09:46 -0400 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=opfywFB/qg3CBfstrb/5NqErWSOvzYaeu5RjIZn7mpU=; b=JaR/dLUflPJ7UZxICOsdukeghG tlw0CGBSNpeorcWcq/2SEVnNPvo0vzSYIYGLI7DqOaJlhiMosd++EZS1YiAWjjD2ON2OEFCFWm0Ze DG5PgEmvEBkp14332nkaWUeNeGvzWHYgk2gSlHzXIL9xnaYPjVZbS9CGQ/K3Tnfj/0rU=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kM9xD-0007QX-7d; Sat, 26 Sep 2020 15:09:37 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <8738l2hode.fsf@gmail.com> X-Now-Playing: Tied + Tickled Trio's _Tied + Tickled Trio_: "Rara Avis" Date: Sat, 26 Sep 2020 15:09:29 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 25 Sep 2020 13:51:05 -0400") Message-ID: <87k0wgn0qe.fsf@gnus.org> 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: Stefan Monnier writes: > Same here, I'd think that the "command name" is "xargs", but rather than > argue about this philosophical point, it's probably better to focus on > more concrete cases where this return value is a p [...] 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: 16197 Cc: 16197@debbugs.gnu.org, Thierry Volpiatto X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > Same here, I'd think that the "command name" is "xargs", but rather than > argue about this philosophical point, it's probably better to focus on > more concrete cases where this return value is a problem. I think I read somewhere that Thierry is no longer working on Emacs stuff... Let's see... Oh, here: https://news.ycombinator.com/item?id=24449883 Hm, that's only about Helm... Anyway, this doesn't help with the sudo case, I guess? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 26 18:17:47 2020 Received: (at 16197) by debbugs.gnu.org; 26 Sep 2020 22:17:47 +0000 Received: from localhost ([127.0.0.1]:47902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMIVn-0004KN-8Q for submit@debbugs.gnu.org; Sat, 26 Sep 2020 18:17:47 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:21181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMIVh-0004K4-L4 for 16197@debbugs.gnu.org; Sat, 26 Sep 2020 18:17:45 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 54306441283; Sat, 26 Sep 2020 18:17:36 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BB3EC44127D; Sat, 26 Sep 2020 18:17:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1601158654; bh=iLFZqrWGGRxvqNvN2qLcxjfwnDF1HCxV/vVFiFS9JJM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=UNg71dcz4+8e+Ej6rakiBAIchMVW1axAde/bEKddI/steBuHtoiYiVgmMMkcpYXG2 XzBfrcn+Pso3A92tMO+Uxy2tqFtGlDqjzZUs0uRwXp8CIqr1su81Dz0dvKHiAced5n uArJ8qWqjd7+IpSjqhYtyvIDgZQkh/P5pmyXh9E4OQ/G49wCo58ZmWZf7pEe6Sguf6 hOpoaMobDT7OQF1VGaNZR333tlifSvuu5UkIySdJm3mWBxOoUU08Bjl559aKG1CBBw qR3khbyGQG03eYleOn77AiZzuM29EXSgZG39oeaOKj8bSsUXmGgrYsZa5ufk2T/KZ/ 1K4q/pozqlDtQ== Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7E91B1202C1; Sat, 26 Sep 2020 18:17:34 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Message-ID: References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <8738l2hode.fsf@gmail.com> <87k0wgn0qe.fsf@gnus.org> Date: Sat, 26 Sep 2020 18:17:33 -0400 In-Reply-To: <87k0wgn0qe.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 26 Sep 2020 15:09:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.058 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 16197 Cc: Thierry Volpiatto , 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> Same here, I'd think that the "command name" is "xargs", but rather than >> argue about this philosophical point, it's probably better to focus on >> more concrete cases where this return value is a problem. > > I think I read somewhere that Thierry is no longer working on Emacs > stuff... Let's see... Oh, here: > > https://news.ycombinator.com/item?id=24449883 > > Hm, that's only about Helm... > > Anyway, this doesn't help with the sudo case, I guess? The sudo case is the same as xargs, so it's a simple matter of duplicating the pcomplete/xargs (or making an alias) as in the patch below. Stefan diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index dc0d729849..8d4e7ea33d 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -83,10 +83,14 @@ pcomplete/rm ;;;###autoload (defun pcomplete/xargs () "Completion for `xargs'." - (pcomplete-here (funcall pcomplete-command-completion-function)) + ;; FIXME: Add completion of xargs-specific arguments. + (funcall pcomplete-command-completion-function) (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) pcomplete-default-completion-function))) +;; FIXME: Add completion of sudo-specific arguments. +(defalias 'pcomplete/sudo #'pcomplete/xargs) + ;;;###autoload (defalias 'pcomplete/time 'pcomplete/xargs) diff --git a/lisp/shell.el b/lisp/shell.el index e574aac99d..d2c41a9690 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -461,9 +461,12 @@ shell-command-completion-function This is the value of `pcomplete-command-completion-function' for Shell buffers. It implements `shell-completion-execonly' for `pcomplete' completion." - (pcomplete-here (pcomplete-entries nil - (if shell-completion-execonly - 'file-executable-p)))) + (if (pcomplete-match "/") + (pcomplete-here (pcomplete-entries nil + (if shell-completion-execonly + 'file-executable-p))) + (pcomplete-here + (nth 2 (shell--command-completion-data))))) (defun shell-completion-vars () "Setup completion vars for `shell-mode' and `read-shell-command'." From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 27 08:08:27 2020 Received: (at 16197) by debbugs.gnu.org; 27 Sep 2020 12:08:28 +0000 Received: from localhost ([127.0.0.1]:48556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMVTf-0003dP-KF for submit@debbugs.gnu.org; Sun, 27 Sep 2020 08:08:27 -0400 Received: from quimby.gnus.org ([95.216.78.240]:36542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMVTd-0003dD-Lw for 16197@debbugs.gnu.org; Sun, 27 Sep 2020 08:08:26 -0400 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=Xy/Y8fEcPHyqelRJ3y21KFPDsYVf604mkqmET6zA6is=; b=ZDOUyOZT7W0YEgaGeFuAHMqBrg QwLZRDdpOQOJbtidyn2ZblknpceWeMj0lcNkIkOygWAy33VmbjZl8lzzG8MOqxuIaDP0zajq38YTj Wy3fvrRgDfFRkMnf6BHOp46kdmPXFeIZra6Vg7gJIloBDQ7BytGMD4jJl2IQgh3fg/hg=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMVTQ-0003kg-Ug; Sun, 27 Sep 2020 14:08:18 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <8738l2hode.fsf@gmail.com> <87k0wgn0qe.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEW8xch5hIdBPkP/ //9qUcmpAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QJGwsjOr/5AOkAAAGZSURBVCjPTZGxbpxAEIYH K4dsqiQykXyVC1c8xRLlkNw5EoPMdJEOC/YpOCmVq3N0XEF1iliL/Z8ys/gSZ4vVfszwz/wzlDJc Z2ExEVFaie8Aa/cBBL7WiKMAdvQsf0FG/2ghJSNEgLZGvLEBAPhBVqndEmXw1h1HZvQB5ngYxIcs suKObrDgWeFoX+EqOB+KTn2TsWpgo+B6VnFgmxqi5/4CAoyOH4jiXeK7H4DhUouaZJ6+Z3jhR6LX XXHYplI5qYm0lb2ayt12VBCrfSTk756I4KxqXpK/+UW0bjITfCHZqRpf6zOufPhy8y3cq2qKqKS0 jDRt1WjT15rGCjEUPmikNmRi/Fym00q5onhzuI2CGjdlFN+f2o8BxO2Lkfdyv0Chv3AuwULXtZcF DnSlAmsMpwaoTEVhbpI7eDYXWi5zV4kbxFCkTmzRr4+1dqFlqH3qk2c2iw36MicYOX+DbNK1HeJ+ AfyGTx8+lW+gc2bO2bwD/4vMm/9gqrw9w4DTZ1g+g7x8ha5vqYNiKMK2aLFwbiWcBO/vP9bos2ts 4KKOAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA5LTI3VDExOjM1OjU3KzAwOjAwSQ82wQAAACV0 RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOS0yN1QxMTozNTo1NyswMDowMDhSjn0AAAAASUVORK5CYII= X-Now-Playing: LCD Soundsystem's _London Sessions_: "Pow Pow" Date: Sun, 27 Sep 2020 14:08:11 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 26 Sep 2020 18:17:33 -0400") Message-ID: <87eemn5sno.fsf@gnus.org> 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: Stefan Monnier writes: > The sudo case is the same as xargs, so it's a simple matter of > duplicating the pcomplete/xargs (or making an alias) as in the patch below. Great! Are you applying this, then? 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: 16197 Cc: Thierry Volpiatto , 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > The sudo case is the same as xargs, so it's a simple matter of > duplicating the pcomplete/xargs (or making an alias) as in the patch below. Great! Are you applying this, then? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 27 22:08:00 2020 Received: (at 16197) by debbugs.gnu.org; 28 Sep 2020 02:08:00 +0000 Received: from localhost ([127.0.0.1]:50821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMia8-0007Dw-IY for submit@debbugs.gnu.org; Sun, 27 Sep 2020 22:08:00 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMia7-0007Dj-8U for 16197@debbugs.gnu.org; Sun, 27 Sep 2020 22:07:59 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A045E80ACA; Sun, 27 Sep 2020 22:07:53 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 417ED80739; Sun, 27 Sep 2020 22:07:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1601258872; bh=z9xYPzjhAJxzhY5vDLnc9q9blW7wtgj8Q5wBI17HKWE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iuTwjImxs/KIeaaHbENzM12HQaUcCYJwfuZxp2wVg4nogCdD2K3SHygn/WgFUhM8C zoIJsKKf7Gja5b2a/9PVjX0iPkTTa3GUsS5UHpE1TU1JL1TPwwrZm3CF39NG4n0aCA 7t1hSD3ti9+gARQX1T5oqGyZiaxCUuK4L3V/bspvTWpPrX1lvum0lo4QXz250qXhbS AoDgUDExmW/Wtp5BUy9sCDeMCbqEmxnwc4FU3vMkRivttiwhapYV4evQjkvgmAl3l9 Dmyw7w0er7O9TMVdfd+HdzGq2MhPMTDFv4uTCDDjF0YSuAbimb4a99adWKGE+0TQYj BP851dBKsju1A== Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C0F251203CD; Sun, 27 Sep 2020 22:07:51 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Message-ID: References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <8738l2hode.fsf@gmail.com> <87k0wgn0qe.fsf@gnus.org> <87eemn5sno.fsf@gnus.org> Date: Sun, 27 Sep 2020 22:07:51 -0400 In-Reply-To: <87eemn5sno.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 27 Sep 2020 14:08:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.073 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 16197 Cc: Thierry Volpiatto , 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> The sudo case is the same as xargs, so it's a simple matter of >> duplicating the pcomplete/xargs (or making an alias) as in the patch below. > Great! Are you applying this, then? Done, Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 28 07:12:48 2020 Received: (at 16197) by debbugs.gnu.org; 28 Sep 2020 11:12:48 +0000 Received: from localhost ([127.0.0.1]:51626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMr5M-00006l-5c for submit@debbugs.gnu.org; Mon, 28 Sep 2020 07:12:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMr5J-00006V-WE for 16197@debbugs.gnu.org; Mon, 28 Sep 2020 07:12:46 -0400 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=Re7XXvZ1Pj1Q2ad+A87l+XcrmzNiqG7oN9hSeaE+POs=; b=lsV5aCEMGLpRSQqtTbtvWAndze APLJVf64h+5o4HOGV2s7Ytqddk2JJWJNC9MTE0p+L/MY7MunuNgvUcc16gt3uCSIn7YQl30i227YG /KdXyBxU2hC5ZCXYpqfKnYQEszfsiRu46OjtTHueK0EJlz9KdOPhCzZ2QC/BPwhOA0rM=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMr5A-0006Sp-HI; Mon, 28 Sep 2020 13:12:39 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell References: <87fvpolyuk.fsf@gmail.com> <87zjnshslj.fsf@gmail.com> <87vbyfoojc.fsf@gmail.com> <8738lispja.fsf@gmail.com> <8738licym6.fsf@gmail.com> <874n5kfh0x.fsf@gmail.com> <8738l2hode.fsf@gmail.com> <87k0wgn0qe.fsf@gnus.org> <87eemn5sno.fsf@gnus.org> X-Now-Playing: Arto Lindsay's _Ecomixes_: "Tone (Hair Stylistics Remix)" Date: Mon, 28 Sep 2020 13:12:35 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 27 Sep 2020 22:07:51 -0400") Message-ID: <87mu1aw3x8.fsf@gnus.org> 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: Stefan Monnier writes: >>> The sudo case is the same as xargs, so it's a simple matter of >>> duplicating the pcomplete/xargs (or making an alias) as in the patch below. >> Great! Are you applying this, then? > > Done, > > [...] 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: 16197 Cc: Thierry Volpiatto , 16197@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >>> The sudo case is the same as xargs, so it's a simple matter of >>> duplicating the pcomplete/xargs (or making an alias) as in the patch below. >> Great! Are you applying this, then? > > Done, > > Stefan Thanks; works fine, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 28 07:12:54 2020 Received: (at control) by debbugs.gnu.org; 28 Sep 2020 11:12:54 +0000 Received: from localhost ([127.0.0.1]:51629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMr5S-000074-EG for submit@debbugs.gnu.org; Mon, 28 Sep 2020 07:12:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMr5Q-00006k-Ps for control@debbugs.gnu.org; Mon, 28 Sep 2020 07:12:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/y59/VlIyigUl7E6/1bCZRYOZFaIMDX4WwuHrM5WiPo=; b=S1mdqNVaG12q0LcHPjN+TyjDqJ lJspTkwMPiAsT53COAfH7FLi2o9rvEn+zibd72JtgaLe9ePZYZSKzBWT1CQnLpSDS38lWfT+UseVb VnSxVA47POiCSaqraQlkkGhas30LQ6DDKdE7I2gs8MnCgWvxhbwjy1hQHexoJCei2QtA=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMr5J-0006T1-4O for control@debbugs.gnu.org; Mon, 28 Sep 2020 13:12:47 +0200 Date: Mon, 28 Sep 2020 13:12:43 +0200 Message-Id: <87lfguw3x0.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #16197 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: tags 16197 fixed close 16197 28.1 quit 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: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 16197 fixed close 16197 28.1 quit From unknown Sat Jun 21 10:27:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 26 Oct 2020 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator