Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: printing file last-modify date and time

0 views
Skip to first unread message

O

unread,
Feb 4, 2011, 7:22:45 PM2/4/11
to help-gn...@gnu.org

Hi all,

I'd like to write a command that prints the last-modify date and time
of the file open in the current buffer, in the format: 20110204-1920 
(for 7:20pm on 4 feb 2011).  Suggestions?

Thanks,

O


Le Wang

unread,
Feb 4, 2011, 9:09:43 PM2/4/11
to O, help-gn...@gnu.org
Sure.  Read the emacs lisp manual, when you can't find something you need, google it, If that fails come back and ask specific questions.

 
--
Le

Deniz Dogan

unread,
Feb 4, 2011, 9:26:45 PM2/4/11
to O, help-gn...@gnu.org
2011/2/5 O <mond...@gmail.com>:

>
> Hi all,
>
> I'd like to write a command that prints the last-modify date and time
> of the file open in the current buffer, in the format: 20110204-1920
> (for 7:20pm on 4 feb 2011).  Suggestions?
>

(defun insert-modification-time ()
(interactive "*")
(if buffer-file-name
(insert
(format-time-string
"%Y%m%d-%H%M"
(nth 5 (file-attributes buffer-file-name))))
(message "No file associated with buffer.")))


--
Deniz Dogan

0 new messages