GNU bug report logs - #23551
24.5; beginning-of-line wrong in repeated kbd macro

Previous Next

Package: emacs;

Reported by: abbott <at> dima.unige.it

Date: Mon, 16 May 2016 16:33:01 UTC

Severity: normal

Merged with 8809, 13452, 23555

Found in versions 23.3, 24.1, 24.5

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 23551 in the body.
You can then email your comments to 23551 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 bug-gnu-emacs <at> gnu.org:
bug#23551; Package emacs. (Mon, 16 May 2016 16:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to abbott <at> dima.unige.it:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 16 May 2016 16:33:01 GMT) Full text and rfc822 format available.

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

From: abbott <at> dima.unige.it
To: bug-gnu-emacs <at> gnu.org
Cc: Abbott John <abbott <at> dima.unige.it>
Subject: 24.5; beginning-of-line wrong in repeated kbd macro
Date: Mon, 16 May 2016 16:30:32 +0000
[Message part 1 (text/plain, inline)]
I would like to report the following bug.
Open the attached file in Emacs, and move point to the first position.
Define a keyboard macro: (I want to put each line inside double-quotes)
"			;; self-insert-command
C-e			;; move-end-of-line
"			;; self-insert-command
C-a			;; message-beginning-of-line
<down>			;; next-line

Now ask Emacs to repeat this macro 49 times.
The result is wrong: at around line 35, the first double-quote
is no longer at the start of the line; then on successive lines
the position of the first inserted double-quote walks to the right.

-----------------------------------------------------------------
In GNU Emacs 24.5.1 (i686-apple-darwin, NS apple-appkit-1038.36)
 of 2015-04-10 on builder10-6.porkrind.org
Windowing system distributor `Apple', version 10.3.1038
Configured using:
 `configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --host=i686-apple-darwin
 --build=i686-apple-darwin --with-jpeg=no --with-png=no --with-gif=no
 --with-tiff=no'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  recentf-mode: t
  show-paren-mode: t
  tooltip-mode: t
  electric-indent-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Cleaning up the recentf list...
File /Users/abbott/ShortTerm/EMACS-BUG-orig removed from the recentf list
Cleaning up the recentf list...done (1 removed)
Loading /Users/abbott/Work/CoCoA/CoCoA4/4.7/UI/emacs/cocoa.emacs...done
Loading  
/Users/abbott/Work/CoCoA/CoCoA5/CoCoALib-0.99/src/CoCoA-5/emacs/cocoa5.emacs...done
Loading rmail-spam-filter.elc...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Defining kbd macro...
Keyboard macro defined
(Type e to repeat macro)

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr warnings emacsbug sendmail cl-extra
info magit-autoloads git-rebase-mode-autoloads git-commit-mode-autoloads
package epg-config rmail-spam-filter rmailsum rmail recentf tree-widget
wid-edit git-blame git derived log-edit easy-mmode message cl-macs
format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns
mail-prsvr mailabbrev mail-utils gmm-utils mailheader ring pcvs-util
add-log ewoc cl gv paren cus-start cus-load edmacro kmacro cl-loaddefs
cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel ns-win 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 cocoa ns
multi-tty emacs)

Memory information:
((conses 8 143707 11759)
 (symbols 24 23822 0)
 (miscs 20 100 224)
 (strings 16 30397 6332)
 (string-bytes 1 745514)
 (vectors 8 14455)
 (vector-slots 4 436468 9860)
 (floats 8 71 198)
 (intervals 28 254 26)
 (buffers 512 14))

[EMACS-BUG (text/plain, attachment)]

Merged 13452 23551. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 16 May 2016 17:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23551; Package emacs. (Mon, 16 May 2016 17:32:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: abbott <at> dima.unige.it
Cc: 23551 <at> debbugs.gnu.org
Subject: Re: bug#23551: 24.5; beginning-of-line wrong in repeated kbd macro
Date: Mon, 16 May 2016 20:30:29 +0300
> Date: Mon, 16 May 2016 16:30:32 +0000
> From: abbott <at> dima.unige.it
> Cc: Abbott John <abbott <at> dima.unige.it>
> 
> Open the attached file in Emacs, and move point to the first position.
> Define a keyboard macro: (I want to put each line inside double-quotes)
> "			;; self-insert-command
> C-e			;; move-end-of-line
> "			;; self-insert-command
> C-a			;; message-beginning-of-line
> <down>			;; next-line
> 
> Now ask Emacs to repeat this macro 49 times.
> The result is wrong: at around line 35, the first double-quote
> is no longer at the start of the line; then on successive lines
> the position of the first inserted double-quote walks to the right.

Thanks.

This is a duplicate of the (old, but unsolved) bug #13452.  The
problem is not in beginning-of-line, it's in next-line: when the
window needs to scroll as result of next-line, point ends up in
columns 1, 2, 3, ... (i.e. gains one column per line moved down),
instead of sticking to column zero.

To work around, set line-move-visual to nil before running the macro
(or as part of the macro), then the problem goes away.

I'll try to debug this one of these days.




Merged 13452 23551 23555. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 16 May 2016 18:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23551; Package emacs. (Mon, 16 May 2016 19:37:02 GMT) Full text and rfc822 format available.

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

From: abbott <at> dima.unige.it
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 23551 <at> debbugs.gnu.org
Subject: Re: bug#23551: 24.5; beginning-of-line wrong in repeated kbd macro
Date: Mon, 16 May 2016 19:36:42 +0000
Hi Eli

Thanks for the swift response, and the explanation.

> This is a duplicate of the (old, but unsolved) bug #13452....
> To work around, set line-move-visual to nil before running the macro

It seems that move-end-of-line and then forward-char achieves the right
thing (at least it did in a quick test).


> I'll try to debug this one of these days.

Good luck!

John Abbott






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23551; Package emacs. (Mon, 16 May 2016 19:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: abbott <at> dima.unige.it
Cc: 23551 <at> debbugs.gnu.org
Subject: Re: bug#23551: 24.5; beginning-of-line wrong in repeated kbd macro
Date: Mon, 16 May 2016 22:42:09 +0300
> Date: Mon, 16 May 2016 19:36:42 +0000
> From: abbott <at> dima.unige.it
> Cc: 23551 <at> debbugs.gnu.org
> 
> It seems that move-end-of-line and then forward-char achieves the right
> thing (at least it did in a quick test).

But the above two calls are not a good replacement for next-line, they
produce different results.

> > I'll try to debug this one of these days.
> 
> Good luck!

I doubt that luck has anything to do with this ;-)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Jun 2016 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 09 Jul 2016 03:48:02 GMT) Full text and rfc822 format available.

Forcibly Merged 8809 13452 23551 23555. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 09 Jul 2016 03:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Aug 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 320 days ago.

Previous Next


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