flycheck-pos-tip icon indicating copy to clipboard operation
flycheck-pos-tip copied to clipboard

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

Open jschaf opened this issue 8 years ago • 6 comments

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 avatar Dec 13 '15 08:12 jschaf

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 avatar Dec 13 '15 23:12 jschaf

I'm actually getting this in a spacemacs install: https://github.com/syl20bnr/spacemacs/issues/8551

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

hchapman avatar Mar 19 '17 17:03 hchapman

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

cpitclaudel avatar Mar 19 '17 17:03 cpitclaudel

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

hchapman avatar Mar 19 '17 18:03 hchapman

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 avatar Mar 19 '17 22:03 cpitclaudel

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.

seagle0128 avatar Sep 06 '17 02:09 seagle0128