[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: just-the-text Emacs frame
From: |
Thierry Volpiatto |
Subject: |
Re: just-the-text Emacs frame |
Date: |
Sat, 28 May 2011 22:18:14 +0200 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) |
Ted Zlatanov <address@hidden> writes:
> I just want to display some text, nothing else. How about this (based
Do you know popup.el? (you should find it on emacswiki in auto-complete).
--8<---------------cut here---------------start------------->8---
(require 'popup)
(defun popup-info-string ()
(format "%s\n%s\n%s\n%s"
(format-time-string "%H:%M %Y-%m-%d" (current-time))
(battery-format battery-echo-area-format (funcall
battery-status-function))
(timeclock-status-string)
(shell-command-to-string "nmcli -p dev")))
(popup-tip (popup-info-string))
--8<---------------cut here---------------end--------------->8---
> on your code) to show some arbitrary text in a popup (no menus,
> modeline, etc., just the buffer is visible)? I think it will DTRT
> whether the frame is shown already or not. I can use this to show the
> indicators, icons, and status messages.
>
> #+begin_src lisp
> (require 'battery)
> (require 'timeclock)
>
> (defvar popup-info-frame)
>
> (defun popup-info-string ()
> (format "%s\n%s\n%s\n%s"
> (format-time-string "%H:%M %Y-%m-%d" (current-time))
> (battery-format battery-echo-area-format (funcall
> battery-status-function))
> (timeclock-status-string)
> (shell-command-to-string "nmcli -p dev")))
>
> (defun popup-info ()
> (interactive)
> (popup-info--1 " *popup status*"))
>
> (defun popup-info--1 (bufname)
> (with-current-buffer (get-buffer-create bufname)
> (make-local-variable 'popup-info-frame)
> (if (and (boundp 'popup-info-frame)
> popup-info-frame
> (member popup-info-frame (frame-list)))
> (select-frame popup-info-frame)
> (let ((default-frame-alist '((minibuffer . nil)
> (width . 20)
> (border-width . 0)
> (menu-bar-lines . 0)
> (tool-bar-lines . 0)
> (unsplittable . t)
> (left-fringe . 0))))
> (switch-to-buffer-other-frame bufname)
> (setq popup-info-frame (selected-frame))))
> (erase-buffer)
> (setq mode-line-format nil)
> (redraw-modeline)
> (insert (popup-info-string))))
>
> #+end_src
>
> Let me know what you think. It supports any number of status buffers by
> name and behaves correctly even if the frame is closed.
>
> Thanks!
> Ted
>
>
>
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
- Re: Emacs as a desktop environment, (continued)
- Re: Emacs as a desktop environment, Eric M. Ludlam, 2011/05/25
- Re: Emacs as a desktop environment, Ted Zlatanov, 2011/05/26
- Re: Emacs as a desktop environment, joakim, 2011/05/26
- Re: Emacs as a desktop environment, Ted Zlatanov, 2011/05/27
- Re: Emacs as a desktop environment, joakim, 2011/05/28
- just-the-text Emacs frame (was: Emacs as a desktop environment), Ted Zlatanov, 2011/05/28
- Emacs24 Mobile (was: Re: just-the-text Emacs frame (was: Emacs as a desktop environment)), Mohsen BANAN, 2011/05/28
- Re: Emacs24 Mobile, Ted Zlatanov, 2011/05/28
- Re: Emacs24 Mobile, T.V. Raman, 2011/05/28
- Re: Emacs24 Mobile, Lars Magne Ingebrigtsen, 2011/05/30
- Re: just-the-text Emacs frame,
Thierry Volpiatto <=
- Re: just-the-text Emacs frame, Ted Zlatanov, 2011/05/28
- Re: just-the-text Emacs frame, joakim, 2011/05/29
- Re: Emacs as a desktop environment, Tom Tromey, 2011/05/26