From: "Drew Adams" <drew.adams@oracle.com>
To: "B. T. Raven" <nihil@nihilo.net>, <help-gnu-emacs@gnu.org>
Subject: RE: display-time-string-forms
Date: Wed, 10 Oct 2007 11:56:08 -0700 [thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICIEHMEAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <d-WdnUsSp4TdZZHanZ2dnUVZ_q6hnZ2d@sysmatrix.net>
> >> I have
> >> (setq display-time-format "%R %Y-%m-%d")
> >> which gives me
> >> 08:47 2007-10-10
> >> in the mode line.
> >
> > What steps do you take to get the time to appear in your
> > modeline? I've messed with this and _never_ been able to get
> > the time to appear in mine.
>
> From menu:
> Options
> Customize Emacs
> Specific options
> display TAB
>
> Then setting 2 of these options should put
> '(display-time-day-and-date t)
> '(display-time-mode t nil (time))
>
> into your .emacs custom-set-variables section.
> There is also the function
> display-time-string-forms
> with which I haven't messed.
>
> Btw, this is in version 21.3. Newer versions certainly have the same
> 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.
next prev parent reply other threads:[~2007-10-10 18:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 23:11 display-time-string-forms Sean Sieger
2007-10-10 6:53 ` display-time-string-forms Dieter Wilhelm
2007-10-10 8:28 ` display-time-string-forms Peter Dyballa
[not found] ` <mailman.1909.1191999022.18990.help-gnu-emacs@gnu.org>
2007-10-10 12:05 ` display-time-string-forms Warren Oates
2007-10-10 16:04 ` display-time-string-forms B. T. Raven
2007-10-10 18:56 ` Drew Adams [this message]
2007-10-10 19:50 ` display-time-string-forms Peter Dyballa
2007-10-11 0:25 ` display-time-string-forms Dieter Wilhelm
2007-10-10 18:00 ` display-time-string-forms Sean Sieger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DNEMKBNJBGPAOPIJOOICIEHMEAAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=nihil@nihilo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.