From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.help Subject: Re: Minibuffer tray to display current time and date Date: Tue, 28 Apr 2015 19:27:05 +0200 Message-ID: References: <87h9s7hd7a.fsf@debian.uxu> <87383qvoi4.fsf@debian.uxu> <874mo6bgzx.fsf@debian.uxu> <20150424141319.GA19093@tuxteam.de> <831tj9zizy.fsf@gnu.org> <87ioclo9p5.fsf@yale.edu> <83wq11xyiu.fsf@gnu.org> <87h9s3havb.fsf@yale.edu> <83bnibx7wy.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1430242050 28442 80.91.229.3 (28 Apr 2015 17:27:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 17:27:30 +0000 (UTC) Cc: help-gnu-emacs To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 28 19:27:24 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Yn9I3-0000FX-Oc for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 19:27:24 +0200 Original-Received: from localhost ([::1]:35170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn9I2-0006Yn-Sr for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 13:27:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn9Hr-0006VY-DC for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 13:27:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn9Hn-00065S-P8 for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 13:27:11 -0400 Original-Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]:32772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn9Hn-000658-B0 for help-gnu-emacs@gnu.org; Tue, 28 Apr 2015 13:27:07 -0400 Original-Received: by layy10 with SMTP id y10so1388948lay.0 for ; Tue, 28 Apr 2015 10:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=N5l6epltx8SEA+VaDoHg4bq5zkuVo6hN1/B63c3mFfo=; b=YrJOeHNnIysqmU8FbwrjhMqwUcD1sz/8FRUaX5RBsF+LWM358uclU7NzAPsDolbKn4 cLsoPFwh8Jf3GJDEGxuc/PHWDrx1cdek8UcV3KFolk3MAIjQZENL0Z0ZSz3yZ8fuwpdY VUZjyimBZOE7Zi6o0OYwa+DwqRTJlB8X70hNPFiUzM5CgofRZx7oMJiuZMZifKStH+8C Gqp+VQIbItU53inv/DZvvv6dpzQdbVbQYhznC+i7cKXQ9+RLLprlrYhc39M7G4KlNa/O X9mmDd09w4RuXe7MZFhDnWxHb8j5d4F5PKy+FnTMdb3+TQgszIsdZyUa5+TEMF9zBJop PkHQ== X-Received: by 10.112.142.232 with SMTP id rz8mr14944782lbb.74.1430242025795; Tue, 28 Apr 2015 10:27:05 -0700 (PDT) Original-Received: by 10.112.36.103 with HTTP; Tue, 28 Apr 2015 10:27:05 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::230 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104039 Archived-At: =E2=80=8BSweet, Stefan. Thanks a lot. I've just installed it, and even th= ough it's that simple, yet does the job. One feature I thought about is justifying it to the right. This function should do the job: (defun minibuffer-line-right-justified (string) (format (format "%d %%s" (- (window-width (minibuffer-window)) (length string))) string)) and then: (setq-default minibuffer-line-format '((:eval (minibuffer-line-right-justified (format-time-string "%R %F"))))) The problem occurs when Emacs frame is resized, for example. So probably `minibuffer-line--update' would have to be installed as a hook or post--advice to resizing routines. Unfortunately, I'm not sure how to do that correctly. What do you think? Also, it would be nice to have an ability to highlight only certain parts of this minibuffer line. For instance, I've tried: (setq-default minibuffer-line-format '((:eval (propertize (format-time-string "%R") 'font-lock-face 'minibuffer-line-time)) " " (:eval (format-time-string "%F")))) Where `minibuffer-line-time' was my custom face, but it did not work. I assume that this is due to the `(format-mode-line minibuffer-line-format 'minibuffer-line)' call. Lastly, (defgroup minibuffer-line () "Use the idle minibuffer window to display status information." :group 'mode-line) what about a new separate group `minibuffer-line'? Kind regards, Alexander On Mon, Apr 27, 2015 at 2:36 AM, Stefan Monnier wrote: > BTW, I've just pushed a new `minibuffer-line' package to elpa.git which > provides a new `minibuffer-line-mode' controlled by > `minibuffer-line-format'. It defaults to displaying the hostname, date, > and time. > > > Stefan > > >