bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-ma


From: Live System User
Subject: bug#33570: 26.1.90; Weirdness with prefix arg and kmacro-end-and-call-macro
Date: Sun, 02 Dec 2018 06:28:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]