GNU bug report logs -
#3973
cleanup view-mode usage in vc-resynch-window
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3973 in the body.
You can then email your comments to 3973 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Thu, 30 Jul 2009 07:55:06 GMT)
Full text and
rfc822 format available.
Message #3 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
vc-resynch-window contains this code:
;; TODO: Adjusting view mode might no longer be necessary
;; after RMS change to files.el of 1999-08-08. Investigate
;; this when we install the new VC.
(and view-read-only
(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))))
not sure what it's supposed to do...
But the comment (added in Apr 2000!) seems to say that it can be removed.
Should it?
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Thu, 30 Jul 2009 21:20:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 30 Jul 2009 21:20:05 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
> not sure what it's supposed to do...
> But the comment (added in Apr 2000!) seems to say that it can be removed.
> Should it?
I don't know. Someone needs to try it,
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Thu, 30 Jul 2009 21:20:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Thu, 30 Jul 2009 21:20:09 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Thu, 30 Jul 2009 22:10:08 GMT)
Full text and
rfc822 format available.
Message #16 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
> > not sure what it's supposed to do...
> > But the comment (added in Apr 2000!) seems to say that it can be removed.
> > Should it?
>
> I don't know. Someone needs to try it,
I have removed that code locally for a while and didn't see any
problem. But I don't explicitly use view-mode, so...
How about remove the code and see if someone sees a problem?
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Fri, 31 Jul 2009 02:25:16 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Fri, 31 Jul 2009 02:25:16 GMT)
Full text and
rfc822 format available.
Message #21 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):
> I have removed that code locally for a while and didn't see any
> problem. But I don't explicitly use view-mode, so...
Obiously the code only makes a difference when you use view-read-only,
so you'll need to set it to a non-nil value before doing any test.
> How about remove the code and see if someone sees a problem?
Not before trying out the corresponding feature, I think.
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Fri, 31 Jul 2009 03:30:05 GMT)
Full text and
rfc822 format available.
Message #24 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> > I have removed that code locally for a while and didn't see any
> > problem. But I don't explicitly use view-mode, so...
>
> Obiously the code only makes a difference when you use view-read-only,
> so you'll need to set it to a non-nil value before doing any test.
[I've never done anything with view-read-only before...]
I set view-read-only to t, then played with a file under RCS.
When the files is checked in view-mode is turned on, when checking it
out it's turned off.
If the code in question is eliminated, view-mode stays turned on after
checking out.
There's some code in `after-find-file' (that gets called from
`revert-buffer') that looks like it does something very similar to the
code in question here, but `after-find-file' is called with `nomodes' t,
so that code does not trigger.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Fri, 31 Jul 2009 03:50:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Fri, 31 Jul 2009 03:50:05 GMT)
Full text and
rfc822 format available.
Message #29 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> > I have removed that code locally for a while and didn't see any
>> > problem. But I don't explicitly use view-mode, so...
>>
>> Obiously the code only makes a difference when you use view-read-only,
>> so you'll need to set it to a non-nil value before doing any test.
> [I've never done anything with view-read-only before...]
> I set view-read-only to t, then played with a file under RCS.
> When the files is checked in view-mode is turned on, when checking it
> out it's turned off.
> If the code in question is eliminated, view-mode stays turned on after
> checking out.
> There's some code in `after-find-file' (that gets called from
> `revert-buffer') that looks like it does something very similar to the
> code in question here, but `after-find-file' is called with `nomodes' t,
> so that code does not trigger.
So it seems the code is still needed. Maybe we could/should replace it
with something more clear: E.g. move that code to a new function
`view-refresh' (or whatever else), which we can then call from VC.
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).
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Fri, 31 Jul 2009 06:35:06 GMT)
Full text and
rfc822 format available.
Message #32 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> >> > I have removed that code locally for a while and didn't see any
> >> > problem. But I don't explicitly use view-mode, so...
> >>
> >> Obiously the code only makes a difference when you use view-read-only,
> >> so you'll need to set it to a non-nil value before doing any test.
>
> > [I've never done anything with view-read-only before...]
> > I set view-read-only to t, then played with a file under RCS.
> > When the files is checked in view-mode is turned on, when checking it
> > out it's turned off.
>
> > If the code in question is eliminated, view-mode stays turned on after
> > checking out.
>
> > There's some code in `after-find-file' (that gets called from
> > `revert-buffer') that looks like it does something very similar to the
> > code in question here, but `after-find-file' is called with `nomodes' t,
> > so that code does not trigger.
>
> So it seems the code is still needed. Maybe we could/should replace it
> with something more clear: E.g. move that code to a new function
> `view-refresh' (or whatever else), which we can then call from VC.
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.
At least the TODO comment can go and be replaced with a comment about
why changing the state of view-mode is needed there.
> 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.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3973
; Package
emacs
.
(Fri, 31 Jul 2009 19:25:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Fri, 31 Jul 2009 19:25:06 GMT)
Full text and
rfc822 format available.
Message #37 received at 3973 <at> emacsbugs.donarmstrong.com (full text, mbox):
> 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
Added tag(s) fixed.
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 12 Jul 2011 20:18:03 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
3973 <at> debbugs.gnu.org and Dan Nicolaescu <dann <at> ics.uci.edu>
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 12 Jul 2011 20:18:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#3973
; Package
emacs
.
(Tue, 12 Jul 2011 20:21:04 GMT)
Full text and
rfc822 format available.
Message #44 received at 3973 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> 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.
Apparently this was done, so I'm closing this report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 10 Aug 2011 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 314 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.