help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vc.el and modified time


From: Stefan Monnier
Subject: Re: vc.el and modified time
Date: Wed, 27 Apr 2016 12:06:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> My first attempt is below, but I’m not entirely happy with it.  First, it
> is intrusive as it might overwrite the user’s *vc-change-log*.

You can avoid hardcoding it by using

   (vc-call print-log file <buf> ...)

See lisp/vc/vc.el's commentary where it describes

    ;; * print-log (files buffer &optional shortlog start-revision limit)
    ;;
    ;;   Insert the revision log for FILES into BUFFER.
    ;;   If SHORTLOG is true insert a short version of the log.
    ;;   If LIMIT is true insert only insert LIMIT log entries.  If the
    ;;   backend does not support limiting the number of entries to show
    ;;   it should return `limit-unsupported'.
    ;;   If START-REVISION is given, then show the log starting from that
    ;;   revision ("starting" in the sense of it being the _newest_
    ;;   revision shown, rather than the working revision, which is normally
    ;;   the case).  Not all backends support this.  At present, this is
    ;;   only ever used with LIMIT = 1 (by
    ;;   vc-annotate-show-log-revision-at-line).

> Second, *vc-change-log* is build asynchronously, at least sometimes,
> and I don’t know how I can check if it’s done.

You can do

   (with-current-buffer <buf>
     (vc-exec-after
      (lambda ()
        <the-code-to-run-after-print-log-is-done>)))

[ Here, I presume you're using -*- lexical-binding:t -*-, which I strongly
  recommend.  ]


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]