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

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

Re: cursor_up capability not working in term.el


From: Dan Nicolaescu
Subject: Re: cursor_up capability not working in term.el
Date: Fri, 17 Sep 2004 09:48:37 -0700

Richard Stallman <address@hidden> writes:

  >     term-handle-ansi-escape has code to deal with "cursor up", but it does
  >     not work correctly (as shown above).
  > 
  > Does it correctly identify the "cursor up" sequence?

Yes, it's this code in `term-handle-ansi-escape':

   ;; \E[A - cursor up
   ((eq char ?A)
    (term-down (- (max 1 term-terminal-parameter)) t))

  > Does the code that is supposed to handle cursor-up actually
  > run when it gets a cursor-up?

Yes, but it's incorrect. `term-down' gets called with -1 as a
parameter and the point is at point-max, and this situation is not
handled correctly by term-down. The patch below fixes it. Please
apply. 



2004-09-17  Dan Nicolaescu  <address@hidden>

        * term.el (term-down): Perform vertical motion if DOWN is
        negative. 


*** term.el     07 Sep 2004 15:26:52 -0700      1.56
--- term.el     17 Sep 2004 09:29:15 -0700      
***************
*** 3503,3509 ****
      (if (and check-for-scroll (or term-scroll-with-delete term-pager-count))
        (setq down (term-handle-scroll down)))
      (term-adjust-current-row-cache down)
!     (if (/= (point) (point-max))
        (setq down (- down (term-vertical-motion down))))
      ;; Extend buffer with extra blank lines if needed.
      (cond ((> down 0)
--- 3540,3546 ----
      (if (and check-for-scroll (or term-scroll-with-delete term-pager-count))
        (setq down (term-handle-scroll down)))
      (term-adjust-current-row-cache down)
!     (if (or (/= (point) (point-max)) (< down 0))
        (setq down (- down (term-vertical-motion down))))
      ;; Extend buffer with extra blank lines if needed.
      (cond ((> down 0)




reply via email to

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