emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: just-the-text Emacs frame


From: joakim
Subject: Re: just-the-text Emacs frame
Date: Sun, 29 May 2011 12:12:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> 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).

I tried this and it was nice. I use a fullscreen Emacs ond the popup
lets me not move the focus from where I am in the buffer. I will try
Teds frame solution next.

>
> (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))
>
>> 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
>>
>>
>>

-- 
Joakim Verona



reply via email to

[Prev in Thread] Current Thread [Next in Thread]