GNU bug report logs - #7046
23.1; Repeating emacs macro skipping every second line

Previous Next

Package: emacs;

Reported by: Gord Wait <gordwait <at> lighthauslogic.com>

Date: Thu, 16 Sep 2010 19:00:03 UTC

Severity: normal

Merged with 8114, 10461

Found in versions 23.1, 24.0.50

Done: Eli Zaretskii <eliz <at> gnu.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 7046 in the body.
You can then email your comments to 7046 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Thu, 16 Sep 2010 19:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gord Wait <gordwait <at> lighthauslogic.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 16 Sep 2010 19:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gord Wait <gordwait <at> lighthauslogic.com>
To: "'bug-gnu-emacs <at> gnu.org'" <bug-gnu-emacs <at> gnu.org>
Subject: 23.1; Repeating emacs macro skipping every second line
Date: Thu, 16 Sep 2010 11:38:25 -0700
I created a keyboard macro to move a word from the end of the line to the start of the line. At the end of it I include the commands - "move-beggining-of-line" followed by "next-line" so that I can repeat it through my file.
If I run it interactively "by hand" it works great. If I call it with a numerical repeat value to make it run say 20 times, it skips every second line.

This basically makes keyboard macros useless to me for the first time in over 25 years of using emacs.. I will try "forward-line" to see if it behaves the same way..



In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'

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: C.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Tcl

Minor modes in effect:
  show-paren-mode: t
  tooltip-mode: t
  tool-bar-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
  transient-mark-mode: t

Recent input:
C-x ( C-s P I N _ C-f C-s - t o C-f C-SPC C-e C-w C-a
C-y SPC C-a C-n C-x ) C-x C-s C-x e C-x e C-x e C-x
C-s C-k C-/ C-u 2 0 C-x e C-/ C-/ C-/ C-/ C-/ C-/ C-/
C-/ C-/ C-/ C-/ C-/ C-a C-x C-s <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu>
<send-emacs-bug-report>

Recent messages:
Saving file c:/firmware/projects/Proj_137_UC_S2_ExtremeCard_Stratix/trunk/board_test_system_for_S4_card/bts_config/bts_config_pinout.tcl...
Wrote c:/firmware/projects/Proj_137_UC_S2_ExtremeCard_Stratix/trunk/board_test_system_for_S4_card/bts_config/bts_config_pinout.tcl
(Type e to repeat macro) [3 times]
Saving file c:/firmware/projects/Proj_137_UC_S2_ExtremeCard_Stratix/trunk/board_test_system_for_S4_card/bts_config/bts_config_pinout.tcl...
Wrote c:/firmware/projects/Proj_137_UC_S2_ExtremeCard_Stratix/trunk/board_test_system_for_S4_card/bts_config/bts_config_pinout.tcl
Undo!
(Type e to repeat macro)
Undo! [12 times]
Saving file c:/firmware/projects/Proj_137_UC_S2_ExtremeCard_Stratix/trunk/board_test_system_for_S4_card/bts_config/bts_config_pinout.tcl...
Wrote c:/firmware/projects/Proj_137_UC_S2_ExtremeCard_Stratix/trunk/board_test_system_for_S4_card/bts_config/bts_config_pinout.tcl

*** E-Mail body has been placed on clipboard, please paste them here! ***

This e-mail may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable laws. Unauthorized use, reproduction or dissemination of the e-mail is strictly prohibited. If you have received this e-mail in error, please contact the sender immediately. [11EABB509DF]




Merged 7046 7047. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 16 Sep 2010 19:04:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Thu, 16 Sep 2010 20:35:02 GMT) Full text and rfc822 format available.

Message #10 received at 7046 <at> debbugs.gnu.org (full text, mbox):

From: Gord Wait <gordwait <at> lighthauslogic.com>
To: "'7046 <at> debbugs.gnu.org'" <7046 <at> debbugs.gnu.org>
Subject: More info
Date: Thu, 16 Sep 2010 13:35:44 -0700
I also tried using "forward-line" and got similar results.

It seems to be dependent on how many repeats I select. If I auto repeat say 10 lines worth,
It seems to be ok. If I auto repeat the macro 1000 times, then it starts to skip every line at some point..


This e-mail may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable laws. Unauthorized use, reproduction or dissemination of the e-mail is strictly prohibited. If you have received this e-mail in error, please contact the sender immediately. [11EABB509DF]




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Fri, 17 Sep 2010 15:34:02 GMT) Full text and rfc822 format available.

