all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug in forward-visible-line: Patch
@ 2003-05-22  4:43 Luc Teirlinck
  2003-05-22 12:56 ` Stefan Monnier
  0 siblings, 1 reply; 16+ messages in thread
From: Luc Teirlinck @ 2003-05-22  4:43 UTC (permalink / raw)


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  <teirllm@mail.auburn.edu>

        * 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
============================================================

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

end of thread, other threads:[~2003-05-24 23:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-22  4:43 bug in forward-visible-line: Patch Luc Teirlinck
2003-05-22 12:56 ` Stefan Monnier
2003-05-22 17:46   ` Luc Teirlinck
2003-05-22 21:40   ` Luc Teirlinck
2003-05-22 21:51     ` Stefan Monnier
2003-05-22 22:03       ` Luc Teirlinck
2003-05-22 22:23         ` Luc Teirlinck
2003-05-22 23:38       ` Luc Teirlinck
2003-05-23  0:03         ` Luc Teirlinck
2003-05-22 22:27     ` David Kastrup
2003-05-23  8:54       ` Miles Bader
2003-05-23 16:18         ` Luc Teirlinck
2003-05-24 23:19           ` Richard Stallman
2003-05-23 22:48         ` Richard Stallman
2003-05-23 15:50       ` Luc Teirlinck
2003-05-22 21:46   ` Luc Teirlinck

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.