From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: just-the-text Emacs frame Date: Sun, 29 May 2011 12:12:08 +0200 Message-ID: References: <87aaebbndz.fsf@lifelogs.com> <4DDDA5A7.6040109@siege-engine.com> <87boyp5vyi.fsf@lifelogs.com> <87mxi8xq6y.fsf@lifelogs.com> <874o4ebtq0.fsf_-_@lifelogs.com> <87fwnyvat5.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306663949 10044 80.91.229.12 (29 May 2011 10:12:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 May 2011 10:12:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 29 12:12:25 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QQcyu-0003a4-IT for ged-emacs-devel@m.gmane.org; Sun, 29 May 2011 12:12:24 +0200 Original-Received: from localhost ([::1]:49920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQcyu-00045m-3d for ged-emacs-devel@m.gmane.org; Sun, 29 May 2011 06:12:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQcyq-00045V-MB for emacs-devel@gnu.org; Sun, 29 May 2011 06:12:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQcyp-0000hH-Hf for emacs-devel@gnu.org; Sun, 29 May 2011 06:12:20 -0400 Original-Received: from smtprelay-b22.telenor.se ([195.54.99.213]:56990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQcyp-0000ga-64 for emacs-devel@gnu.org; Sun, 29 May 2011 06:12:19 -0400 Original-Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-b22.telenor.se (Postfix) with ESMTP id 564A8DA42 for ; Sun, 29 May 2011 12:12:11 +0200 (CEST) X-SENDER-IP: [217.174.79.66] X-LISTENER: [smtpout.euromail.se] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At0KANMa4k3Zrk9CX2dsb2JhbABVmzKLDgofKSWIcb4hDoYQBJBPhEcUhAuGNg X-IronPort-AV: E=Sophos;i="4.65,288,1304287200"; d="scan'208";a="15546073" Original-Received: from unknown (HELO brown.emailprod.vodafone.se) ([217.174.79.66]) by ipb3.telenor.se with ESMTP; 29 May 2011 12:12:10 +0200 Original-Received: from springfield.emailprod.vodafone.se ([192.168.106.58]) by brown.emailprod.vodafone.se with Microsoft SMTPSVC(6.0.3790.4675); Sun, 29 May 2011 12:12:21 +0200 Original-Received: from chopper ([79.102.8.231]) by springfield.emailprod.vodafone.se with Microsoft SMTPSVC(6.0.3790.4675); Sun, 29 May 2011 12:12:20 +0200 In-Reply-To: <87fwnyvat5.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 28 May 2011 22:18:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-OriginalArrivalTime: 29 May 2011 10:12:20.0813 (UTC) FILETIME=[E592E7D0:01CC1DE8] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.54.99.213 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139877 Archived-At: Thierry Volpiatto writes: > Ted Zlatanov 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