Message #13 received at 7046 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Gord Wait <gordwait <at> lighthauslogic.com>
Cc: "'7046 <at> debbugs.gnu.org'" <7046 <at> debbugs.gnu.org>
Subject: Re: bug#7046: More info
Date: Fri, 17 Sep 2010 17:35:27 +0200
> I also tried using "forward-line" and got similar results.  It seems
> to be dependent on how many repeats I select. If I auto repeat say 10
> lines worth, It seems to be ok. If I auto repeat the macro 1000 times,
> then it starts to skip every line at some point..

Both cases sound like bugs, but without a concrete test case it's
difficult to track it down.  Can you provide a precise test case
(e.g. a sample file and the key strokes you hit to define and run the
macro, ideally starting from "emacs -Q")?


        Stefan




Disconnected #7046 from all other report(s). Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 17 Sep 2010 16:23:01 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Sep 2010 16:23:01 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Fri, 17 Sep 2010 19:09:03 GMT) Full text and rfc822 format available.

Message #20 received at 7046 <at> debbugs.gnu.org (full text, mbox):

From: Gord Wait <gordwait <at> lighthauslogic.com>
To: 'Stefan Monnier' <monnier <at> IRO.UMontreal.CA>
Cc: "'7046 <at> debbugs.gnu.org'" <7046 <at> debbugs.gnu.org>,
	"'rgm <at> gnu.org'" <rgm <at> gnu.org>
Subject: RE: bug#7046: More info
Date: Fri, 17 Sep 2010 11:45:36 -0700
Hopefully this update will make it, Glenn Morris emailed me to note that the 7046 bug got closed (by accident)..

Here is the explanation. Below it are some sample lines. Build a file with a couple hundred of those lines to test against..

--------------------------------------------

The goal of the edit work is to cut the last "word" of each line and place it as the first "word" of each line.
(Later I sort-lines, this way the lines are sorted by the value of the original last word of the line)..

I create a keyboard macro that knows the line syntax, and does one line of work:


(fset 'moveword
   [?\C-s ?- ?t ?o ?\C-f ?\C-  ?\C-e ?\C-w ?\C-a ?\C-y ?  ?\C-a ?\C-n])

Macro edit view of the same thing:
Macro:

C-s                     ;; isearch-forward
-to                     ;; self-insert-command * 3
C-f                     ;; forward-char
C-SPC                   ;; set-mark-command
C-e                     ;; move-end-of-line
C-w                     ;; kill-region
C-a                     ;; move-beginning-of-line
C-y                     ;; yank
SPC                     ;; self-insert-command
C-a                     ;; move-beginning-of-line
C-n                     ;; next-line

Place the cursor at the start of any line and run the macro once

(Esc-x moveword)

It finds the ascii "-to" word, moves ahead to the last word, cuts and pastes it at the start, then drops down one line.

Try it repeatedly for a few lines manually to show the macro works as desired..

Now try to auto repeat the macro 100 times:

(Ctrl-u 100 Esc-x moveword)

Macro repeats, but at some point starts skipping a line.

I also manually executed the macro succesfully on lines that failed the 100 repeat, to show that it wasn't some artifact of those failed lines..

