From: "Johan Bockgård" <bojohan@gnu.org>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: martin rudalics <rudalics@gmx.at>,
Dmitry Gutov <dgutov@yandex.ru>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp?
Date: Tue, 16 Feb 2016 22:33:38 +0100 [thread overview]
Message-ID: <87lh6kl4r1.fsf@gnu.org> (raw)
In-Reply-To: <56C38101.1000202@gmail.com> ("Clément Pit--Claudel"'s message of "Tue, 16 Feb 2016 15:05:21 -0500")
Clément Pit--Claudel <clement.pit@gmail.com> writes:
> Indeed, that's what I'd like. x-show-tip works perfectly for me (it
> supports fonts, faces, etc. properly), expect for the fact that
> updating the tooltip text causes it to be closed and reopened.
Try this:
(let* ((x-gtk-use-system-tooltips nil)
(list '("abc" "def" "ghi" "jkl" "mno"))
(L (length list))
(n 0)
(f (lambda ()
(let ((tmp -1))
(mapconcat
(lambda (s)
(setq tmp (1+ tmp))
(if (= n tmp)
(propertize s 'face 'highlight)
(propertize s 'face 'default)))
list "\n"))))
(offset 0)
(edges (window-edges nil t t t))
(xy (posn-x-y (posn-at-point (point))))
(left (+ (car edges) (car xy) (* (frame-char-width) offset)))
(top (+ (cadr edges) (cdr xy) (frame-char-height)))
(parameters
(list (cons 'left left) (cons 'top top) '(border-width . 0))))
(unwind-protect
(progn (x-show-tip (funcall f) nil parameters most-positive-fixnum)
(while
(progn
(with-current-buffer (get-buffer " *tip*")
(erase-buffer)
(insert (funcall f)))
(pcase (read-key)
('down (setq n (mod (1+ n) L)))
('up (setq n (mod (1- n) L)))
(_ nil)))))
(x-hide-tip)))
;; <-- C-x C-e <down>/<up> ...
next prev parent reply other threads:[~2016-02-16 21:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 15:01 Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp? Clément Pit--Claudel
2016-02-13 2:15 ` Chris Feng
2016-02-13 3:35 ` Clément Pit--Claudel
2016-02-13 3:57 ` Chris Feng
2016-02-16 20:12 ` Creating a "borderless" frame (without WM chrome) (was Re: Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp?) Clément Pit--Claudel
2016-02-16 22:41 ` Chris Feng
2016-02-16 22:55 ` Clément Pit--Claudel
2016-02-16 23:14 ` Chris Feng
2016-02-16 23:46 ` Clément Pit--Claudel
2016-02-17 9:13 ` martin rudalics
2016-02-17 13:49 ` Chris Feng
2016-02-17 14:55 ` Clément Pit--Claudel
2016-02-18 1:28 ` Chris Feng
2016-02-17 14:57 ` Clément Pit--Claudel
2016-02-18 10:51 ` martin rudalics
2016-02-14 14:05 ` Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp? Stefan Monnier
2016-02-14 16:44 ` Eli Zaretskii
2016-02-14 17:19 ` Stefan Monnier
2016-02-14 18:00 ` Eli Zaretskii
2016-02-16 20:06 ` Clément Pit--Claudel
2016-02-15 10:57 ` martin rudalics
2016-02-15 13:31 ` Stefan Monnier
2016-02-16 20:06 ` Clément Pit--Claudel
2016-02-16 20:05 ` Clément Pit--Claudel
2016-02-16 21:33 ` Johan Bockgård [this message]
2016-02-16 22:18 ` Clément Pit--Claudel
2016-02-17 9:12 ` martin rudalics
2016-02-17 14:26 ` Clément Pit--Claudel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lh6kl4r1.fsf@gnu.org \
--to=bojohan@gnu.org \
--cc=clement.pit@gmail.com \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.