branch: elpa/helm
commit a566e62dcffb00328953cb61c87c97c58dfb41da
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Get rid of popup dependency
---
 helm-utils.el | 34 +++++++++++++++++++++++++++-------
 helm.el       |  2 +-
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/helm-utils.el b/helm-utils.el
index 86a23c9507..5882bab5cb 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -23,7 +23,6 @@
 
 (declare-function helm-find-files-1 "helm-files" (fname &optional preselect))
 (declare-function helm-grep-split-line "helm-grep" (line))
-(declare-function popup-tip "ext:popup")
 (declare-function markdown-show-entry "ext:markdown-mode.el")
 (declare-function outline-show-subtree "outline")
 (declare-function org-reveal "org")
@@ -1005,16 +1004,37 @@ Assume regexp is a pcre based regexp."
 ;;; Popup buffer-name or filename in grep/moccur/imenu-all.
 ;;
 (defvar helm--show-help-echo-timer nil)
+(defvar helm--maybe-show-help-echo-overlay nil)
+(defface helm-tooltip
+  `((t :background "Goldenrod"
+       :foreground "black"))
+  "Face used by `helm-tooltip-show'."
+  :group 'helm-grep-faces)
 
 (defun helm-cancel-help-echo-timer ()
   (when helm--show-help-echo-timer
     (cancel-timer helm--show-help-echo-timer)
-    (setq helm--show-help-echo-timer nil)))
+    (setq helm--show-help-echo-timer nil))
+  (when helm--maybe-show-help-echo-overlay
+    (delete-overlay helm--maybe-show-help-echo-overlay)
+    (setq helm--maybe-show-help-echo-overlay nil)))
+
+(defun helm-tooltip-show (text pos)
+  "Display TEXT at POS in an overlay."
+  (setq helm--maybe-show-help-echo-overlay
+        (make-overlay pos (1+ pos)))
+  (overlay-put helm--maybe-show-help-echo-overlay
+               'display
+               (propertize
+                (concat text "\n")
+                'face 'helm-tooltip)))
 
 (defun helm-maybe-show-help-echo ()
   (when helm--show-help-echo-timer
     (cancel-timer helm--show-help-echo-timer)
     (setq helm--show-help-echo-timer nil))
+  (when helm--maybe-show-help-echo-overlay
+    (delete-overlay helm--maybe-show-help-echo-overlay))
   (when (and helm-alive-p
              helm-popup-tip-mode
              (member (assoc-default 'name (helm-get-current-source))
@@ -1026,11 +1046,11 @@ Assume regexp is a pcre based regexp."
              (save-selected-window
                (with-helm-window
                  (helm-aif (get-text-property (pos-bol) 'help-echo)
-                     (popup-tip (concat " " (abbreviate-file-name
-                                             (replace-regexp-in-string "\n.*" 
"" it)))
-                                :around nil
-                                :point (save-excursion
-                                         (end-of-visual-line) (point)))))))))))
+                     (helm-tooltip-show
+                      (concat " " (abbreviate-file-name
+                                   (replace-regexp-in-string "\n.*" "" it)))
+                      (save-excursion
+                        (end-of-visual-line) (point)))))))))))
 
 ;;;###autoload
 (define-minor-mode helm-popup-tip-mode
diff --git a/helm.el b/helm.el
index 188da11361..3e13d9deb0 100644
--- a/helm.el
+++ b/helm.el
@@ -13,7 +13,7 @@
 ;; Author: Thierry Volpiatto <thie...@posteo.net>
 ;; Version: 3.9.8
 ;; URL: https://emacs-helm.github.io/helm/
-;; Package-Requires: ((helm-core "3.9.8") (wfnames "1.1") (popup "0.5.3"))
+;; Package-Requires: ((helm-core "3.9.8") (wfnames "1.1"))
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by

Reply via email to