-----------------------------------------------
Sample lines to be manipulated by the macro.. Make a file with a few hundred of these in it. Duplicating these ones will be fine to show the bug. In the real file each line is unique.
-----------------------------------------------
set_location_assignment PIN_AP23 -to ddr3bot_dq[36]
set_location_assignment PIN_AM23 -to ddr3bot_dq[35]
set_location_assignment PIN_AT23 -to ddr3bot_dq[34]
set_location_assignment PIN_AN23 -to ddr3bot_dq[33]
set_location_assignment PIN_AU23 -to ddr3bot_dq[32]
set_location_assignment PIN_AK17 -to ddr3bot_dq[31]
set_location_assignment PIN_AG17 -to ddr3bot_dq[30]
set_location_assignment PIN_AH17 -to ddr3bot_dq[29]
set_location_assignment PIN_AG16 -to ddr3bot_dq[28]
set_location_assignment PIN_AL17 -to ddr3bot_dq[27]
set_location_assignment PIN_AH16 -to ddr3bot_dq[26]
set_location_assignment PIN_AM17 -to ddr3bot_dq[25]
set_location_assignment PIN_AJ16 -to ddr3bot_dq[24]
set_location_assignment PIN_AU15 -to ddr3bot_dq[23]
set_location_assignment PIN_AR17 -to ddr3bot_dq[22]
set_location_assignment PIN_AT15 -to ddr3bot_dq[21]
set_location_assignment PIN_AP17 -to ddr3bot_dq[20]
set_location_assignment PIN_AV16 -to ddr3bot_dq[19]
set_location_assignment PIN_AN16 -to ddr3bot_dq[18]
set_location_assignment PIN_AW16 -to ddr3bot_dq[17]
set_location_assignment PIN_AT16 -to ddr3bot_dq[16]
set_location_assignment PIN_AW12 -to ddr3bot_dq[15]
set_location_assignment PIN_AV11 -to ddr3bot_dq[14]
set_location_assignment PIN_AU14 -to ddr3bot_dq[13]
set_location_assignment PIN_AW11 -to ddr3bot_dq[12]
set_location_assignment PIN_AV14 -to ddr3bot_dq[11]
set_location_assignment PIN_AU12 -to ddr3bot_dq[10]
set_location_assignment PIN_AW14 -to ddr3bot_dq[9]
set_location_assignment PIN_AT12 -to ddr3bot_dq[8]
set_location_assignment PIN_AP13 -to ddr3bot_dq[7]
set_location_assignment PIN_AP14 -to ddr3bot_dq[6]
set_location_assignment PIN_AN13 -to ddr3bot_dq[5]
set_location_assignment PIN_AR14 -to ddr3bot_dq[4]
set_location_assignment PIN_AL14 -to ddr3bot_dq[3]
set_location_assignment PIN_AN14 -to ddr3bot_dq[2]
set_location_assignment PIN_AM13 -to ddr3bot_dq[1]
set_location_assignment PIN_AM14 -to ddr3bot_dq[0]
set_location_assignment PIN_AL23 -to ddr3bot_dqs_n[7]
set_location_assignment PIN_AU26 -to ddr3bot_dqs_n[6]



-----Original Message-----
From: Stefan Monnier [mailto:monnier <at> IRO.UMontreal.CA]
Sent: Friday, September 17, 2010 8:35 AM
To: Gord Wait
Cc: '7046 <at> debbugs.gnu.org'
Subject: Re: bug#7046: More info

> I also tried using "forward-line" and got similar results.  It seems
> to be dependent on how many repeats I select. If I auto repeat say 10
> lines worth, It seems to be ok. If I auto repeat the macro 1000 times,
> then it starts to skip every line at some point..

Both cases sound like bugs, but without a concrete test case it's
difficult to track it down.  Can you provide a precise test case
(e.g. a sample file and the key strokes you hit to define and run the
macro, ideally starting from "emacs -Q")?


        Stefan

This e-mail may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable laws. Unauthorized use, reproduction or dissemination of the e-mail is strictly prohibited. If you have received this e-mail in error, please contact the sender immediately. [11EABB509DF]




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Sat, 25 Sep 2010 23:43:01 GMT) Full text and rfc822 format available.

Message #23 received at 7046 <at> debbugs.gnu.org (full text, mbox):

From: Johan Bockgård <bojohan <at> gnu.org>
To: Gord Wait <gordwait <at> lighthauslogic.com>
Cc: "'7046 <at> debbugs.gnu.org'" <7046 <at> debbugs.gnu.org>
Subject: Re: bug#7046: More info
Date: Sun, 26 Sep 2010 01:45:16 +0200
Gord Wait <gordwait <at> lighthauslogic.com> writes:

> I also tried using "forward-line" and got similar results.

Really?

> It seems to be dependent on how many repeats I select. If I auto
> repeat say 10 lines worth, It seems to be ok. If I auto repeat the
> macro 1000 times, then it starts to skip every line at some point..

next-line can move to the wrong column when point gets below the end of
the window.

The problem is in line-move-visual (i.e it only exists if the variable
line-move-visual is non-nil),

    ;; Otherwise, we should reset `temporary-goal-column'.
    (let ((posn (posn-at-point)))
      (cond
       ;; Handle the `overflow-newline-into-fringe' case:
       ((eq (nth 1 posn) 'right-fringe)
        (setq temporary-goal-column (cons (- (window-width) 1) hscroll)))
       ((car (posn-x-y posn))
        (setq temporary-goal-column
              (cons (/ (float (car (posn-x-y posn)))
                       (frame-char-width)) hscroll)))))

