unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro
@ 2018-12-02  2:28 Live System User
  2018-12-02  7:22 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Live System User @ 2018-12-02  2:28 UTC (permalink / raw)
  To: 33570


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





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

* bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro
  2018-12-02  2:28 bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro Live System User
@ 2018-12-02  7:22 ` Eli Zaretskii
  2018-12-02 11:28   ` Live System User
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-12-02  7:22 UTC (permalink / raw)
  To: Live System User; +Cc: 33570

> From: Live System User <nyc4bos@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?





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

* bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro
  2018-12-02  7:22 ` Eli Zaretskii
@ 2018-12-02 11:28   ` Live System User
  2018-12-02 13:50     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Live System User @ 2018-12-02 11:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33570

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Live System User <nyc4bos@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.






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

* bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro
  2018-12-02 11:28   ` Live System User
@ 2018-12-02 13:50     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-12-02 13:50 UTC (permalink / raw)
  To: Live System User; +Cc: 33570

> From: Live System User <nyc4bos@aol.com>
> Cc: 33570@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.





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

end of thread, other threads:[~2018-12-02 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-02  2:28 bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro Live System User
2018-12-02  7:22 ` Eli Zaretskii
2018-12-02 11:28   ` Live System User
2018-12-02 13:50     ` Eli Zaretskii

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