unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: bug in forward-visible-line: Patch
Date: Wed, 21 May 2003 23:43:04 -0500 (CDT)	[thread overview]
Message-ID: <200305220443.h4M4h4w10124@eel.dms.auburn.edu> (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
============================================================

             reply	other threads:[~2003-05-22  4:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-22  4:43 Luc Teirlinck [this message]
2003-05-22 12:56 ` bug in forward-visible-line: Patch 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305220443.h4M4h4w10124@eel.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).