If the position is not visible in the window, posn-at-point returns nil
and temporary-goal-column is not updated as it should.




Merged 7046 7526. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 25 Jan 2011 00:52:02 GMT) Full text and rfc822 format available.

Merged 7046 7526 8114. Request was from Johan Bockgård <bojohan <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 22 Mar 2011 14:05:02 GMT) Full text and rfc822 format available.

Disconnected #7526 from all other report(s). Request was from Johan Bockgard <bojohan <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 28 Nov 2011 21:41:01 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Nov 2011 21:44:01 GMT) Full text and rfc822 format available.

Merged 7046 8114 10461. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Wed, 08 Jun 2016 03:27:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Mon, 30 Dec 2019 14:06:02 GMT) Full text and rfc822 format available.

Message #36 received at 7046 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Gord Wait <gordwait <at> lighthauslogic.com>
Cc: "'7046 <at> debbugs.gnu.org'" <7046 <at> debbugs.gnu.org>, 10461 <at> debbugs.gnu.org
Subject: Re: bug#7046: More info
Date: Mon, 30 Dec 2019 14:05:03 +0000
Johan Bockgård <bojohan <at> gnu.org> writes:

> Gord Wait <gordwait <at> lighthauslogic.com> writes:
>
>> It seems to be dependent on how many repeats I select. If I auto
>> repeat say 10 lines worth, It seems to be ok. If I auto repeat the
>> macro 1000 times, then it starts to skip every line at some point..
>
> next-line can move to the wrong column when point gets below the end of
> the window.
>
> The problem is in line-move-visual (i.e it only exists if the variable
> line-move-visual is non-nil),
>
>     ;; Otherwise, we should reset `temporary-goal-column'.
>     (let ((posn (posn-at-point)))
>       (cond
>        ;; Handle the `overflow-newline-into-fringe' case:
>        ((eq (nth 1 posn) 'right-fringe)
>         (setq temporary-goal-column (cons (- (window-width) 1) hscroll)))
>        ((car (posn-x-y posn))
>         (setq temporary-goal-column
>               (cons (/ (float (car (posn-x-y posn)))
>                        (frame-char-width)) hscroll)))))
>
> If the position is not visible in the window, posn-at-point returns nil
> and temporary-goal-column is not updated as it should.

I can't replicate this on Emacs 27 and it's been over 7 years since the
last bug report. Can anyone confirm whether it's still a problem?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7046; Package emacs. (Mon, 30 Dec 2019 15:37:03 GMT) Full text and rfc822 format available.

Message #39 received at 7046-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: gordwait <at> lighthauslogic.com, 7046-done <at> debbugs.gnu.org,
 10461-done <at> debbugs.gnu.org
Subject: Re: bug#7046: More info
Date: Mon, 30 Dec 2019 17:36:34 +0200
> From: Alan Third <alan <at> idiocy.org>
> Date: Mon, 30 Dec 2019 14:05:03 +0000
> Cc: "'7046 <at> debbugs.gnu.org'" <7046 <at> debbugs.gnu.org>, 10461 <at> debbugs.gnu.org
> 
> > The problem is in line-move-visual (i.e it only exists if the variable
> > line-move-visual is non-nil),
> >
> >     ;; Otherwise, we should reset `temporary-goal-column'.
> >     (let ((posn (posn-at-point)))
> >       (cond
> >        ;; Handle the `overflow-newline-into-fringe' case:
> >        ((eq (nth 1 posn) 'right-fringe)
> >         (setq temporary-goal-column (cons (- (window-width) 1) hscroll)))
> >        ((car (posn-x-y posn))
> >         (setq temporary-goal-column
> >               (cons (/ (float (car (posn-x-y posn)))
> >                        (frame-char-width)) hscroll)))))
> >
> > If the position is not visible in the window, posn-at-point returns nil
> > and temporary-goal-column is not updated as it should.
> 
> I can't replicate this on Emacs 27 and it's been over 7 years since the
> last bug report. Can anyone confirm whether it's still a problem?

This has been fixed several releases back, so I'm closing it.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 28 Jan 2020 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 82 days ago.

Previous Next


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