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

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

Re: Fw: request for bug fix of "invisible"


From: Kim F. Storm
Subject: Re: Fw: request for bug fix of "invisible"
Date: Wed, 17 Nov 2004 10:54:13 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Kazu Yamamoto (山本和彦) <address@hidden> writes:

> Hello,
>
> Would someone kindly respond this report?
> Thanks in advance.

Below is a patch which fixes the C-n C-p movement.

The C-e on "line 3" still works strange because if you place cursor on
the 'l', C-x = reports point=8 which is actually the hidden 'l' on
line 2, rather than the visible 'l' on line 3 (point=15).

Stefan, can you comment on this?


*** simple.el   08 Nov 2004 21:27:52 +0100      1.666
--- simple.el   17 Nov 2004 10:43:11 +0100      
***************
*** 3141,3174 ****
                            nil)))
            ;; Move by arg lines, but ignore invisible ones.
            (let (done)
!             (while (and (> arg 0) (not done))
!               ;; If the following character is currently invisible,
!               ;; skip all characters with that same `invisible' property 
value.
!               (while (and (not (eobp)) (line-move-invisible-p (point)))
!                 (goto-char (next-char-property-change (point))))
!               ;; Now move a line.
!               (end-of-line)
!               (and (zerop (vertical-motion 1))
!                    (if (not noerror)
!                        (signal 'end-of-buffer nil)
!                      (setq done t)))
!               (unless done
!                 (setq arg (1- arg))))
!             (while (and (< arg 0) (not done))
!               (beginning-of-line)
! 
!               (if (zerop (vertical-motion -1))
!                   (if (not noerror)
!                       (signal 'beginning-of-buffer nil)
!                     (setq done t)))
!               (unless done
!                 (setq arg (1+ arg))
!                 (while (and ;; Don't move over previous invis lines
!                         ;; if our target is the middle of this line.
!                         (or (zerop (or goal-column temporary-goal-column))
!                             (< arg 0))
!                         (not (bobp)) (line-move-invisible-p (1- (point))))
!                   (goto-char (previous-char-property-change (point))))))))
          ;; This is the value the function returns.
          (= arg 0))
  
--- 3141,3176 ----
                            nil)))
            ;; Move by arg lines, but ignore invisible ones.
            (let (done)
!             (if (> arg 0)
!                 (while (not done)
!                   ;; If the following character is currently invisible,
!                   ;; skip all characters with that same `invisible' property 
value.
!                   (cond
!                    ((and (not (eobp)) (line-move-invisible-p (point)))
!                     (goto-char (next-char-property-change (point))))
!                    ((<= arg 0)
!                     (setq done t))
!                    (t
!                     ;; Now move a line.
!                     (end-of-line)
!                     (if (zerop (vertical-motion 1))
!                         (if (not noerror)
!                             (signal 'end-of-buffer nil)
!                           (setq done t))
!                       (setq arg (1- arg))))))
!               (while (and (< arg 0) (not done))
!                 (beginning-of-line)
!                 (if (zerop (vertical-motion -1))
!                     (if (not noerror)
!                         (signal 'beginning-of-buffer nil)
!                       (setq done t))
!                   (setq arg (1+ arg))
!                   (while (and ;; Don't move over previous invis lines
!                           ;; if our target is the middle of this line.
!                           (or (zerop (or goal-column temporary-goal-column))
!                               (< arg 0))
!                           (not (bobp)) (line-move-invisible-p (1- (point))))
!                     (goto-char (previous-char-property-change (point)))))))))
          ;; This is the value the function returns.
          (= arg 0))
  

>
> --Kazu Yamamoto
> From: Kazu Yamamoto (山本和彦) <address@hidden>
> Subject: request for bug fix of "invisible"
> To: address@hidden
> Cc: address@hidden
> Date: Fri, 29 Oct 2004 12:07:10 +0900 (JST)
>
> Hello,
>
> This is the third trial to ask to fix bugs related to the "invisible"
> property. I'm really suffering from these bugs.
>
> Consider the following content (without invisible text) of a buffer:
>
> ---
> line1
> line2
> line3
> line4
> ---
>
> At the beginning of line N, C-n goes to the beginning of line N+1.
> At the beginning of line N, C-p goes to the beginning of line N-1.
> At the end of line N, C-n goes to the end of line N+1.
> At the end of line N, C-p goes to the end of line N-1.
>
> This is the right behavior.
>
> Then put the invisible property onto line 2 including "\n".
>
> ---
> line1
> line3
> line4
> ---
>
> (1) If line-move-ignore-invisible is nil:
>
> At the beginning of line 3, C-n goes to "i" in line 3.
>       (should go to the beginning of line 4)
> At the end of line 3, C-p goes to the beginning of line 3.
>       (should go to the end of line 2)
> At the beginning of line 3, C-e goes to "i" in line 3.
>       (should go to the end of line 3)
>
> (2) If line-move-ignore-invisible is t:
>
> At the end of line 1, C-n goes to the beginning of line 3.
>       (should go to the end of line 3)
> At the end of line 4, C-p goes to the beginning of line 3.
>       (should go to the end of line 3)
> At the beginning of the line 3, C-e goes to "i" in line 3.
>       (should go to the end of line 3)
>
> I guess the best solution is removing the line-move-ignore-invisible
> variable and behaving as if the invisible text does not exist.
>
> If this is not possible, Emacs should behave as if the invisible text
> does not exist when line-move-ignore-invisible is non-nil.
>
> --Kazu Yamamoto
> ----------
>
> _______________________________________________
> Emacs-pretest-bug mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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