Subject: bug#3973: cleanup view-mode usage in vc-resynch-window

From: Stefan Monnier <[email-masked]>
Date: Fri, 31 Jul 2009 15:19:18 -0400

> The function would look like this:

> (defun view-maybe-enter-exit (file)
>   (if (file-writable-p file)
>       (and view-mode
>          (let ((view-old-buffer-read-only nil))
>               (view-mode-exit)))
>     (and (not view-mode)
>      (not (eq (get major-mode 'mode-class) 'special))
>       (view-mode-enter))))

> but the calling convention is strange: it needs to be called with a
> buffer selected and pass the file name...  Not sure it's worth it.

Why do we need to pass `file'?
Can't we (assert (equal file buffer-file-name))?

> At least the TODO comment can go and be replaced with a comment about
> why changing the state of view-mode is needed there.

Yes, please.

>> Maybe a better option in the longer term is refine the meaning of the
>> `preserve-modes' arg to revert-buffer, so that some minor modes can
>> request to be refreshed or not (the VC state is one that would also
>> benefit from such a change, as can be seen in auto-revert-mode).

> That sounds like a good idea.  Unfortunately I am not familiar with that
> code, it is quite complex and critical, and I don't think it's too
> important to fix it now, so I'll punt.

Wise choice,

        Stefan