GNU bug report logs - #16197
24.3.50; no completion on commands following "sudo" in shell and eshell

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Fri, 20 Dec 2013 08:20:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 24.3.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: 16197 <at> debbugs.gnu.org
Subject: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell
Date: Mon, 23 Dec 2013 11:21:59 +0100
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> 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 





This bug report was last modified 4 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.