unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16181: 23.1; losing track of point
@ 2013-12-18  1:36 John Chandler
  2014-02-26 20:31 ` bug#16181: 23.1; losing track of point - partial workaround Chandler, John
  2021-05-30  5:26 ` bug#16181: 23.1; losing track of point Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: John Chandler @ 2013-12-18  1:36 UTC (permalink / raw)
  To: 16181

emacs-version:
GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.18.9) of 2013-07-17 on c6b10.bsys.dev.centos.org

installed as part of CentOS 6.5

When a macro performs some editing tasks and then moves "point"
forward using a (forward-line 1) at a time when the current line wraps
and extends outside the viewing window, emacs often loses track of
"point" and leaves it somewhere near the middle of the viewing window.
The same macro invocation will work properly if the entire current
line is visible in the window when the editing tasks are done, even if
the beginning of the next line is outside the window.  But it will
fail if the editing tasks performed by the macro cause the line to
wrap outside the window before the final (forward-line 1).  This
behavior does not depend on the setting of line-move-visual.  The
following macro is a short example:

(defun ttt() "add tag from start" (interactive)
  (save-excursion
    (goto-char 0)
    (copy-to-register 26 (point) (progn (forward-word 1)(point)) t))
  (insert-register 26)
  (forward-line 1))

The file to be edited using this macro should begin with a line
containing a list of words to be inserted in front of a succession of
lines in the file.  If the lines in the file generally wrap,
especially if they wrap multiple times each, the successive
application of the macro should quickly trigger the bug.



In GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.18.9)
 of 2013-07-17 on c6b10.bsys.dev.centos.org
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--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=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
 --param=ssp-buffer-size=4 -m64 -mtune=generic''

Important settings:
  value of $LC_ALL: en_US
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: ascii8
  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: iso-latin-1-unix
  default-enable-multibyte-characters: t

Major mode: Apropos

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-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
  transient-mark-mode: t

