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

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

Re: line-move-visual


From: David Kastrup
Subject: Re: line-move-visual
Date: Wed, 08 Dec 2010 15:14:22 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I should think that changing to logical mode when recording and
>> replaying macros would be an improvement.  I can't imagine anybody
>> wanting visual mode in that case.
>
> I remember we discussed it and somehow it got rejected.  I can't
> remember the reason for it, and I personally don't care much either way
> (my macros tend to use C-[aefb], and sexp-based movement but not much
> C-[np]).
>
>> There is already one such change: vertical movement does not use vscroll
>> in order to go smoothly through vertical material when macro recording
>> or playback is active.
>
> Didn't know about that.  Can you point me to the relevant piece of code?

See around the
               ;; But don't vscroll in a keyboard macro.
comment in lisp/simple.el:

;; This is like line-move-1 except that it also performs
;; vertical scrolling of tall images if appropriate.
;; That is not really a clean thing to do, since it mixes
;; scrolling with cursor motion.  But so far we don't have
;; a cleaner solution to the problem of making C-n do something
;; useful given a tall image.
(defun line-move (arg &optional noerror to-end try-vscroll)
  (unless (and auto-window-vscroll try-vscroll
               ;; Only vscroll for single line moves
               (= (abs arg) 1)
               ;; But don't vscroll in a keyboard macro.
               (not defining-kbd-macro)
               (not executing-kbd-macro)
               (line-move-partial arg noerror to-end))
    (set-window-vscroll nil 0 t)
    (if line-move-visual
        (line-move-visual arg noerror)
      (line-move-1 arg noerror to-end))))


-- 
David Kastrup


reply via email to

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