From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell Date: Fri, 20 Dec 2013 09:18:27 +0100 Message-ID: <87fvpolyuk.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387527614 25299 80.91.229.3 (20 Dec 2013 08:20:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Dec 2013 08:20:14 +0000 (UTC) To: 16197@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 20 09:20:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VtvJh-00027v-NG for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Dec 2013 09:20:18 +0100 Original-Received: from localhost ([::1]:48244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvJh-00034Y-5b for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Dec 2013 03:20:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvJY-000346-Hw for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:20:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtvJS-0000C6-H0 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:20:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvJS-0000BC-E1 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VtvJR-0007GO-Vs for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2013 03:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2013 08:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138752754427824 (code B ref -1); Fri, 20 Dec 2013 08:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Dec 2013 08:19:04 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82264 Archived-At: 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