From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: display-time-string-forms Date: Wed, 10 Oct 2007 11:56:08 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1192042731 27408 80.91.229.12 (10 Oct 2007 18:58:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Oct 2007 18:58:51 +0000 (UTC) To: "B. T. Raven" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 10 20:58:46 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IfglY-0001hM-Qb for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Oct 2007 20:58:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfglS-0001x2-Sd for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Oct 2007 14:58:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfglB-0001sC-8w for help-gnu-emacs@gnu.org; Wed, 10 Oct 2007 14:58:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ifgl9-0001nH-7C for help-gnu-emacs@gnu.org; Wed, 10 Oct 2007 14:58:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ifgl9-0001mv-3a for help-gnu-emacs@gnu.org; Wed, 10 Oct 2007 14:58:19 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ifgl8-000621-OP for help-gnu-emacs@gnu.org; Wed, 10 Oct 2007 14:58:18 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l9AIvA4v004068; Wed, 10 Oct 2007 12:57:10 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l9ADqUxB028429; Wed, 10 Oct 2007 12:57:10 -0600 Original-Received: from dhcp-4op11-4op12-west-130-35-178-158.us.oracle.com by acsmt350.oracle.com with ESMTP id 3282322791192042565; Wed, 10 Oct 2007 11:56:05 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-reply-to: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48319 Archived-At: > >> I have =20 > >> (setq display-time-format "%R %Y-%m-%d") > >> which gives me > >> 08:47 2007-10-10 > >> in the mode line. > >=20 > > What steps do you take to get the time to appear in your=20 > > modeline? I've messed with this and _never_ been able to get > > the time to appear in mine. >=20 > From menu: > Options > Customize Emacs > Specific options > display TAB >=20 > Then setting 2 of these options should put > '(display-time-day-and-date t) > '(display-time-mode t nil (time)) >=20 > into your .emacs custom-set-variables section. > There is also the function > display-time-string-forms > with which I haven't messed. >=20 > Btw, this is in version 21.3. Newer versions certainly have the same=20 > functionality. Icicles can help you _find_ what you might need to customize: M-x icicle-vardoc RET .* C-q C-g C-j .*time S-SPC .*mode[- ]line This shows, as completion candidates, all variables, with their doc = strings, for which all of the following are true: * the variable name matches anything: .* * the doc string contains "time": .*time * the doc string also contains either "mode-line" or "mode line": .*mode[- ]line The order in the doc string of "time" and "mode-line" (or "mode line") = does not matter - all possible orders are considered when you use = `S-SPC'. The incantation C-q C-g C-j just matches the separator used between = variable name and doc string, for each completion candidate. The default = separator is C-g C-j, and C-q is used to quote the C-q character. (In = Icicles, C-j is self-inserting and does not need to be quoted.) This quickly shows you the following completion candidates (in = *Completions*): appt-display-mode-line *Non-nil means display minutes to appointment and time on the mode = line. This is in addition to any other display of appointment messages. -- display-time-format *String specifying format for displaying the time in the mode line. See the function `format-time-string' for an explanation of how to write this string. If this is nil, the defaults depend on `display-time-day-and-date' and `display-time-24hr-format'. -- display-time-hook *List of functions to be called when the time is updated on the mode = line. -- display-time-interval *Seconds between updates of time in the mode line. -- display-time-string-forms *List of expressions governing display of the time in the mode line. For most purposes, you can control the time format using = `display-time-format' which is a more standard interface. This expression is a list of expressions that can involve the keywords `load', `day', `month', and `year', `12-hours', `24-hours', `minutes', `seconds', all numbers in string form, and `monthname', `dayname', = `am-pm', and `time-zone' all alphabetic strings, and `mail' a true/nil value. For example, the form '((substring year -2) "/" month "/" day " " 24-hours ":" minutes ":" seconds (if time-zone " (") time-zone (if time-zone ")") (if mail " Mail" "")) would give mode line times like `94/12/30 21:07:48 (UTC)'. -- You can further reduce the number of candidates by filtering with one or = more additional patterns (e.g. S-SPC format). Even more generally, you can look at all functions and all variables = whose doc strings contain the strings "time" and either "mode-line" or = "mode line": M-x icicle-doc RET time S-SPC mode[- ]line That shows, as completion candidates, the doc strings of all functions = and all variables that contain both "time" and either "mode-line" or = "mode line", in either order. Click `mouse-2' on any candidate to see it = (including the function or variable name) displayed in *Help*. Again, = you can use additional patterns to further reduce the number of hits.