emacs-pe / docker-tramp.el

TRAMP integration for docker containers
339 stars 26 forks source link

`ido-mode` breaks docker-tramp completion in minibuffer, and opens wrong files. #28

Closed CamJN closed 3 years ago

CamJN commented 4 years ago

Somehow the following minimal emacs config breaks docker-tramp. Completion in the mini-buffer does not work for /docker:, nor the container ids/names like /docker:43893ad331df, and once you type out the full tramp string like: /docker:43893ad331df/ completion then suggests files from the host fs where emacs is running, not from the docker container fs, and if you type out the path to a file that exists in both fs' then it will be opened on the host fs not the container fs, and a file that only exists on the container fs will not be found at all.

(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
(add-to-list 'load-path (concat "~/.emacs.d/" (file-name-as-directory "elpa")))

(require 'tramp)
(setq tramp-verbose 9)
(require 'docker-tramp)

(defvar ido-dont-ignore-buffer-names '("*scratch*" "*Occur*"))

(defun ido-ignore-most-star-buffers (name)
  (and
   (string-match-p "^*" name)
   (not (member name ido-dont-ignore-buffer-names))))

(defun bind-ido-keys ()
  "Keybindings for ido mode."
  (define-key ido-completion-map "\C-n" 'ido-toggle-ignore))
(add-hook 'ido-setup-hook #'bind-ido-keys)

(ido-mode 1)
(setq ido-use-virtual-buffers t)
(add-to-list 'ido-ignore-buffers 'ido-ignore-most-star-buffers)

Any idea what is going on, and how to fix it?

CamJN commented 3 years ago

The issue went away with emacs 27.1, no idea why.