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

flycheck-pos-tip prevents the use of any other tooltips #13

Open
jschaf opened this issue Dec 13, 2015 · 6 comments
Open

flycheck-pos-tip prevents the use of any other tooltips #13

jschaf opened this issue Dec 13, 2015 · 6 comments

Comments

@jschaf
Copy link

jschaf commented Dec 13, 2015

You can't use tooltips for anything else if flycheck-pos-tip is enabled.

flycheck-pos-tip-hide-messages is in post-command-hook, so a call to pos-tip-show or any other command will hide the tooltip immediately after display.

Steps to reproduce.

  1. Enable flycheck-pos-tip
  2. Run eval-expression M-: (pos-tip-show "FLASH")
  3. You might see a tooltip flash, but more likely you won't see anything.

Possible fixes

  1. Remove the hooks after completing your display and add them when showing an error message.
  2. Use a buffer-local sentinel variable that tracks if you're currently displaying an error message. Only hide tooltips if the sentinel is true.
@jschaf
Copy link
Author

jschaf commented Dec 13, 2015

After taking another look, I think this was caused by a bad function in my personal post-command-hook. I can't reproduce, so I'll close it.

@jschaf jschaf closed this as completed Dec 13, 2015
@hchapman
Copy link

I'm actually getting this in a spacemacs install: syl20bnr/spacemacs#8551

I admit I don't know if it works for a clean emacs install or not though.

@cpitclaudel
Copy link
Member

Please try reproducing it in a clean Emacs, and let us know :)

@hchapman
Copy link

hchapman commented Mar 19, 2017

Ok, it's still happening for me.

Using i3 manager on Ubuntu Yakkety.

On Emacs, build:
GNU Emacs 26.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.20.9) of 2017-03-16

edit I installed emacs-snapshot from the ubuntu elisp ppa: https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa

.emacs.d/init.el

;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (flycheck-pos-tip))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

Using package-list-packages, I installed flycheck-pos-tip.

In scratch,
(tooltip-show "hello"), C-x C-e shows a tooltip for ~5s as expected.

M-x flycheck-pos-tip-mode

C-x C-e to execute the same tooltip-show call shows nothing; some C-x C-e gives an occasional flicker of a tooltip

@cpitclaudel
Copy link
Member

Thanks. I'll have a look, but I think this is partly an emacs limitation (you can't have two tooltips in any case). This is being worked on for Emacs 26, btw.

@cpitclaudel cpitclaudel reopened this Mar 19, 2017
@seagle0128
Copy link

seagle0128 commented Sep 6, 2017

The root cause is flycheck-pos-tip-hide-messages hides all tooltips. Try this workaround:

    ;; Don't hide pos tip to advoid suspress other pos tips.
    (defun flycheck-pos-tip-hide-messages ()
      "Hide messages currently being shown if any."
      (flycheck-hide-error-buffer)))

Please note that flycheck-hide-error-buffer is unable to be executed in terminal mode.

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