From: Rasmus <rasmus@gmx.us>
To: help-gnu-emacs@gnu.org
Subject: Re: vc.el and modified time
Date: Wed, 27 Apr 2016 19:17:15 +0200 [thread overview]
Message-ID: <87bn4vq8dg.fsf@gmx.us> (raw)
In-Reply-To: jwvpotbvylc.fsf-monnier+gmane.emacs.help@gnu.org
Hi Stefan,
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> 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).
Brilliant! I read that part, but I didn’t understand since the signature
of vc-print-log didn’t have a buffer argument (only the vc-backend-log
functions). Thanks for showing me how to use vc-call!
>> 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>)))
Cool, thanks!
> [ Here, I presume you're using -*- lexical-binding:t -*-, which I strongly
> recommend. ]
Yes.
Thanks for the hints!
Rasmus
--
You people at the NSA are becoming my new best friends!
prev parent reply other threads:[~2016-04-27 17:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 15:36 vc.el and modified time Rasmus
2016-04-27 16:06 ` Stefan Monnier
2016-04-27 17:17 ` Rasmus [this message]
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=87bn4vq8dg.fsf@gmx.us \
--to=rasmus@gmx.us \
--cc=help-gnu-emacs@gnu.org \
/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.