From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: current-time-zone
Date: Mon, 22 Dec 2003 12:12:36 -0700 [thread overview]
Message-ID: <3FE74224.1020409@yahoo.com> (raw)
In-Reply-To: m3brq4nxx2.fsf@defun.localdomain
Jesper Harder wrote:
> gebser@speakeasy.net writes:
>>Should "M-x current-time-zone" return something? Using emacs v.20.7.1
>>all get in the minibuffer is "[No match]".
>>
>
> `current-time-zone' is not an interactive function. You can't call it
> with `M-x'.
But you can if you do this:
(defadvice current-time-zone (around interactive activate)
"If called interactively, display the result in the echo area (and
append to the *Messages* buffer). If a prefix arg is specified, prompt
for SPECIFIED-TIME."
(interactive (list (if current-prefix-arg
(let ((now (decode-time (current-time))))
(encode-time (string-to-number
(read-string "Year: "
(format "%d"
(nth 5 now))))
(string-to-number
(read-string "Month: "
(format "%d"
(nth 4 now))))
(string-to-number
(read-string "Day: "
(format "%d"
(nth 3 now))))
(string-to-number
(read-string "Hour: "
(format "%d"
(nth 2 now))))
(string-to-number
(read-string "Minutes: "
(format "%d"
(nth 1 now))))
(string-to-number
(read-string "Seconds: "
(format "%d"
(nth 0 now)))))))))
ad-do-it
(if (interactive-p)
(message "%s" ad-return-value)
ad-return-value))
--
Kevin Rodgers
next prev parent reply other threads:[~2003-12-22 19:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.396.1071882284.868.help-gnu-emacs@gnu.org>
2003-12-20 0:19 ` current-time-zone Jesper Harder
2003-12-22 19:12 ` Kevin Rodgers [this message]
2003-12-19 23:59 current-time-zone gebser
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3FE74224.1020409@yahoo.com \
--to=ihs_4664@yahoo.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).