emacs-devel
[Top][All Lists]
Advanced

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

RE: show-paren-mode prevents page-down from displaying next 1/2 page.


From: Maguire, Andrew \(GE Infra, Energy\)
Subject: RE: show-paren-mode prevents page-down from displaying next 1/2 page.
Date: Wed, 18 Apr 2007 15:32:48 +0200

Here goes: 

(require 'cl-macs)
(defun test:scroll-up:show-paren-mode ()
  "Test for scroll-up and show-paren-mode interaction."
  (let* ((buffer (get-buffer-create "*TEST*"))
         (pop-up-frames t)
         (truncate-lines nil)
        width pt coords-before coords-after)

    (switch-to-buffer-other-frame buffer t)
    (erase-buffer)
    (setq width (window-width))

    ;; Add long line text with [] such that ] is last visible character
    ;; ???What about display non-display of fringe???
    (insert "\n")
    (setq pt (point))
    (insert "[")
    (insert (make-string (- width 2) ?. ))
    (insert "] some trailing text\n")
    (insert "\n\n")
    (insert "In this test:\n")
    (insert "1. you shall see scroll-up work with show-paren-mode disabled\n\n")
    (insert "2. you will be asked to press Return to go back to the\n")
    (insert "   original situation.\n\n")
    (insert "3. show-paren-mode will be enabled and scroll up will be 
repeated\n")

    (read-string "Press Return to Begin: ")

    ;; First scroll-up without show-paren-mode
    (goto-char pt)
    (show-paren-mode 0)
    (scroll-up 2)
    (setq coords-before (pos-visible-in-window-p nil nil t))

    (read-string "[]s should not be visible. Press Return to Continue: ")
    (scroll-down 2)

    (read-string "Press Return to enable show-paren-mode and scroll-up again: ")
    (show-paren-mode 1)
    (scroll-up 2)
    (redisplay t)

    ;;(setq coords-after (pos-visible-in-window-p nil nil t))
    (save-excursion
      (goto-char (point-max))
      (insert "(pos-visible-in-window-p nil nil t) illustrates the 
difference:\n")
      (insert (format "Without show-paren-mode: %s\n" coords-before))
      (insert "Find out the new value by pressing \[eval-expression]\n")
      (insert "and running the lisp command (pos-visible-in-window-p nil nil 
t)\n\n")
      (insert "NOTE: I cannot get pos-visible-in-window-p to return\n")
      (insert "this value programmatically, since the redisplay screen 
update\n")
      (insert "is occuring after this function exits.\n")
      (insert "(sit-for) and (redisplay) cannot force it either.\n")
      )

;;    (if (and
;;       (eq (first coords-before) (first coords-after))
;;       (eq (first coords-after) (first coords-after)))
;;      t
;;      (error "Failed TEST"))
    ))

;; Run the test!
(test:scroll-up:show-paren-mode)



Thanks,
Andrew

"If it runs, script it!"


> -----Original Message-----
> From: Richard Stallman [mailto:address@hidden
> Sent: 18 April 2007 03:03
> To: Maguire, Andrew (GE Infra, Energy)
> Cc: address@hidden; Maguire, Andrew (GE Infra, Energy)
> Subject: Re: show-paren-mode prevents page-down from 
> displaying next 1/2
> page.
> 
> 
>     To setup this rather strange bug, you need to:
>        1. ensure show-paren-mode is enabled
>        2. create a buffer and in that buffer, half way down 
> the window,
>         create a line that has some [] brackets such that the 
> ] bracket
>         is the last displayed character on the right of the screen.
> 
>         I also had characters after the ] so that the right 
> hand "fringe"
>         displayed its wrap-around icon.
> 
>         It is important that the [] line is displayed half 
> way down the window, e.g on the 5th line on a window height 
> of 10 (9 lines displayed due to wrap around).
> 
>        3. place point anywhere on the line with [] brackets 
> and press the page-down key.
> 
>     Instead of paging down, the display will flash and place 
> point immediately after the ] bracket.
> 
> Can you send us a _precise_ test case for this bug?
> Please read the Bugs section in the Emacs manual, which provides
> guidelines on how to write a bug report to give us the
> necessary information so we can fix the bug.
> 




reply via email to

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