[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
just-the-text Emacs frame (was: Emacs as a desktop environment)
From: |
Ted Zlatanov |
Subject: |
just-the-text Emacs frame (was: Emacs as a desktop environment) |
Date: |
Sat, 28 May 2011 12:49:59 -0500 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) |
I just want to display some text, nothing else. How about this (based
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
- Re: BBDB in the GNU ELPA, (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 <=
- 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, 2011/05/28
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