GNU bug report logs - #33570
26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro

Previous Next

Package: emacs;

Reported by: Live System User <nyc4bos <at> aol.com>

Date: Sun, 2 Dec 2018 02:30:01 UTC

Severity: normal

Tags: notabug

Found in version 26.1.90

Done: Noam Postavsky <npostavs <at> gmail.com>

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 33570 in the body.
You can then email your comments to 33570 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#33570; Package emacs. (Sun, 02 Dec 2018 02:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Live System User <nyc4bos <at> aol.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Dec 2018 02:30:03 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro
Date: Sat, 01 Dec 2018 21:28:47 -0500
Hi,

        I am experiencing some weirdness with kmcro-end-and-call-macro.

        I just "git pull" the latest Emacs 26.1.90 and started it
        up "emacs - Q", switched to a non-existabt (new) buffer
        and inserted  a file via "C-x i".

        I then created a macro via "C-x (" ending with "C-x )"::

;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
;; Original keys: 5*; C-a C-n

Command: last-kbd-macro
Key: none

Macro:

5*;			;; self-insert-command
C-a			;; move-beginning-of-line
C-n			;; next-line


        What I was trying to do was to comment out some lines in
        an elisp file by adding  semi-colons, going back to the
        begining of the line and then positoning to the next line.

        I tested the macro via "C-x e" (kmacro-end-and-call-macro)
        to make sure it gave the results that I wanted which it did.
        So I then added a prefix argument:

           C-u 20 C-x e
        and saw this:

;;;;;(setq magit-blame-heading-format "%-20a %C %s %H")
;;;;;
;;;;;(setq magit-branch-read-upstream-first nil)
;;;;;(setq magit-branch-arguments nil)
;;;;;
;;;;;;; FIXME: ADD https://github.com/wuliuxiansheng/Emacs_Configuration/blob/;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;master/lisp/init-vc.el

        It looks like the macro did not go to the next line but stayed
        on line 41 of a 51-line buffer.

        What happened?

        Is there an issue with logical/visual lines and its
        interection with "C-a" and/or "C-n" used in keyboard
        macros?

        Thanks.




In GNU Emacs 26.1.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.20.10)
 of 2018-12-01 built on localhost.localdomain
Repository revision: af914fc26db273d8788e7efa57c569f0f778d037
Windowing system distributor 'Fedora Project', version 11.0.11803000
Recent messages:
nnimap read 166k from imap.aim.com
nnimap read 186k from imap.aim.com
nnimap read 217k from imap.aim.com
nnimap read 242k from imap.aim.com
nnimap read 287k from imap.aim.com
nnimap read 309k from imap.aim.com
Fetching headers for nnimap+aol:INBOX...done
Scoring...done
Sorting threads...done
Generating summary...done

Configured using:
 'configure 'CFLAGS=-DMAIL_USE_LOCKF -O0 -ggdb3 -pipe -Wall
 -Werror=format-security -fexceptions -fstack-protector-strong
 --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic'
 LDFLAGS=-Wl,-z,relro
 --prefix=/tmp/nff/de2/fedora-emacs-src/emacs-26.1.90 --with-dbus
 --with-gif --with-jpeg --with-png --with-rsvg --with-lcms2 --with-tiff
 --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=yes
 --with-xwidgets --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Summary

Minor modes in effect:
  gnus-desktop-notify-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug sendmail sort gnus-cite smiley ansi-color mail-extr
