emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [patch] get modification-time from vc
Date: Wed, 18 May 2016 18:45:06 +0200	[thread overview]
Message-ID: <8737pfxqlp.fsf@saiph.selenimh> (raw)
In-Reply-To: <87k2irad3q.fsf@gmx.us> (rasmus@gmx.us's message of "Wed, 18 May 2016 12:12:57 +0200")

Hello,

Rasmus <rasmus@gmx.us> writes:

> Here’s a new version.

Thank you.

> New idea, an optional 2nd argument to modification-time.  E.g.
>
>     {{{modification-time(%Y, vc)}}}

Even better!

>> If you think that is useful, then I vote for a different macro.
>
> I prefer an argument as it gives a clear ranking: get the modified time
> from vc, if possible (if the second argument is vc), otherwise get it from
> the file system (also default behavior).

Why enforcing "vc" and not any non-nil/non-empty second argument instead ?

> Is cl-lib OK now?!

cl-lib is OK in master. Minimal requirement for master is Emacs 24.3.

> +the modification date and time, respectively.  @var{FORMAT} should be a
> +format string understood by @code{format-time-string}.  If the second
> +argument to the @code{modification-time} macro is @samp{vc}, Org will try to
> +find the modification time via version control (using @code{vc.el}).

Suggestion:

  Org retrieves the information from the version control system (using
  @file{vc.el}) instead of the file attributes.

> +			  (format "(eval (format-time-string \"$1\" (or (when (equal (org-trim (downcase \"$2\")) \"vc\") (org-macro--vc-modified-time %s)) '%s)))"

when => and

> +		       (when (cl-some 'identity time)
> +			 (setq date (apply #'encode-time time))))))))

Why #'encode-time and not #'identity ?

In any case, this looks good. Please push when you're happy with the
result.

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2016-05-18 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 15:43 [patch] get modification-time from vc Rasmus
2016-04-30 21:43 ` Nicolas Goaziou
2016-05-18 10:12   ` Rasmus
2016-05-18 16:45     ` Nicolas Goaziou [this message]
2016-05-18 19:45       ` Rasmus
2016-05-19  7:47         ` Nicolas Goaziou

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737pfxqlp.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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/org-mode.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).