unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Peter Tury" <peter.tury@nokia.com>
Subject: Re: automatic time-stamp
Date: Wed, 04 May 2005 06:46:39 GMT	[thread overview]
Message-ID: <jd_de.1052$f4.16388@news1.nokia.com> (raw)
In-Reply-To: w6Ude.26842$r81.5612@trnddc02

"Jeffrey L. Greer" <jlgreer1@excite.com> wrote in message
news:w6Ude.26842$r81.5612@trnddc02...
> I am trying to configure automatic time-stamp for emacs 21 in a Debian
> Sarge system. I have the following .emacs file in my home directory. I
> have read and re-read what seems to be the relevant pages in the hard
> copy of Gnu Emacs Manual. Time stamp will only work manually.
>
> Suggestions please? Thank you, Jeff Greer
>
> (custom-set-variables
>   ;; custom-set-variables was added by Custom -- don't edit or cut/paste
it!
>   ;; Your init file should contain only one such instance.
>  '(add-hook (quote write-file-hooks) t)
>  '(case-fold-search t)
>  '(column-number-mode t)
>  '(current-language-environment "English")
>  '(global-font-lock-mode t nil (font-lock))
>  '(time-stamp-active t))

Hi,

I don't know whether this will help you, but the on-line help (C-h a
time-stamp) writes this:

time-stamp is an interactive autoloaded Lisp function in `time-stamp'.
[Arg list not available until function definition is loaded.]

Update the time stamp string(s) in the buffer.
A template in a file can be automatically updated with a new time stamp
every time you save the file.  Add this line to your .emacs file:
    (add-hook 'write-file-hooks 'time-stamp)
Normally the template must appear in the first 8 lines of a file and
look like one of the following:
      Time-stamp: <>
      Time-stamp: " "
The time stamp is written between the brackets or quotes:
      Time-stamp: <1998-02-18 10:20:51 gildea>
The time stamp is updated only if the variable `time-stamp-active' is
non-nil.
The format of the time stamp is set by the variable `time-stamp-format'.
The variables `time-stamp-line-limit', `time-stamp-start', `time-stamp-end',
`time-stamp-count', and `time-stamp-inserts-lines' control finding the
template.

So I think (add-hook 'write-file-hooks 'time-stamp) should be added to your
.emacs (+ the appropriate templates to your files?).

Br,
P

  reply	other threads:[~2005-05-04  6:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-03 23:49 automatic time-stamp Jeffrey L. Greer
2005-05-04  6:46 ` Peter Tury [this message]
2005-05-04  6:50 ` Holger Sparr
2005-05-04  8:19 ` Tim X
2005-05-04 10:48   ` Jeffrey L. Greer
2005-05-04 20:58 ` Peter Dyballa

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='jd_de.1052$f4.16388@news1.nokia.com' \
    --to=peter.tury@nokia.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).