unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: mvoteiza@udel.edu, 28921@debbugs.gnu.org
Subject: bug#28921: [PROPOSED] Fix xdg timestamp error on 32-bit Emacs
Date: Sat, 21 Oct 2017 18:11:24 +0900	[thread overview]
Message-ID: <874lqs6f2b.fsf@gmail.com> (raw)
In-Reply-To: <20171021030455.16035-1-eggert@cs.ucla.edu> (Paul Eggert's message of "Fri, 20 Oct 2017 20:04:55 -0700")

Paul Eggert <eggert@cs.ucla.edu> writes:

>  (defun xdg-thumb-mtime (filename)
> -  "Return modification time of FILENAME as integral seconds from the epoch."
> -  (floor (float-time (nth 5 (file-attributes filename)))))
> +  "Return modification time of FILENAME as an Emacs timestamp."
> +  (nth 5 (file-attributes filename)))
Maybe you could use here the new accesor `file-attribute-modification-time':

diff --git a/lisp/xdg.el b/lisp/xdg.el
index 4250faaeb4..9edc3d2629 100644
--- a/lisp/xdg.el
+++ b/lisp/xdg.el
@@ -94,8 +94,8 @@ xdg-thumb-name
   (concat (md5 (xdg-thumb-uri filename)) ".png"))
 
 (defun xdg-thumb-mtime (filename)
-  "Return modification time of FILENAME as integral seconds from the epoch."
-  (floor (float-time (nth 5 (file-attributes filename)))))
+  "Return modification time of FILENAME as an Emacs timestamp."
+  (file-attribute-modification-time (file-attributes filename)))
 
 \f
 ;; XDG User Directories





  parent reply	other threads:[~2017-10-21  9:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-21  3:04 bug#28921: [PROPOSED] Fix xdg timestamp error on 32-bit Emacs Paul Eggert
2017-10-21  7:19 ` Eli Zaretskii
2017-10-21  9:11 ` Tino Calancha [this message]
2017-10-22  7:41   ` Paul Eggert
2017-10-21 14:26 ` Mark Oteiza

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=874lqs6f2b.fsf@gmail.com \
    --to=tino.calancha@gmail.com \
    --cc=28921@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=mvoteiza@udel.edu \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).