all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
@ 2014-11-24 11:32 Ed Avis
  2014-11-24 15:00 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ed Avis @ 2014-11-24 11:32 UTC (permalink / raw)
  To: 19161

Use vc-mode to edit a file in a Subversion working copy, where the file
has the property svn:keywords set to 'Id' and contains a magic $Id: $
string.  On committing with C-x v v, the file will be reloaded after the
commit, and point jumps to the top of the buffer.  This is annoying
because you lose the place you were working at.

It is necessary to reload the file on commit because the version control
system will have modified the Id: dropping, but this is a small change
that doesn't affect the position of the rest of the text in the
document.  (The only version control post-commit operation that might
make a significant difference to text position is the old practice of
including the whole Log: in the file, but only older systems like RCS
and CVS support that.  Even then, the Log: is often appended at the end
of the file, so will not affect the current cursor position.)

When committing, Emacs should continue to reload the file contents
afterwards, but it should save the current point and not move to the
start of the buffer after the reload.



In GNU Emacs 24.4.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.10.9)
 of 2014-11-03 on wcl-linux04.wcl.local
Configured using:
 `configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
 -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro ''

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_MESSAGES: en_GB.UTF-8
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: nXML

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC b u t SPC n 
o t e SPC w e SPC s t i l l SPC f i DEL DEL d i v i 
d e SPC b y SPC t h e SPC p r i c e SPC f o r SPC M 
S C I L E M U . SPC - - > C-a C-x C-s C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-e RET SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC DEL DEL < ! - - SPC R e c e n t l y SPC s e 
DEL DEL w e SPC u s e SPC M S C I L E M U SPC f o r 
SPC e v e r y t h i n g . SPC - - > C-a C-x C-s ESC 
! ESC p RET C-x v = C-x v v M s c i D a i l y E ESC 
/ : SPC DEL DEL DEL DEL DEL DEL DEL DEL DEL DEL : SPC 
m a d e SPC i g t SPC m o r DEL DEL DEL DEL DEL DEL 
t o DEL SPC m o r e SPC e x p l i c i t SPC w h a t 
SPC h a p p e n s SPC f o r SPC E U . C-c C-c C-x o 
C-s M S C I L E U X C-a C-x 1 ESC x r e p o r t SPC 
e m a SPC b SPC RET

Recent messages:
Wrote /home/eda/svn_working/repos/wwwroot/WaniSystems/Configuration/MarketSampler/jobs/build.trend.signals.xml
(Shell command succeeded with no output)
Finding changes in /home/eda/svn_working/repos/wwwroot/WaniSystems/Configuration/MarketSampler/jobs/build.trend.signals.xml...done
Mark set
Press C-c C-c when you are done editing.
Enter a change comment.  Type C-c C-c when done
Scanning for dabbrevs...done
Expansion found in 'build.trend.signals.xml'
Checking in /home/eda/svn_working/repos/wwwroot/WaniSystems/Configuration/MarketSampler/jobs/build.trend.signals.xml...done
Mark saved where search started

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail rect edmacro tabify man
smerge-mode kmacro sql view imenu ffap thingatpt url-parse auth-source
eieio eieio-core gnus-util password-cache url-vars log-view nxml-uchnm
rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri
rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok
diff-mode vc cus-edit wid-edit cus-start cus-load perl-mode misearch
multi-isearch dabbrev vc-dispatcher vc-svn sgml-mode help-mode
pcmpl-unix xterm time-date log-edit easy-mmode message format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log server csharp-mode advice
help-fns byte-opt bytecomp byte-compile cconv cc-langs cc-mode cc-fonts
easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs zoom-frm frame-cmds frame-fns cl-macs avoid cl gv cl-loaddefs
cl-lib compile shell pcomplete comint ring ansi-color tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 915462 54113)
 (symbols 48 28605 0)
 (miscs 40 461 2246)
 (strings 32 45936 8283)
 (string-bytes 1 3543189)
 (vectors 16 19189)
 (vector-slots 8 475781 19377)
 (floats 8 122 690)
 (intervals 56 90072 2241)
 (buffers 960 54)
 (heap 1024 66414 1951))
 

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 11:32 bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer Ed Avis
@ 2014-11-24 15:00 ` Stefan Monnier
  2014-11-24 17:30   ` Ed Avis
  2014-11-24 16:59 ` Glenn Morris
  2014-12-15  8:07 ` Paul Eggert
  2 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2014-11-24 15:00 UTC (permalink / raw)
  To: Ed Avis; +Cc: 19161

> Use vc-mode to edit a file in a Subversion working copy, where the file
> has the property svn:keywords set to 'Id' and contains a magic $Id: $
> string.  On committing with C-x v v, the file will be reloaded after the
> commit, and point jumps to the top of the buffer.  This is annoying
> because you lose the place you were working at.

Indeed, that should not happen.
Does it jump to the *very beginning* of the file, or only to "just
before the $Id thingy" ?


        Stefan





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 11:32 bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer Ed Avis
  2014-11-24 15:00 ` Stefan Monnier
