unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
@ 2009-09-22  2:26 =C3=93scar?= Fuentes
  2009-09-23  5:53 ` Dan Nicolaescu
  0 siblings, 1 reply; 11+ messages in thread
From: =C3=93scar?= Fuentes @ 2009-09-22  2:26 UTC (permalink / raw)
  To: emacs-pretest-bug


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

When a modified versioned file is edited in such a way that the
modifications undoes previous changes to the file, after saving it the
VC-dired buffer for the working copy is automatically updated showing
that the status of the file is "up to date", but the VC modeline for the
buffer that visits the file does not change and keeps indicating that
the file state is "locally modified".

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/share/emacs/23.1.50/etc/DEBUG for instructions.


In GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2009-09-06 on qcore
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--with-x-toolkit=lucid''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: C++/lah

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  show-paren-mode: t
  diff-auto-refine-mode: t
  iswitchb-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent input:
n d ( ) SPC ) ; } <return> / / - - - - - - - - - - 
- - - <return> <up> <up> <up> <up> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> M-d <up> 
<up> <up> <return> / / - - - - - - - - - - - - - - 
- - <backspace> <backspace> <backspace> <backspace> 
- <return> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> C-x C-s M-x c m a k e C-g 
M-x s e t SPC a c t i v e SPC c o m <tab> <return> 
g c c <return> M-x c m a k e <return> <f2> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> C-x 
b e x e <return> C-r t y p e d e f C-a C-x b <return> 
M-d <right> C-y C-x C-s <f9> <f2> C-e <C-left> <C-left> 
<backspace> - > <f2> <up> C-a C-k C-k C-x C-s <f9> 
<down> <down> <down> C-e <C-left> <C-left> <C-right> 
<right> <right> M-d f f i c g C-x C-s <f9> C-x o <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <return> <down> <right> <right> M-d C-d C-x 
C-s <f9> <help-echo> M-x g n u s <return> <return> 
d q <down> <return> d q q y M-x g n u s <return> q 
y <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <help-menu> <se
nd-emacs-bug-report>

Recent messages:
Opening nnfolder server on archive...done
Reading active file from archive via nnfolder...done
Generating the cache active file...done
No new newsgroups
Checking new news...
Opening nntp server on news.gmane.org...done
Checking new news...done
No more unread newsgroups
Are you sure you want to quit reading news? (y or n) 
(No changes need to be saved)

Load-path shadows:
None found.

-- 
Óscar Fuentes
Desarrollo de Software





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-22  2:26 bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status =C3=93scar?= Fuentes
@ 2009-09-23  5:53 ` Dan Nicolaescu
  2009-09-23  6:49   ` Óscar Fuentes
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2009-09-23  5:53 UTC (permalink / raw)
  To: =C3=93scar?= Fuentes; +Cc: 4515

ofv@wanadoo.es. "(Óscar" Fuentes) writes:

  > Please write in English if possible, because the Emacs maintainers
  > usually do not have translators to read other languages for them.
  > 
  > Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
  > 
  > Please describe exactly what actions triggered the bug
  > and the precise symptoms of the bug:
  > 
  > When a modified versioned file is edited in such a way that the
  > modifications undoes previous changes to the file, after saving it the
  > VC-dired buffer for the working copy is automatically updated showing
  > that the status of the file is "up to date", but the VC modeline for the
  > buffer that visits the file does not change and keeps indicating that
  > the file state is "locally modified".

Can you please describe step by step the actions necessary to reproduce
this starting from emacs -Q?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-23  5:53 ` Dan Nicolaescu
@ 2009-09-23  6:49   ` Óscar Fuentes
  2009-09-23 18:36     ` Dan Nicolaescu
  0 siblings, 1 reply; 11+ messages in thread
From: Óscar Fuentes @ 2009-09-23  6:49 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4515

Dan Nicolaescu <dann@ics.uci.edu> writes:

> ofv@wanadoo.es. "(Óscar" Fuentes) writes:
>
>   > Please write in English if possible, because the Emacs maintainers
>   > usually do not have translators to read other languages for them.
>   > 
>   > Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
>   > 
>   > Please describe exactly what actions triggered the bug
>   > and the precise symptoms of the bug:
>   > 
>   > When a modified versioned file is edited in such a way that the
>   > modifications undoes previous changes to the file, after saving it the
>   > VC-dired buffer for the working copy is automatically updated showing
>   > that the status of the file is "up to date", but the VC modeline for the
>   > buffer that visits the file does not change and keeps indicating that
>   > the file state is "locally modified".
>
> Can you please describe step by step the actions necessary to reproduce
> this starting from emacs -Q?

