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

Whitespace-mode not compatible with Auto-complete #19

Closed
gfreezy opened this issue Oct 30, 2011 · 4 comments
Closed

Whitespace-mode not compatible with Auto-complete #19

gfreezy opened this issue Oct 30, 2011 · 4 comments

Comments

@gfreezy
Copy link

gfreezy commented Oct 30, 2011

While I enabled whitespace-mode, some lines of the popup layer of auto-complete is covered by something.

@bbatsov
Copy link
Owner

bbatsov commented Nov 9, 2011

auto-complete mode is known to cause all sorts of graphics corruption. That's why I've dropped it from Prelude. I'll have a look at that particular problem when I have some spare time.

@gfreezy gfreezy closed this as completed Nov 13, 2011
@rocha
Copy link

rocha commented Sep 10, 2012

I have a workaround if anyone is interested:

(set-default 'my-prev-whitespace-mode nil)

(defadvice popup-draw (before my-turn-off-whitespace)
  "Turn off whitespace mode before showing autocomplete box"
  (make-local-variable 'my-prev-whitespace-mode)
  (if whitespace-mode
      (progn
        (setq my-prev-whitespace-mode t)
        (prelude-turn-off-whitespace))
    (setq my-prev-whitespace-mode nil)))

(defadvice popup-delete (after my-restore-whitespace)
  "Restore previous whitespace mode when deleting autocomplete box"
  (make-local-variable 'my-prev-whitespace-mode)
  (if my-prev-whitespace-mode
      (prelude-turn-on-whitespace)))

(ad-activate 'popup-draw)
(ad-activate 'popup-delete)


@driftcrow
Copy link

in latest prelude version prelude-turn-off-whitespace function has been removed, code fixed bellow:

;;; advice for whitespace-mode conflict
(defvar my-prev-whitespace-mode nil)
(make-variable-buffer-local 'my-prev-whitespace-mode)

(defadvice popup-draw (before my-turn-off-whitespace)
  "Turn off whitespace mode before showing autocomplete box"
  (make-local-variable 'my-prev-whitespace-mode)
  (if whitespace-mode
      (progn
        (setq my-prev-whitespace-mode t)
        (whitespace-mode -1))
    (setq my-prev-whitespace-mode nil)))

(defadvice popup-delete (after my-restore-whitespace)
  "Restore previous whitespace mode when deleting autocomplete box"
  (if my-prev-whitespace-mode
      (whitespace-mode 1)))

(ad-activate 'popup-draw)
(ad-activate 'popup-delete)

@bbatsov
Copy link
Owner

bbatsov commented Feb 1, 2013

Someone should really fix autocomplete-mode upstream. It's not right to expect users to have to apply workarounds like this one.

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

4 participants