@ 2014-11-24 16:59 ` Glenn Morris
  2014-11-24 17:06   ` Ed Avis
  2014-12-15  8:07 ` Paul Eggert
  2 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2014-11-24 16:59 UTC (permalink / raw)
  To: Ed Avis; +Cc: 19161

Ed Avis wrote:

> Use vc-mode to edit a file in a Subversion working copy, where the file
> has the property svn:keywords set to 'Id' and contains a magic $Id: $
> string.  On committing with C-x v v, the file will be reloaded after the
> commit, and point jumps to the top of the buffer. 

I cannot reproduce this.
Please give a recipe starting from emacs -Q.

> In GNU Emacs 24.4.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.10.9)





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 16:59 ` Glenn Morris
@ 2014-11-24 17:06   ` Ed Avis
  0 siblings, 0 replies; 12+ messages in thread
From: Ed Avis @ 2014-11-24 17:06 UTC (permalink / raw)
  To: 'Glenn Morris'; +Cc: 19161@debbugs.gnu.org

Thanks for looking into this.  Now that you mention it, I cannot reproduce it either,
although I am sure I saw it several times just now.  Please leave the bug report open a day or two
so I can dig further the next time it happens; and if I don't find the answer the report can then be closed.

-- 
Ed Avis <eda@waniasset.com>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 15:00 ` Stefan Monnier
@ 2014-11-24 17:30   ` Ed Avis
  2014-11-25  1:54     ` Stefan Monnier
  2014-11-25 15:09     ` Ed Avis
  0 siblings, 2 replies; 12+ messages in thread
From: Ed Avis @ 2014-11-24 17:30 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 19161@debbugs.gnu.org

When I observed this happening, it jumped right to the beginning of the file.
It was a long XML file where I was changing something part way through.
When I have more details and a reliable way to reproduce the problem I will post them.

-- 
Ed Avis <eda@waniasset.com>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 17:30   ` Ed Avis
@ 2014-11-25  1:54     ` Stefan Monnier
  2014-11-25 15:09     ` Ed Avis
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2014-11-25  1:54 UTC (permalink / raw)
  To: Ed Avis; +Cc: 19161@debbugs.gnu.org

> When I observed this happening, it jumped right to the beginning of
> the file.  It was a long XML file where I was changing something part
> way through.  When I have more details and a reliable way to reproduce
> the problem I will post them.

Please do, thanks,


        Stefan





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 17:30   ` Ed Avis
  2014-11-25  1:54     ` Stefan Monnier
@ 2014-11-25 15:09     ` Ed Avis
  2014-11-27  3:28       ` Stefan Monnier
  1 sibling, 1 reply; 12+ messages in thread
From: Ed Avis @ 2014-11-25 15:09 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: '19161@debbugs.gnu.org'

It does appear to be moving point to the Id: dropping after commit.
I just saw this behaviour again - let me have another go at making a recipe from emacs -Q.