emacs -Q

C-x C-f some-versioned-unmodified-file
do some edition
C-x C-s (the VC status modeline indicator changes from `-' to `:')
undo previous edition
C-x C-s

Now you just turned the file to its original state and is unmodified as
far as the version control system is concerned, but the VC modeline
keeps showing `:' (for example Bzr:836) indicating that the file is
edited. After saving a versioned file, VC should check if the VC backend
flags the file as edited and update the modeline accordingly.

-- 
Óscar





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-23  6:49   ` Óscar Fuentes
@ 2009-09-23 18:36     ` Dan Nicolaescu
  2009-09-23 19:31       ` Óscar Fuentes
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2009-09-23 18:36 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: 4515

Óscar Fuentes <ofv@wanadoo.es> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > ofv@wanadoo.es. "(Óscar" Fuentes) writes:
  > >
  > >   > Please write in English if possible, because the Emacs maintainers
  > >   > usually do not have translators to read other languages for them.
  > >   > 
  > >   > Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
  > >   > 
  > >   > Please describe exactly what actions triggered the bug
  > >   > and the precise symptoms of the bug:
  > >   > 
  > >   > When a modified versioned file is edited in such a way that the
  > >   > modifications undoes previous changes to the file, after saving it the
  > >   > VC-dired buffer for the working copy is automatically updated showing
  > >   > that the status of the file is "up to date", but the VC modeline for the
  > >   > buffer that visits the file does not change and keeps indicating that
  > >   > the file state is "locally modified".
  > >
  > > Can you please describe step by step the actions necessary to reproduce
  > > this starting from emacs -Q?
  > 
  > emacs -Q
  > 
  > C-x C-f some-versioned-unmodified-file
  > do some edition
  > C-x C-s (the VC status modeline indicator changes from `-' to `:')
  > undo previous edition
  > C-x C-s
  > 
  > Now you just turned the file to its original state and is unmodified as
  > far as the version control system is concerned, but the VC modeline
  > keeps showing `:' (for example Bzr:836) indicating that the file is
  > edited. After saving a versioned file, VC should check if the VC backend
  > flags the file as edited and update the modeline accordingly.

You can do M-x revert-buffer or C-x v u and that would reset the VC
state accordingly.
Checking for this condition after each save is prohibitively expensive,
and it's an extremely rare event, so it's not worth optimizing for.
So this is neither a bug, not something worth improving.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-23 18:36     ` Dan Nicolaescu
@ 2009-09-23 19:31       ` Óscar Fuentes
  2009-09-23 21:21         ` Dan Nicolaescu
  2009-09-24  2:25         ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Óscar Fuentes @ 2009-09-23 19:31 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4515

Dan Nicolaescu <dann@ics.uci.edu> writes:

> Óscar Fuentes <ofv@wanadoo.es> writes:
>
>   > Dan Nicolaescu <dann@ics.uci.edu> writes:
>   > 
>   > > ofv@wanadoo.es. "(Óscar" Fuentes) writes:
>   > >
>   > >   > Please write in English if possible, because the Emacs maintainers
>   > >   > usually do not have translators to read other languages for them.
>   > >   > 
>   > >   > Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
>   > >   > 
>   > >   > Please describe exactly what actions triggered the bug
>   > >   > and the precise symptoms of the bug:
>   > >   > 
>   > >   > When a modified versioned file is edited in such a way that the
>   > >   > modifications undoes previous changes to the file, after saving it the
>   > >   > VC-dired buffer for the working copy is automatically updated showing
>   > >   > that the status of the file is "up to date", but the VC modeline for the
>   > >   > buffer that visits the file does not change and keeps indicating that
>   > >   > the file state is "locally modified".
>   > >
>   > > Can you please describe step by step the actions necessary to reproduce
>   > > this starting from emacs -Q?
>   > 
>   > emacs -Q
>   > 
>   > C-x C-f some-versioned-unmodified-file
>   > do some edition
>   > C-x C-s (the VC status modeline indicator changes from `-' to `:')
>   > undo previous edition
>   > C-x C-s
>   > 
>   > Now you just turned the file to its original state and is unmodified as
>   > far as the version control system is concerned, but the VC modeline
>   > keeps showing `:' (for example Bzr:836) indicating that the file is
>   > edited. After saving a versioned file, VC should check if the VC backend
>   > flags the file as edited and update the modeline accordingly.
>
> You can do M-x revert-buffer or C-x v u and that would reset the VC
> state accordingly.

Yes, I know.

> Checking for this condition after each save is prohibitively expensive,
> and it's an extremely rare event, so it's not worth optimizing for.

Automatically checking the VC state after each save is actually
performed if there is a vc-dired buffer for the working copy where the
file resides. That check updates the vc-dired with the correct state of
the saved file.

Part of my job is experimenting tweaks and micro-improvements on
existing code bases. After every session I end with lots of buffers
showing the "edited" vc modeline indicator when in fact only one or two
are effectively edited. This renders useless the vc state indicator and
turns its meaning into "When `:' is shown, this file was edited, but it
may be up-to-date now".

> So this is neither a bug, not something worth improving.

Well, the vc status on the modeline is showing the wrong state.

Would you accept a patch that implements an option for checking after
every save and updating the vc state on the modeline accordingly?

-- 
Óscar





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-23 19:31       ` Óscar Fuentes
@ 2009-09-23 21:21         ` Dan Nicolaescu
  2009-09-24  2:08           ` Kevin Rodgers
  2009-09-24  2:25         ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2009-09-23 21:21 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: 4515

Óscar Fuentes <ofv@wanadoo.es> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > Óscar Fuentes <ofv@wanadoo.es> writes:
  > >
  > >   > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > >   > 
  > >   > > ofv@wanadoo.es. "(Óscar" Fuentes) writes:
  > >   > >
  > >   > >   > Please write in English if possible, because the Emacs maintainers
  > >   > >   > usually do not have translators to read other languages for them.
  > >   > >   > 
  > >   > >   > Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
  > >   > >   > 
  > >   > >   > Please describe exactly what actions triggered the bug
  > >   > >   > and the precise symptoms of the bug:
  > >   > >   > 
  > >   > >   > When a modified versioned file is edited in such a way that the
  > >   > >   > modifications undoes previous changes to the file, after saving it the
  > >   > >   > VC-dired buffer for the working copy is automatically updated showing
  > >   > >   > that the status of the file is "up to date", but the VC modeline for the
  > >   > >   > buffer that visits the file does not change and keeps indicating that
  > >   > >   > the file state is "locally modified".
  > >   > >
  > >   > > Can you please describe step by step the actions necessary to reproduce
  > >   > > this starting from emacs -Q?
  > >   > 
  > >   > emacs -Q
  > >   > 
  > >   > C-x C-f some-versioned-unmodified-file
  > >   > do some edition
  > >   > C-x C-s (the VC status modeline indicator changes from `-' to `:')
  > >   > undo previous edition
  > >   > C-x C-s
  > >   > 
  > >   > Now you just turned the file to its original state and is unmodified as
  > >   > far as the version control system is concerned, but the VC modeline
  > >   > keeps showing `:' (for example Bzr:836) indicating that the file is
  > >   > edited. After saving a versioned file, VC should check if the VC backend
  > >   > flags the file as edited and update the modeline accordingly.
  > >
  > > You can do M-x revert-buffer or C-x v u and that would reset the VC
  > > state accordingly.
  > 
  > Yes, I know.
  > 
  > > Checking for this condition after each save is prohibitively expensive,
  > > and it's an extremely rare event, so it's not worth optimizing for.
  > 
  > Automatically checking the VC state after each save is actually
  > performed if there is a vc-dired buffer for the working copy where the
  > file resides. That check updates the vc-dired with the correct state of
  > the saved file.
  > 
  > Part of my job is experimenting tweaks and micro-improvements on
  > existing code bases. After every session I end with lots of buffers
  > showing the "edited" vc modeline indicator when in fact only one or two
  > are effectively edited. This renders useless the vc state indicator and
  > turns its meaning into "When `:' is shown, this file was edited, but it
  > may be up-to-date now".
  > 
  > > So this is neither a bug, not something worth improving.
  > 
  > Well, the vc status on the modeline is showing the wrong state.


  > Would you accept a patch that implements an option for checking after
  > every save and updating the vc state on the modeline accordingly?