gnus-async gnus-bcklg qp gnus-ml disp-table cursor-sensor nndraft nnmh
nndoc mm-archive timezone url-http url-gw url-cache url-auth
url-handlers utf-7 rfc2104 nnfolder cl-extra help-mode network-stream
nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-cache gnus-demon nntp gnus-desktop-notify easy-mmode notifications
dbus xml epa-file nnreddit mm-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs url-vars json
map gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap cl sieve
sieve-mode sieve-manage starttls sasl sasl-anonymous sasl-login
sasl-plain advice nnir gnus-sum gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc parse-time
gnus-spec gnus-int gnus-range message rmc puny seq byte-opt gv bytecomp
byte-compile cconv dired dired-loaddefs format-spec rfc822 mml easymenu
mml-sec password-cache epa derived epg epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win
gnus wid-edit cl-loaddefs cl-lib nnoo nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
misearch multi-isearch elec-pair time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded 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 threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 29561280 90406)
 (symbols 48 127612 44)
 (miscs 40 186 553)
 (strings 32 120553 11941)
 (string-bytes 1 4166879)
 (vectors 16 28342)
 (vector-slots 8 960954 63594)
 (floats 8 216 558)
 (intervals 56 9208 152)
 (buffers 992 35)
 (heap 1024 592816 512401))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33570; Package emacs. (Sun, 02 Dec 2018 07:24:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Live System User <nyc4bos <at> aol.com>
Cc: 33570 <at> debbugs.gnu.org
Subject: Re: bug#33570: 26.1.90;
 Weirdness with prefix arg and kmacro-end-and-call-macro
Date: Sun, 02 Dec 2018 09:22:56 +0200
> From: Live System User <nyc4bos <at> aol.com>
> Date: Sat, 01 Dec 2018 21:28:47 -0500
> 
> Macro:
> 
> 5*;			;; self-insert-command
> C-a			;; move-beginning-of-line
> C-n			;; next-line
> 
> 
>         What I was trying to do was to comment out some lines in
>         an elisp file by adding  semi-colons, going back to the
>         begining of the line and then positoning to the next line.
> 
>         I tested the macro via "C-x e" (kmacro-end-and-call-macro)
>         to make sure it gave the results that I wanted which it did.
>         So I then added a prefix argument:
> 
>            C-u 20 C-x e
>         and saw this:
> 
> ;;;;;(setq magit-blame-heading-format "%-20a %C %s %H")
> ;;;;;
> ;;;;;(setq magit-branch-read-upstream-first nil)
> ;;;;;(setq magit-branch-arguments nil)
> ;;;;;
> ;;;;;;; FIXME: ADD https://github.com/wuliuxiansheng/Emacs_Configuration/blob/;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;master/lisp/init-vc.el
> 
>         It looks like the macro did not go to the next line but stayed
>         on line 41 of a 51-line buffer.
> 
>         What happened?

I don't know, since you didn't show the text before the change, and
you only show 6 lines out of 20 that should have been changed.

>         Is there an issue with logical/visual lines and its
>         interection with "C-a" and/or "C-n" used in keyboard
>         macros?

C-n moves by visual lines by default, is that what you asked?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33570; Package emacs. (Sun, 02 Dec 2018 11:30:02 GMT) Full text and rfc822 format available.

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

From: Live System User <nyc4bos <at> aol.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33570 <at> debbugs.gnu.org
Subject: Re: bug#33570: 26.1.90;
 Weirdness with prefix arg and kmacro-end-and-call-macro
Date: Sun, 02 Dec 2018 06:28:41 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Live System User <nyc4bos <at> aol.com>
>> Date: Sat, 01 Dec 2018 21:28:47 -0500
>> 
>> Macro:
>> 
>> 5*;			;; self-insert-command
>> C-a			;; move-beginning-of-line
>> C-n			;; next-line
>> 
>> 
>>         What I was trying to do was to comment out some lines in
>>         an elisp file by adding  semi-colons, going back to the
>>         begining of the line and then positoning to the next line.
>> 
>>         I tested the macro via "C-x e" (kmacro-end-and-call-macro)
>>         to make sure it gave the results that I wanted which it did.
>>         So I then added a prefix argument:
>> 
>>            C-u 20 C-x e
>>         and saw this:
>> 
>> ;;;;;(setq magit-blame-heading-format "%-20a %C %s %H")
>> ;;;;;
>> ;;;;;(setq magit-branch-read-upstream-first nil)
>> ;;;;;(setq magit-branch-arguments nil)
>> ;;;;;
>> ;;;;;;; FIXME: ADD https://github.com/wuliuxiansheng/Emacs_Configuration/blob/;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;master/lisp/init-vc.el
>> 
>>         It looks like the macro did not go to the next line but stayed
>>         on line 41 of a 51-line buffer.
>> 
>>         What happened?
>
> I don't know, since you didn't show the text before the change, and
> you only show 6 lines out of 20 that should have been changed.

  That's because the next lines remained the same:

(setq magit-diff-refine-hunk 'all) ; refine all hunks instead of just the
                                   ; selected one


   which you'll notice did NOT add the semi-colons to those 2 lines
   nor any subsequent lines.

   The original text starting from the point where rhe macro was
   called::

(setq magit-display-buffer-function
      #'magit-display-buffer-fullframe-status-v1)

(defadvice magit-status (around magit-fullscreen activate)
  (window-configuration-to-register :magit-fullscreen)
  ad-do-it
  (delete-other-windows))
(global-set-key "\C-c\g" 'magit-status)

(defun magit-quit-session ()
  "Restores the previous window configuration and kills the magit buffer"
  (interactive)
  (magit-mode-quit-window)
  (jump-to-register :magit-fullscreen))
;(define-key magit-status-mode-map (kbd "Q") 'magit-quit-session)

;; Show commit SHA in blame mode.
(setq magit-blame-heading-format "%-20a %C %s %H")

(setq magit-branch-read-upstream-first nil)
(setq magit-branch-arguments nil)

;; FIXME: ADD https://github.com/wuliuxiansheng/Emacs_Configuration/blob/master/lisp/init-vc.el
(setq magit-diff-refine-hunk 'all) ; refine all hunks instead of just the
                                   ; selected one

;; make diff chunks stand out a bit more:
;(set-face-background 'magit-diff-hunk-heading-highlight "#5d4d7a")


>
>>         Is there an issue with logical/visual lines and its
>         interection with "C-a" and/or "C-n" used in keyboard
>         macros?

C-n moves by visual lines by default, is that what you asked?

    Is the long line above ";; FIXME:..." (with the line continuation
    indicator) 1 visual line and also it's 2 logical ones?

    IIUC, this would mean that C-n would go to the (logical) line:

                r/lisp/init-vc.e;

     and not to the next (visual) line which starts with:
     
                (setq magit-diff-refine-hunk ...
                
    Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33570; Package emacs. (Sun, 02 Dec 2018 13:52:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Live System User <nyc4bos <at> aol.com>
Cc: 33570 <at> debbugs.gnu.org
Subject: Re: bug#33570: 26.1.90;
 Weirdness with prefix arg and kmacro-end-and-call-macro
Date: Sun, 02 Dec 2018 15:50:56 +0200
> From: Live System User <nyc4bos <at> aol.com>
> Cc: 33570 <at> debbugs.gnu.org
> Date: Sun, 02 Dec 2018 06:28:41 -0500
> 
>     Is the long line above ";; FIXME:..." (with the line continuation
>     indicator) 1 visual line and also it's 2 logical ones?

No, it's one logical line and 2 visual lines.

So C-a goes to the beginning of the logical line, right before
";; FIXME", and then C-n goes to the next visual line

>     IIUC, this would mean that C-n would go to the (logical) line:
> 
>                 r/lisp/init-vc.e;
> 
>      and not to the next (visual) line which starts with:
>      
>                 (setq magit-diff-refine-hunk ...

Yes.  And thus the following invocations of the macro loop at the same
line.

IOW, this is not a bug, but the intended behavior.




Added tag(s) notabug. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 18 Apr 2019 00:27:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 33570 <at> debbugs.gnu.org and Live System User <nyc4bos <at> aol.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 18 Apr 2019 00:27:03 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. (Thu, 16 May 2019 11:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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