-- 
Ed Avis <eda@waniasset.com>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-25 15:09     ` Ed Avis
@ 2014-11-27  3:28       ` Stefan Monnier
  2014-11-27 11:28         ` Ed Avis
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2014-11-27  3:28 UTC (permalink / raw)
  To: Ed Avis; +Cc: '19161@debbugs.gnu.org'

> It does appear to be moving point to the Id: dropping after commit.
> I just saw this behaviour again - let me have another go at making
> a recipe from emacs -Q.

I think it's probably expected behavior:

When a file is reverted, the file is compared to the buffer and only the
part between the first and the last changed bytes is replaced.

So, in your case, the "first changed byte" is at the "$Id" thingy, and
if the last changed byte is somewhere further down in the middle of the
file (or worse, near the end), then any marker (including "the point",
and window-points) will be moved to either right before or right after
the replaced text.

We could do better, by doing an actual "diff" and then applying the
patch, but someone would have to write it.


        Stefan





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-27  3:28       ` Stefan Monnier
@ 2014-11-27 11:28         ` Ed Avis
  2014-12-11 21:09           ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Ed Avis @ 2014-11-27 11:28 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: '19161@debbugs.gnu.org'

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

>So, in your case, the "first changed byte" is at the "$Id" thingy, and
>if the last changed byte is somewhere further down in the middle of the
>file (or worse, near the end), then any marker (including "the point",
>and window-points) will be moved to either right before or right after
>the replaced text.
>
>We could do better, by doing an actual "diff" and then applying the
>patch, but someone would have to write it.

Surely the simplest fix is to save the current point (as a line number and column number),
revert the file, and then put point back to where it was?

In the particular case of reverting after a version control checkin this would give
more useful behaviour.  I wouldn't advocate it for ordinary revert-buffer operations.

-- 
Ed Avis <eda@waniasset.com>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-27 11:28         ` Ed Avis
@ 2014-12-11 21:09           ` Stefan Monnier
  2014-12-12  8:12             ` Ed Avis
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2014-12-11 21:09 UTC (permalink / raw)
  To: Ed Avis; +Cc: '19161@debbugs.gnu.org'

Version:25.1

> Surely the simplest fix is to save the current point (as a line number
> and column number), revert the file, and then put point back to where
> it was?

I installed a similar change in "master".  It doesn't preserve
line-number nor column number, but it keeps the point in the same place
in proportion to the changed text.

> In the particular case of reverting after a version control checkin
> this would give more useful behaviour.  I wouldn't advocate it for
> ordinary revert-buffer operations.

I actually did it for all revert-buffer operations.


        Stefan





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-12-11 21:09           ` Stefan Monnier
@ 2014-12-12  8:12             ` Ed Avis
  0 siblings, 0 replies; 12+ messages in thread
From: Ed Avis @ 2014-12-12  8:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: '19161@debbugs.gnu.org'

Thanks - so as a special case of the improved revert-buffer mechanism in the next version of Emacs, this bug will be fixed.
I still see it occurring about once a day when checking in a large XML file which has an svn $Id: $ dropping at the top,
but it's hard to reproduce reliably.

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________





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

* bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer
  2014-11-24 11:32 bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer Ed Avis
  2014-11-24 15:00 ` Stefan Monnier
  2014-11-24 16:59 ` Glenn Morris
@ 2014-12-15  8:07 ` Paul Eggert
  2 siblings, 0 replies; 12+ messages in thread
From: Paul Eggert @ 2014-12-15  8:07 UTC (permalink / raw)
  To: 19161

I ran into an assertion failure with that patch when I tested with "./configure 
--enable-checking; make bootstrap", and installed a further patch that fixed the 
bug for me as commit e2815bfe2a1e4d5a21d6b6378ebc2108d4d104ab.





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

end of thread, other threads:[~2014-12-15  8:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24 11:32 bug#19161: 24.4; vc-mode reload on commit - don't jump to start of buffer Ed Avis
2014-11-24 15:00 ` Stefan Monnier
2014-11-24 17:30   ` Ed Avis
2014-11-25  1:54     ` Stefan Monnier
2014-11-25 15:09     ` Ed Avis
2014-11-27  3:28       ` Stefan Monnier
2014-11-27 11:28         ` Ed Avis
2014-12-11 21:09           ` Stefan Monnier
2014-12-12  8:12             ` Ed Avis
2014-11-24 16:59 ` Glenn Morris
2014-11-24 17:06   ` Ed Avis
2014-12-15  8:07 ` Paul Eggert

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.