Although I've done a lot of work on VC, I am not an official maintainer
of VC, so I am in no position to do that.  But I don't think such a
change is a good idea.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-23 21:21         ` Dan Nicolaescu
@ 2009-09-24  2:08           ` Kevin Rodgers
  0 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2009-09-24  2:08 UTC (permalink / raw)
  To: bug-gnu-emacs

Dan Nicolaescu wrote:
> Óscar Fuentes <ofv@wanadoo.es> writes:
> 
>   > Dan Nicolaescu <dann@ics.uci.edu> writes:
...
>   > > Checking for this condition after each save is prohibitively expensive,
>   > > and it's an extremely rare event, so it's not worth optimizing for.
>   > 
>   > Automatically checking the VC state after each save is actually
>   > performed if there is a vc-dired buffer for the working copy where the
>   > file resides. That check updates the vc-dired with the correct state of
>   > the saved file.
...
>   > > So this is neither a bug, not something worth improving.
>   > 
>   > Well, the vc status on the modeline is showing the wrong state.
> 
>   > Would you accept a patch that implements an option for checking after
>   > every save and updating the vc state on the modeline accordingly?
> 
> Although I've done a lot of work on VC, I am not an official maintainer
> of VC, so I am in no position to do that.  But I don't think such a
> change is a good idea.

