all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "Pascal J. Bourguignon" <pjb@informatimago.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to compare time of last file modification?
Date: Sun, 01 Jul 2012 11:23:03 +0200	[thread overview]
Message-ID: <87txxr4yyw.fsf@gmx.de> (raw)
In-Reply-To: <87bok0nuw4.fsf@kuiper.lan.informatimago.com> (Pascal J. Bourguignon's message of "Sun, 01 Jul 2012 03:16:11 +0200")

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

>     (defun time-lessp (t1 t2)
>       "Returns whether t1<t2
>     t1 and t2 are lists of two integers. The first integer has the
>     high-order 16 bits of time, the second has the low 16 bits."
>       (destructuring-bind (h1 l1) t1
>         (destructuring-bind (h2 l2) t2
>            (cond
>              ((< h1 h2) t)
>              ((> h1 h2) nil)
>              (t (cond ((< l1 l2) t)
>                       (t         nil)))))))

In Tramp, we use

(defun tramp-time-less-p (t1 t2)
  "Say whether time value T1 is less than time value T2."
  (unless t1 (setq t1 '(0 0)))
  (unless t2 (setq t2 '(0 0)))
  (or (< (car t1) (car t2))
      (and (= (car t1) (car t2))
	   (< (nth 1 t1) (nth 1 t2)))))

Best regards, Michael.



  parent reply	other threads:[~2012-07-01  9:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3790.1341102956.855.help-gnu-emacs@gnu.org>
2012-07-01  1:16 ` How to compare time of last file modification? Pascal J. Bourguignon
2012-07-01  8:56   ` Thorsten Jolitz
2012-07-01  9:23   ` Michael Albinus [this message]
2012-07-01 10:13 ` Lars Magne Ingebrigtsen
2012-07-01 17:26   ` Thorsten Jolitz
     [not found]   ` <mailman.3833.1341163416.855.help-gnu-emacs@gnu.org>
2012-07-01 17:36     ` Pascal J. Bourguignon
2012-07-01 21:11       ` Lars Magne Ingebrigtsen
2012-07-01 19:48     ` Barry Margolin
2012-07-01 20:26       ` Thorsten Jolitz
2012-07-01  0:38 Thorsten Jolitz
2012-07-01  0:41 ` Thorsten Jolitz

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=87txxr4yyw.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pjb@informatimago.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.
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.