Recent input:
c a t e SPC / / ; C-x C-s ESC O A C-a C-s C-w C-s C-g 
ESC O B ESC O B ESC O B ESC [ 5 ~ ESC O A ESC O A ESC 
O A ESC O B ESC O B C-s C-w C-s ESC O A C-a C-x 2 C-x 
C-f r b DEL b . x RET C-s c h e k DEL c k ESC O C C-s 
a C-g C-s SPC a g C-x 0 C-s C-w C-r C-r C-g ESC O B 
ESC O B ESC O A ESC O A C-s C-w C-s C-s C-g C-g C-r 
C-r ESC O B ESC O B ESC O B C-a ESC b C-s C-w C-r C-r 
C-e C-r d . ESC f ESC f SPC S e p SPC 2 3 SPC a e : 
8 7 SPC i n : S h e r b o r n , SPC M A SPC * S C D 
SPC P DEL p : 4 6 8 - 2 0 C-r SPC i RET . 7 . 2 ESC 
f ESC f ESC f SPC b y : d y s e n t e r y C-u ESC d 
C-y C-e ESC b ESC f C-y C-a C-s C-w C-s ESC O B ESC 
O B ESC [ 5 ~ ESC O A ESC O A ESC O A ESC O B ESC O 
B ESC O A C-a C-s C-w C-r C-r C-r C-g ESC [ 1 8 ~ ESC 
[ 1 8 ~ C-h a b u g s RET C-h a b u g RET ESC [ 1 8 
~ ESC [ 6 ~ ESC [ 6 ~ ESC x r e p o TAB r TAB RET

Recent messages:
Mark saved where search started
Quit [2 times]
Mark saved where search started [4 times]
Mark set [2 times]
Auto-saving...
Mark saved where search started
Quit
No apropos matches for `bugs'
Type C-x 4 C-o RET to restore the other window.  
Making completion list...





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

* bug#16181: 23.1; losing track of point - partial workaround
  2013-12-18  1:36 bug#16181: 23.1; losing track of point John Chandler
@ 2014-02-26 20:31 ` Chandler, John
  2021-05-30  5:26 ` bug#16181: 23.1; losing track of point Lars Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Chandler, John @ 2014-02-26 20:31 UTC (permalink / raw)
  To: 16181

I have determined empirically that interleaving short "sit-for"
commands between the
actual working commands of a macro can usually keep emacs from getting
confused over
where "point" is.





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

* bug#16181: 23.1; losing track of point
  2013-12-18  1:36 bug#16181: 23.1; losing track of point John Chandler
  2014-02-26 20:31 ` bug#16181: 23.1; losing track of point - partial workaround Chandler, John
@ 2021-05-30  5:26 ` Lars Ingebrigtsen
  2021-05-30 19:23   ` Chandler, John
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-30  5:26 UTC (permalink / raw)
  To: John Chandler; +Cc: 16181

John Chandler <chandler@cfa.harvard.edu> writes:

> The following macro is a short example:
>
> (defun ttt() "add tag from start" (interactive)
>   (save-excursion
>     (goto-char 0)
>     (copy-to-register 26 (point) (progn (forward-word 1)(point)) t))
>   (insert-register 26)
>   (forward-line 1))
>
> The file to be edited using this macro should begin with a line
> containing a list of words to be inserted in front of a succession of
> lines in the file.  If the lines in the file generally wrap,
> especially if they wrap multiple times each, the successive
> application of the macro should quickly trigger the bug.

(I'm going through old bug reports that unfortunately got no response at
the time.)

I've tried to reproduce this problem in Emacs 28, but things seem to be
working as expected for me.  Are you still seeing this problem in more
recent versions of Emacs?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#16181: 23.1; losing track of point
  2021-05-30  5:26 ` bug#16181: 23.1; losing track of point Lars Ingebrigtsen
@ 2021-05-30 19:23   ` Chandler, John
  2021-05-31  5:44     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Chandler, John @ 2021-05-30 19:23 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16181

On Sun, May 30, 2021 at 1:26 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> John Chandler <chandler@cfa.harvard.edu> writes:
>
> > The following macro is a short example:
> >
> > (defun ttt() "add tag from start" (interactive)
> >   (save-excursion
> >     (goto-char 0)
> >     (copy-to-register 26 (point) (progn (forward-word 1)(point)) t))
> >   (insert-register 26)
> >   (forward-line 1))
> >
> > The file to be edited using this macro should begin with a line
> > containing a list of words to be inserted in front of a succession of
> > lines in the file.  If the lines in the file generally wrap,
> > especially if they wrap multiple times each, the successive
> > application of the macro should quickly trigger the bug.

The bug is intermittent and seems to depend on the exact alignment
of the display when (point) moves out of the current window.  I found
a 99% reliable workaround by inserting lots of (sit-for) invocations into
complicated macros.  For the same reason, the above macro triggers the
bug only if it is invoked multiple times within another macro, and not when
it's invoked by hand (except rarely).  Meanwhile, I see the bug still
happening in emacs 22.2.1 and 23.1.1, but apparently not in 24.3.1,
so I guess it's fixed.

John Chandler





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

* bug#16181: 23.1; losing track of point
  2021-05-30 19:23   ` Chandler, John
@ 2021-05-31  5:44     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-31  5:44 UTC (permalink / raw)
  To: Chandler, John; +Cc: 16181

"Chandler, John" <jchandler@cfa.harvard.edu> writes:

>  Meanwhile, I see the bug still
> happening in emacs 22.2.1 and 23.1.1, but apparently not in 24.3.1,
> so I guess it's fixed.

Thanks for checking; closing this bug report, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-05-31  5:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18  1:36 bug#16181: 23.1; losing track of point John Chandler
2014-02-26 20:31 ` bug#16181: 23.1; losing track of point - partial workaround Chandler, John
2021-05-30  5:26 ` bug#16181: 23.1; losing track of point Lars Ingebrigtsen
2021-05-30 19:23   ` Chandler, John
2021-05-31  5:44     ` Lars Ingebrigtsen

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).