Should that feature be removed from vc-dired, so that it is consistent with the
buffer's mode line?

(No, I'm not serious.)

-- 
Kevin Rodgers
Denver, Colorado, USA







^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-23 19:31       ` Óscar Fuentes
  2009-09-23 21:21         ` Dan Nicolaescu
@ 2009-09-24  2:25         ` Stefan Monnier
  2009-09-24  4:24           ` Dan Nicolaescu
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2009-09-24  2:25 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: Dan Nicolaescu, 4515

> Automatically checking the VC state after each save is actually
> performed if there is a vc-dired buffer for the working copy where the
> file resides. That check updates the vc-dired with the correct state of
> the saved file.

Indeed.  That requires the status info to be obtainable cheaply.

> Would you accept a patch that implements an option for checking after
> every save and updating the vc state on the modeline accordingly?

I'd consider it, yes.


        Stefan





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-24  2:25         ` Stefan Monnier
@ 2009-09-24  4:24           ` Dan Nicolaescu
  2009-09-24  6:24             ` Óscar Fuentes
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2009-09-24  4:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Óscar Fuentes, 4515

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > > Automatically checking the VC state after each save is actually
  > > performed if there is a vc-dired buffer for the working copy where the
  > > file resides. That check updates the vc-dired with the correct state of
  > > the saved file.
  > 
  > Indeed.  That requires the status info to be obtainable cheaply.

There's a major difference: vc-dir is asynchronous, whereas updating the
same info when saving a file is synchronous, so it will be on the
critical path.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-24  4:24           ` Dan Nicolaescu
@ 2009-09-24  6:24             ` Óscar Fuentes
  2009-09-24 17:20               ` Dan Nicolaescu
  0 siblings, 1 reply; 11+ messages in thread
From: Óscar Fuentes @ 2009-09-24  6:24 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4515

Dan Nicolaescu <dann@ics.uci.edu> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>   > > Automatically checking the VC state after each save is actually
>   > > performed if there is a vc-dired buffer for the working copy where the
>   > > file resides. That check updates the vc-dired with the correct state of
>   > > the saved file.
>   > 
>   > Indeed.  That requires the status info to be obtainable cheaply.
>
> There's a major difference: vc-dir is asynchronous, whereas updating the
> same info when saving a file is synchronous, so it will be on the
> critical path.

Are you saying that vc-dir updates the file status asynchronously after
a file is saved? vc-dir-recompute-file-state does

	 (state (vc-call-backend vc-dir-backend 'state fname))
	 (extra (vc-call-backend vc-dir-backend
				 'status-fileinfo-extra fname)))

which looks like the same stuff vc-after-save is trying to avoid.

I've implemented the option for checking the state after every save. It
is almost instantaneous on a GNU/Linux machine with bzr. On a Windows XP
netbook there is almost no noticeable delay with a hot cache. Using bzr
2.0rc on a 1000 rev branch. The option is off by default so the user
must toggle the option before complaining about the performance. The
docstring of the defcustom warns about that posibility.


2009-09-24  Oscar Fuentes  <ofv@wanadoo.es>

	* lisp/vc-hooks.el (vc-always-update-modeline-after-save):
        new defcustom.
        (vc-after-save): Use it and when non-nil check the vc file state
        so the modeline reflects its actual state.


diff -cp "c:/apps/emacs/lisp/vc-hooks.el" "d:/vc-hooks.el"
*** c:/apps/emacs/lisp/vc-hooks.el	2009-09-24 07:25:53.000000000 +0200
--- d:/vc-hooks.el	2009-09-24 08:10:01.062500000 +0200
*************** If nil (the default), files covered by v
*** 96,101 ****
--- 96,110 ----
    :group 'vc
    :group 'backup)
  
+ (defcustom vc-always-update-modeline-after-save nil
+   "If non-nil, always update the state shown in the modeline
+ after saving the file. This may be time-consuming for some
+ backends. If nil, the modeline changes to `edited' when the file
+ is saved for the first time and it is not updated on subsequent
+ saves."
+   :type 'boolean
+   :group 'vc)
+ 
  (defcustom vc-follow-symlinks 'ask
    "What to do if visiting a symbolic link to a file under version control.
  Editing such a file through the link bypasses the version control system,
*************** Before doing that, check if there are an
*** 743,751 ****
  		  ;; to avoid confusion.
  		  (vc-file-setprop file 'vc-checkout-time nil))
  	     t)
-          (vc-up-to-date-p file)
           (eq (vc-checkout-model backend (list file)) 'implicit)
!          (vc-file-setprop file 'vc-state 'edited)
  	 (vc-mode-line file backend)
  	 ;; Try to avoid unnecessary work, a *vc-dir* buffer is
  	 ;; present if and only if this is true.
--- 752,766 ----
  		  ;; to avoid confusion.
  		  (vc-file-setprop file 'vc-checkout-time nil))
  	     t)
           (eq (vc-checkout-model backend (list file)) 'implicit)
! 	 (if vc-always-update-modeline-after-save
! 	     (progn
! 	       ;; Avoid using cached value on `vc-state':
! 	       (vc-file-setprop file 'vc-state 'nil)
! 	       (vc-file-setprop file 'vc-state (vc-state file backend)))
! 	   (and
! 	    (vc-up-to-date-p file)
! 	    (vc-file-setprop file 'vc-state 'edited)))
  	 (vc-mode-line file backend)
  	 ;; Try to avoid unnecessary work, a *vc-dir* buffer is
  	 ;; present if and only if this is true.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status
  2009-09-24  6:24             ` Óscar Fuentes
@ 2009-09-24 17:20               ` Dan Nicolaescu
  0 siblings, 0 replies; 11+ messages in thread
From: Dan Nicolaescu @ 2009-09-24 17:20 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: 4515

Óscar Fuentes <ofv@wanadoo.es> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > Stefan Monnier <monnier@iro.umontreal.ca> writes:
  > >
  > >   > > Automatically checking the VC state after each save is actually
  > >   > > performed if there is a vc-dired buffer for the working copy where the
  > >   > > file resides. That check updates the vc-dired with the correct state of
  > >   > > the saved file.
  > >   > 
  > >   > Indeed.  That requires the status info to be obtainable cheaply.
  > >
  > > There's a major difference: vc-dir is asynchronous, whereas updating the
  > > same info when saving a file is synchronous, so it will be on the
  > > critical path.
  > 
  > Are you saying that vc-dir updates the file status asynchronously after
  > a file is saved? vc-dir-recompute-file-state does

Hmm, I implemented that probably 2 years ago ago, but it does not look
like I checked it in...  and I can't seem to find that patch anymore.  :-(

  > 	 (state (vc-call-backend vc-dir-backend 'state fname))
  > 	 (extra (vc-call-backend vc-dir-backend
  > 				 'status-fileinfo-extra fname)))

This function should instead be using `vc-dir-refresh-files' to work
asynchronously.

Given that nobody noticed this until now, maybe it's not too bad.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-09-24 17:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-22  2:26 bug#4515: 23.1.50; Reverting changes on versioned file does not revert vc modeline status =C3=93scar?= Fuentes
2009-09-23  5:53 ` Dan Nicolaescu
2009-09-23  6:49   ` Óscar Fuentes
2009-09-23 18:36     ` Dan Nicolaescu
2009-09-23 19:31       ` Óscar Fuentes
2009-09-23 21:21         ` Dan Nicolaescu
2009-09-24  2:08           ` Kevin Rodgers
2009-09-24  2:25         ` Stefan Monnier
2009-09-24  4:24           ` Dan Nicolaescu
2009-09-24  6:24             ` Óscar Fuentes
2009-09-24 17:20               ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).