From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Greg A. Woods" <woods@robohack.ca>
Cc: 20539@debbugs.gnu.org
Subject: bug#20539: 24.5; magit-auto-revert-mode broken by 24.5 upgrade with change to behaviour of `let`
Date: Sun, 10 May 2015 22:33:21 -0400 [thread overview]
Message-ID: <jwvh9rj26fx.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <m1YrBBV-0037iFC@more.local> (Greg A. Woods's message of "Sat, 09 May 2015 13:17:17 -0700")
> +++ /Users/gaw/.emacs.d/elpa/magit-1.4.1/magit.el 2015-05-09 13:04:57.000000000 -0700
> @@ -4065,7 +4065,8 @@
> (and file (string-prefix-p topdir file)
> (not (string-prefix-p gitdir file))
> (member (file-relative-name file topdir) tracked)
> - (let ((auto-revert-mode t))
> + (progn
> + (auto-revert-mode t)
> (auto-revert-handler)
> (run-hooks 'magit-revert-buffer-hook))))))))))
I see you've figured that the above patch won't really do what you want,
and that calling auto-revert-handler is a bad idea here.
I think it should just check if the buffer is modified and if not call
revert-buffer. The obvious other place where such a code can be found
is in PCL-CVS where we did the exact same thing for the same reasons
(before auto-revert-mode existed):
(unless (or (null buffer)
(memq (cvs-fileinfo->type fileinfo) '(MESSAGE UNKNOWN))
;; FIXME: check whether revert is really needed.
;; `(verify-visited-file-modtime buffer)' doesn't cut it
;; because it only looks at the time stamp (it ignores
;; read-write changes) which is not changed by `commit'.
(buffer-modified-p buffer))
(with-current-buffer buffer
(ignore-errors
(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)
;; `preserve-modes' avoids changing the (minor) modes. But we
;; do want to reset the mode for VC, so we do it explicitly.
(vc-find-file-hook)
(when (eq (cvs-fileinfo->type fileinfo) 'CONFLICT)
(smerge-start-session))))))))
-- Stefan
prev parent reply other threads:[~2015-05-11 2:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-09 20:17 bug#20539: 24.5; magit-auto-revert-mode broken by 24.5 upgrade with change to behaviour of `let` Greg A. Woods
2015-05-09 22:26 ` Greg A. Woods
2017-12-08 1:43 ` Noam Postavsky
2015-05-11 2:33 ` Stefan Monnier [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=jwvh9rj26fx.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=20539@debbugs.gnu.org \
--cc=woods@robohack.ca \
/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.