Skip to content

Commit

Permalink
Use pos-tip for popups again
Browse files Browse the repository at this point in the history
popup sucks, see syl20bnr/spacemacs#2110,
syl20bnr/spacemacs#2575, etc.

This reverts commit c4f1cfa.
  • Loading branch information
Sebastian Wiesner committed Nov 9, 2015
1 parent 5b3a203 commit 65cd8f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# flycheck-pos-tip

This is extension for [Flycheck](https://github.com/flycheck/flycheck).
This extension to display errors under point using [popup.el](https://github.com/auto-complete/popup-el).
This extension to display errors under point using [pos-tip](https://github.com/syohex/pos-tip).

![Emacs Screenshot with flycheck-pos-tip](https://github.com/flycheck/flycheck-pos-tip/raw/master/screenshot.png)

Expand All @@ -26,6 +26,15 @@ In your `init.el`:
'(flycheck-display-errors-function #'flycheck-pos-tip-error-messages)))
```

## Usage

### Configure

```
(custom-set-variables
'(flycheck-pos-tip-timeout 10))
```

## License

This program is free software: you can redistribute it and/or modify it under
Expand Down
19 changes: 15 additions & 4 deletions flycheck-pos-tip.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; URL: https://github.com/flycheck/flycheck-pos-tip
;; Keywords: tools, convenience
;; Version: 0.0.1
;; Package-Requires: ((flycheck "0.18") (popup "0.5.0"))
;; Package-Requires: ((flycheck "0.18") (pos-tip "0.4.5"))

;; This file is not part of GNU Emacs.

Expand All @@ -33,17 +33,26 @@
;; '(custom-set-variables
;; '(flycheck-display-errors-function #'flycheck-pos-tip-error-messages)))

;; (custom-set-variables
;; '(flycheck-pos-tip-timeout 10))

;;; Code:

(require 'flycheck)
(require 'popup)
(require 'pos-tip)

(defgroup flycheck-pos-tip nil
"Flycheck errors display in tooltip"
:prefix "flycheck-pos-tip-"
:group 'flycheck
:link '(url-link :tag "Github" "https://github.com/flycheck/flycheck-pos-tip"))

(defcustom flycheck-pos-tip-timeout 60
"Time-out second of the tool tip display.
Default is 60 seconds."
:group 'flycheck-pos-tip
:type 'integer)

;;;###autoload
(defun flycheck-pos-tip-error-messages (errors)
"Display the tooltip that the messages of ERRORS.
Expand All @@ -52,8 +61,10 @@ Concatenate all non-nil messages of ERRORS separated by empty
lines, and display them with `pos-tip-show-no-propertize', which shows
the messages in tooltip, depending on the number of lines."
(-when-let (messages (-keep #'flycheck-error-message errors))
(popup-tip
(mapconcat 'identity messages "\n"))))
(pos-tip-show-no-propertize
(mapconcat 'identity messages "\n")
nil nil nil
flycheck-pos-tip-timeout)))

(provide 'flycheck-pos-tip)

Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 65cd8f1

Please sign in to comment.