Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug: Toggling minor mode with zero in init file breaks ido #47

Open
nicolaus1990 opened this issue Jun 9, 2019 · 4 comments
Open

Comments

@nicolaus1990
Copy link

Toggling minor mode off with zero in init-file, will break ido. For example: When C-x C-f, following error will appear:
Error in post-command-hook (ido-exhibit): (void-function ido-completions).

I don't know if this is an error, but it's not what I was expecting.

Here an init file that reproduces the error: (unfortunately I use 'use-package', but I hope it's understandable and init file should run as is). The error will not be there if one comments out (ido-vertical-mode 0). This error seems to only happen when (ido-vertical-mode 0) is called in init-file.

;;;;;;;;;;; 
;(package-initialize)
(require 'package)


(setq myPackageRepos '( ("melpa-stable" . "http://stable.melpa.org/packages/")
  ("melpa" . "http://melpa.org/packages/")
  ("marmalade" . "http://marmalade-repo.org/packages/")
  ("gnu" . "http://elpa.gnu.org/packages/")
))
(dolist (xs myPackageRepos)
  (unless (assoc-default (car xs) package-archives)
        (add-to-list 'package-archives
	  xs t)))

(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
;(eval-when-compile 
;  (require 'use-package))

;; use-package.el is no longer needed at runtime, which means that this at the
;; top will further reduce load time:
(eval-when-compile
  (require 'use-package))

;; If the package takes longer than 0.1s to load, you will see a message to
;; indicate this loading activity in the *Messages* buffer. The same will
;; happen for configuration, or :config blocks that take longer than 0.1s to
;; execute.
(setq use-package-verbose t)

;(setq use-package-always-defer t) ;;Unless :demand t
(setq use-package-always-ensure t)
;(require 'use-package)


;;; Ido: When typing "C-x b" ignore certain buffers.
(defvar ido-dont-ignore-buffer-names '("*grep*"))
(defun ido-ignore-most-star-buffers (name)
  (and
   (string-match-p "^*" name);Buffername starts with a star.
   (not (member name ido-dont-ignore-buffer-names))))


;;Note: Use C-j to make ido accept input as it is.
(use-package ido 
  :ensure t
  :init
  (progn
    (ido-mode 1)
    (ido-everywhere 1)
    ;; ido-use-faces is being set to nil because of flx highlights (see flx-ido)
    ;; (setq ido-default-buffer-method 'selected-window)
    (setq ido-ignore-buffers (list "\\` " #'ido-ignore-most-star-buffers))
))


(use-package ido-vertical-mode
  ;;List items vertically instead of horizontally and in brackets.
  ;:disabled
  :ensure t
  :after (ido)
  :config
  ;;Add colors
  (setq ido-use-faces t)
  (set-face-attribute 'ido-vertical-first-match-face nil
                      :background "#e5b7c0")
  (set-face-attribute 'ido-vertical-only-match-face nil
                      :background "#e52b50"
                      :foreground "white")
  (set-face-attribute 'ido-vertical-match-face nil
                      :foreground "#b00000")
  (setq ido-vertical-show-count t)
  ;;Enable
  (ido-mode 1)
  (ido-vertical-mode 0)
  ;(setq ido-vertical-define-keys 'C-n-and-C-p-only)
)
@pierre-rouleau
Copy link

I have seen the same issue with a simpler use of the package.

I have:

    (use-package ido-vertical-mode
      :ensure t
      :pin melpa
      :commands ido-vertical-mode)

@pierre-rouleau
Copy link

Well... I'v seen the problem occur (on Emacs 26.3) without ido-vertical-mode involved. I also have smex and ido-grid-mode active. More investigation is required to identify the culprit.
Any suggestions as to where I should be looking?

@pierre-rouleau
Copy link

Update: the issue I had was related to the order of execution. In my code ido-mode was not always set before the activation of the ido-vertical-mode. I fixed that and I have not yet run into the issue.

@pierre-rouleau
Copy link

My PEL system allows using ido-vertical-mode as well as other completion modes for Ido (standard, grid-mode) and other engines (ivy, helm). They can be selected by customization and commands exist to select them during a session. That helps testing the capabilities of various engines and use what best suits the task at hand. SO far my testing with ido-vertical-mode has shown no issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants