emacs-devel
[Top][All Lists]
Advanced

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

bug in forward-visible-line: Patch


From: Luc Teirlinck
Subject: bug in forward-visible-line: Patch
Date: Wed, 21 May 2003 23:43:04 -0500 (CDT)

Start out with the following buffer:

line 1;line 2
line 3;line 4
line 5

Where, after each ";" there is an invisible newline.  With point at
the beginning of the buffer, do M-: (forward-visible-line arg) for
various args. 1 carries us to the beginning of line 3 and 2 to the
beginning of line 5 (as I expected).  Now put point at the end of line
4.  There 0 carries us to the beginning of line 4, -1 to the beginning
of line 3, -2 to the beginning of line 2 and -3 carries us also to the
beginning of line 2.

Makes no sense.  The following patch seems to fix the problem:

Change log:

2003-05-21  Luc Teirlinck  <address@hidden>

        * simple.el (forward-visible-line): Fix negative arguments.

Patch:

===File ~/simplediff========================================
cd /usr/local/share/emacs/21.3.50/lisp/
diff -c /usr/local/share/emacs/21.3.50/lisp/simple.old.el 
/usr/local/share/emacs/21.3.50/lisp/simple.el
*** /usr/local/share/emacs/21.3.50/lisp/simple.old.el   Wed May 21 18:33:45 2003
--- /usr/local/share/emacs/21.3.50/lisp/simple.el       Wed May 21 23:13:01 2003
***************
*** 2265,2272 ****
              (unless (bolp)
                (goto-char opoint))))
        (let ((first t))
!         (while (or first (< arg 0))
!           (if (zerop arg)
                (beginning-of-line)
              (or (zerop (forward-line -1))
                  (signal 'beginning-of-buffer nil)))
--- 2265,2272 ----
              (unless (bolp)
                (goto-char opoint))))
        (let ((first t))
!         (while (or first (<= arg 0))
!           (if first
                (beginning-of-line)
              (or (zerop (forward-line -1))
                  (signal 'beginning-of-buffer nil)))
***************
*** 2275,2287 ****
            (unless (bobp)
              (let ((prop
                     (get-char-property (1- (point)) 'invisible)))
!               (if (if (eq buffer-invisibility-spec t)
!                       prop
!                     (or (memq prop buffer-invisibility-spec)
!                         (assq prop buffer-invisibility-spec)))
!                   (setq arg (1+ arg)))))
!           (setq first nil)
!           (setq arg (1+ arg)))
          ;; If invisible text follows, and it is a number of complete lines,
          ;; skip it.
          (let ((opoint (point)))
--- 2275,2286 ----
            (unless (bobp)
              (let ((prop
                     (get-char-property (1- (point)) 'invisible)))
!               (unless (if (eq buffer-invisibility-spec t)
!                           prop
!                         (or (memq prop buffer-invisibility-spec)
!                             (assq prop buffer-invisibility-spec)))
!                 (setq arg (1+ arg)))))
!           (setq first nil))
          ;; If invisible text follows, and it is a number of complete lines,
          ;; skip it.
          (let ((opoint (point)))

Diff finished at Wed May 21 23:13:27
============================================================




reply via email to

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