GNU bug report logs - #3973
cleanup view-mode usage in vc-resynch-window

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>

Date: Thu, 30 Jul 2009 07:55:05 UTC

Severity: minor

Tags: fixed

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Cc: 3973 <at> debbugs.gnu.org
Subject: Re: bug#3973: cleanup view-mode usage in vc-resynch-window
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



This bug report was last modified 14 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.