unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
@ 2022-08-23  6:12 Gerd Möllmann
  2022-08-23  7:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-23 11:57 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Gerd Möllmann @ 2022-08-23  6:12 UTC (permalink / raw)
  To: 57349

In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
 appkit-2113.60 Version 12.5.1 (Build 21G83)) of 2022-08-22 built on
 Mini.fritz.box
Repository revision: 0c410206aa91b9bc9a0922d63ec34de765eb86a6
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.5.1

emacs -Q
M-x pixel-scroll-precision-mode RET

Move the mouse to the lower right corner of the Emacs frame.  On macOS,
the mouse cursor changes shape to a double-arrow pointing 45 degrees in
the direction of the upper-left and lower-right corner of the screen.

Scroll the mouse wheel.

This either prints messages like this

<nil> <wheel-up> is undefined
<nil> <double-wheel-up> is undefined
<nil> <triple-wheel-up> is undefined [45 times]
<nil> <wheel-down> is undefined

or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.
Not sure what to make of this.  Looks like posn-at-x-y returns a posn
with a nil point?  Or maybe posn-point returns nil?

Backtrace of the error:

  goto-char(nil)
  (save-excursion (goto-char point) (vertical-motion (- (1+ scroll-margin))) (point))
  (let* ((edges (window-edges nil t nil t)) (max-y (- (nth 3 edges) (nth 1 edges))) (usable-height max-y) (posn (posn-at-x-y 0 (+ (window-tab-line-height) (window-header-line-height) (- max-y delta)))) (point (posn-point posn)) (up-point (save-excursion (goto-char point) (vertical-motion (- (1+ scroll-margin))) (point)))) (if (> (point) up-point) (progn (if (let ((pos-visible (pos-visible-in-window-p up-point nil t))) (or (eq (length pos-visible) 2) (let* (... ... ...) (if usable-height ...)))) (progn (goto-char up-point))))) (let ((current-vscroll (window-vscroll nil t))) (setq delta (- delta current-vscroll)) (set-window-vscroll nil 0 t t) (if (> delta 0) (progn (let* ((start (window-start)) (dims (window-text-pixel-size nil ... start nil nil nil t)) (height (nth 1 dims)) (position (nth 2 dims))) (set-window-start nil position t) (if (> height usable-height) (progn (goto-char position))) (if (or (not position) (eq position start)) (progn (signal ... nil))) (setq delta (- delta height))))) (if (< delta 0) (progn (set-window-vscroll nil (- delta) t t)))))
  pixel-scroll-precision-scroll-up-page(0)
  (while (> delta max-height) (pixel-scroll-precision-scroll-up-page max-height) (setq delta (- delta max-height)))
  (let ((max-height (- (window-text-height nil t) (frame-char-height)))) (while (> delta max-height) (pixel-scroll-precision-scroll-up-page max-height) (setq delta (- delta max-height))) (pixel-scroll-precision-scroll-up-page delta))
  pixel-scroll-precision-scroll-up(1)
  (if (< delta 0) (pixel-scroll-precision-scroll-down (- delta)) (pixel-scroll-precision-scroll-up delta))
  (progn (if (< delta 0) (pixel-scroll-precision-scroll-down (- delta)) (pixel-scroll-precision-scroll-up delta)) (pixel-scroll-accumulate-velocity delta))
  (condition-case nil (progn (if (< delta 0) (pixel-scroll-precision-scroll-down (- delta)) (pixel-scroll-precision-scroll-up delta)) (pixel-scroll-accumulate-velocity delta)) (beginning-of-buffer (message (error-message-string '(beginning-of-buffer)))) (end-of-buffer (message (error-message-string '(end-of-buffer)))))
  (if (or (and pixel-scroll-precision-interpolate-mice (eq (device-class last-event-frame last-event-device) 'mouse)) (and pixel-scroll-precision-large-scroll-height (> (abs delta) pixel-scroll-precision-large-scroll-height) (let* ((kin-state (pixel-scroll-kinetic-state)) (ring (aref kin-state 0)) (time (aref kin-state 1))) (or (null time) (> (- (float-time) time) 1.0) (and (consp ring) (ring-empty-p ring)))))) (progn (let ((kin-state (pixel-scroll-kinetic-state))) (aset kin-state 0 (make-ring 30)) (aset kin-state 1 nil)) (pixel-scroll-precision-interpolate delta current-window)) (condition-case nil (progn (if (< delta 0) (pixel-scroll-precision-scroll-down (- delta)) (pixel-scroll-precision-scroll-up delta)) (pixel-scroll-accumulate-velocity delta)) (beginning-of-buffer (message (error-message-string '(beginning-of-buffer)))) (end-of-buffer (message (error-message-string '(end-of-buffer))))))
  (progn (select-window (car save-selected-window--state) 'norecord) (if (or (and pixel-scroll-precision-interpolate-mice (eq (device-class last-event-frame last-event-device) 'mouse)) (and pixel-scroll-precision-large-scroll-height (> (abs delta) pixel-scroll-precision-large-scroll-height) (let* ((kin-state (pixel-scroll-kinetic-state)) (ring (aref kin-state 0)) (time (aref kin-state 1))) (or (null time) (> (- ... time) 1.0) (and (consp ring) (ring-empty-p ring)))))) (progn (let ((kin-state (pixel-scroll-kinetic-state))) (aset kin-state 0 (make-ring 30)) (aset kin-state 1 nil)) (pixel-scroll-precision-interpolate delta current-window)) (condition-case nil (progn (if (< delta 0) (pixel-scroll-precision-scroll-down (- delta)) (pixel-scroll-precision-scroll-up delta)) (pixel-scroll-accumulate-velocity delta)) (beginning-of-buffer (message (error-message-string '(beginning-of-buffer)))) (end-of-buffer (message (error-message-string '(end-of-buffer)))))))
  (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (if (or (and pixel-scroll-precision-interpolate-mice (eq (device-class last-event-frame last-event-device) 'mouse)) (and pixel-scroll-precision-large-scroll-height (> (abs delta) pixel-scroll-precision-large-scroll-height) (let* ((kin-state ...) (ring ...) (time ...)) (or (null time) (> ... 1.0) (and ... ...))))) (progn (let ((kin-state (pixel-scroll-kinetic-state))) (aset kin-state 0 (make-ring 30)) (aset kin-state 1 nil)) (pixel-scroll-precision-interpolate delta current-window)) (condition-case nil (progn (if (< delta 0) (pixel-scroll-precision-scroll-down (- delta)) (pixel-scroll-precision-scroll-up delta)) (pixel-scroll-accumulate-velocity delta)) (beginning-of-buffer (message (error-message-string '...))) (end-of-buffer (message (error-message-string '...)))))) (internal--after-with-selected-window save-selected-window--state))
  (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (if (or (and pixel-scroll-precision-interpolate-mice (eq (device-class last-event-frame last-event-device) 'mouse)) (and pixel-scroll-precision-large-scroll-height (> (abs delta) pixel-scroll-precision-large-scroll-height) (let* (... ... ...) (or ... ... ...)))) (progn (let ((kin-state ...)) (aset kin-state 0 (make-ring 30)) (aset kin-state 1 nil)) (pixel-scroll-precision-interpolate delta current-window)) (condition-case nil (progn (if (< delta 0) (pixel-scroll-precision-scroll-down ...) (pixel-scroll-precision-scroll-up delta)) (pixel-scroll-accumulate-velocity delta)) (beginning-of-buffer (message (error-message-string ...))) (end-of-buffer (message (error-message-string ...)))))) (internal--after-with-selected-window save-selected-window--state)))
  (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (if (or (and pixel-scroll-precision-interpolate-mice (eq ... ...)) (and pixel-scroll-precision-large-scroll-height (> ... pixel-scroll-precision-large-scroll-height) (let* ... ...))) (progn (let (...) (aset kin-state 0 ...) (aset kin-state 1 nil)) (pixel-scroll-precision-interpolate delta current-window)) (condition-case nil (progn (if ... ... ...) (pixel-scroll-accumulate-velocity delta)) (beginning-of-buffer (message ...)) (end-of-buffer (message ...))))) (internal--after-with-selected-window save-selected-window--state))))
  (if (> (abs delta) (window-text-height window t)) (mwheel-scroll event nil) (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (if (or (and pixel-scroll-precision-interpolate-mice ...) (and pixel-scroll-precision-large-scroll-height ... ...)) (progn (let ... ... ...) (pixel-scroll-precision-interpolate delta current-window)) (condition-case nil (progn ... ...) (beginning-of-buffer ...) (end-of-buffer ...)))) (internal--after-with-selected-window save-selected-window--state)))))
  (if (= 0 delta) nil (if (> (abs delta) (window-text-height window t)) (mwheel-scroll event nil) (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) (if (or ... ...) (progn ... ...) (condition-case nil ... ... ...))) (internal--after-with-selected-window save-selected-window--state))))))
  (let ((delta (round (cdr (nth 4 event))))) (if (= 0 delta) nil (if (> (abs delta) (window-text-height window t)) (mwheel-scroll event nil) (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window ... ...) (if ... ... ...)) (internal--after-with-selected-window save-selected-window--state)))))))
  (if (and (nth 4 event)) (let ((delta (round (cdr (nth 4 event))))) (if (= 0 delta) nil (if (> (abs delta) (window-text-height window t)) (mwheel-scroll event nil) (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn ... ...) (internal--after-with-selected-window save-selected-window--state))))))) (mwheel-scroll event nil))
  (let ((window (mwheel-event-window event)) (current-window (selected-window))) (if (framep window) (progn (setq window (frame-selected-window window)))) (if (and (nth 4 event)) (let ((delta (round (cdr (nth 4 event))))) (if (= 0 delta) nil (if (> (abs delta) (window-text-height window t)) (mwheel-scroll event nil) (let ((save-selected-window--state ...)) (save-current-buffer (unwind-protect ... ...)))))) (mwheel-scroll event nil)))
  pixel-scroll-precision((wheel-up (#<window 4 on  *Minibuf-0*> right-fringe (865 . 6) 129226600 nil 1 (0 . 0) nil (11 . 6) (0 . 14)) 1 0 (0.0 . 1.0)))
  funcall-interactively(pixel-scroll-precision (wheel-up (#<window 4 on  *Minibuf-0*> right-fringe (865 . 6) 129226600 nil 1 (0 . 0) nil (11 . 6) (0 . 14)) 1 0 (0.0 . 1.0)))
  command-execute(pixel-scroll-precision)







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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23  6:12 bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil Gerd Möllmann
@ 2022-08-23  7:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-23  9:03   ` Gerd Möllmann
  2022-08-23 11:57 ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-23  7:52 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57349

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
>  appkit-2113.60 Version 12.5.1 (Build 21G83)) of 2022-08-22 built on
>  Mini.fritz.box
> Repository revision: 0c410206aa91b9bc9a0922d63ec34de765eb86a6
> Repository branch: master
> Windowing system distributor 'Apple', version 10.3.2113
> System Description:  macOS 12.5.1
>
> emacs -Q
> M-x pixel-scroll-precision-mode RET
>
> Move the mouse to the lower right corner of the Emacs frame.  On macOS,
> the mouse cursor changes shape to a double-arrow pointing 45 degrees in
> the direction of the upper-left and lower-right corner of the screen.
>
> Scroll the mouse wheel.
>
> This either prints messages like this
>
> <nil> <wheel-up> is undefined
> <nil> <double-wheel-up> is undefined
> <nil> <triple-wheel-up> is undefined [45 times]
> <nil> <wheel-down> is undefined

I think that's the internal border.

> or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.
> Not sure what to make of this.  Looks like posn-at-x-y returns a posn
> with a nil point?  Or maybe posn-point returns nil?

Probably the former.  Could you please see if that error reliably shows
up if you scroll with the mouse pointer over the place where the right
fringe overlaps with the right and bottom internal borders?

Thanks.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23  7:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-23  9:03   ` Gerd Möllmann
  2022-08-23 11:27     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 11+ messages in thread
From: Gerd Möllmann @ 2022-08-23  9:03 UTC (permalink / raw)
  To: Po Lu; +Cc: 57349

Po Lu <luangruo@yahoo.com> writes:

>
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
>>  appkit-2113.60 Version 12.5.1 (Build 21G83)) of 2022-08-22 built on
>>  Mini.fritz.box
>> Repository revision: 0c410206aa91b9bc9a0922d63ec34de765eb86a6
>> Repository branch: master
>> Windowing system distributor 'Apple', version 10.3.2113
>> System Description:  macOS 12.5.1
>>
>> emacs -Q
>> M-x pixel-scroll-precision-mode RET
>>
>> Move the mouse to the lower right corner of the Emacs frame.  On macOS,
>> the mouse cursor changes shape to a double-arrow pointing 45 degrees in
>> the direction of the upper-left and lower-right corner of the screen.
>>
>> Scroll the mouse wheel.
>>
>> This either prints messages like this
>>
>> <nil> <wheel-up> is undefined
>> <nil> <double-wheel-up> is undefined
>> <nil> <triple-wheel-up> is undefined [45 times]
>> <nil> <wheel-down> is undefined
>
> I think that's the internal border.
>
>> or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.
>> Not sure what to make of this.  Looks like posn-at-x-y returns a posn
>> with a nil point?  Or maybe posn-point returns nil?
>
> Probably the former.  Could you please see if that error reliably shows
> up if you scroll with the mouse pointer over the place where the right
> fringe overlaps with the right and bottom internal borders?

I'm not quite sure.

   ...text | fringe | scrollbar | something |
   -------------------- modeline ------------
   ...text | fringe | scrollbar | something |

Sp far, I couldn't produce the error anywhere when the mouse is above
the modeline.  It's just saying that 'nil something' is undefined.

Below the modeline, it's happening when being in 'fringe', 'scrollbar'
'something' AFAICT.  Sorry, it's a hard to move the mouse precisely, and
the rounded edge of the frame doesn't help either.

I think this shows one of the events leading to the error:

  pixel-scroll-precision-scroll-up-page(0)
  pixel-scroll-precision-scroll-up(1)
  pixel-scroll-precision((wheel-up (#<window 4 on  *Minibuf-0*> vertical-scroll-bar (576 . 8) 137763384 nil 1 (81 . 0) nil (576 . 8) (15 . 16)) 1 0 (0.0 . 1.0)))
  funcall-interactively(pixel-scroll-precision (wheel-up (#<window 4 on  *Minibuf-0*> vertical-scroll-bar (576 . 8) 137763384 nil 1 (81 . 0) nil (576 . 8) (15 . 16)) 1 0 (0.0 . 1.0)))
  command-execute(pixel-scroll-precision)








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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23  9:03   ` Gerd Möllmann
@ 2022-08-23 11:27     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-23 12:17       ` Gerd Möllmann
  0 siblings, 1 reply; 11+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-23 11:27 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57349

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>>
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>
>>> In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
>>>  appkit-2113.60 Version 12.5.1 (Build 21G83)) of 2022-08-22 built on
>>>  Mini.fritz.box
>>> Repository revision: 0c410206aa91b9bc9a0922d63ec34de765eb86a6
>>> Repository branch: master
>>> Windowing system distributor 'Apple', version 10.3.2113
>>> System Description:  macOS 12.5.1
>>>
>>> emacs -Q
>>> M-x pixel-scroll-precision-mode RET
>>>
>>> Move the mouse to the lower right corner of the Emacs frame.  On macOS,
>>> the mouse cursor changes shape to a double-arrow pointing 45 degrees in
>>> the direction of the upper-left and lower-right corner of the screen.
>>>
>>> Scroll the mouse wheel.
>>>
>>> This either prints messages like this
>>>
>>> <nil> <wheel-up> is undefined
>>> <nil> <double-wheel-up> is undefined
>>> <nil> <triple-wheel-up> is undefined [45 times]
>>> <nil> <wheel-down> is undefined
>>
>> I think that's the internal border.
>>
>>> or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.
>>> Not sure what to make of this.  Looks like posn-at-x-y returns a posn
>>> with a nil point?  Or maybe posn-point returns nil?
>>
>> Probably the former.  Could you please see if that error reliably shows
>> up if you scroll with the mouse pointer over the place where the right
>> fringe overlaps with the right and bottom internal borders?
>
> I'm not quite sure.
>
>    ...text | fringe | scrollbar | something |
>    -------------------- modeline ------------
>    ...text | fringe | scrollbar | something |
>
> Sp far, I couldn't produce the error anywhere when the mouse is above
> the modeline.  It's just saying that 'nil something' is undefined.
>
> Below the modeline, it's happening when being in 'fringe', 'scrollbar'
> 'something' AFAICT.  Sorry, it's a hard to move the mouse precisely, and
> the rounded edge of the frame doesn't help either.
>
> I think this shows one of the events leading to the error:
>
>   pixel-scroll-precision-scroll-up-page(0)
>   pixel-scroll-precision-scroll-up(1)
>   pixel-scroll-precision((wheel-up (#<window 4 on  *Minibuf-0*> vertical-scroll-bar (576 . 8) 137763384 nil 1 (81 . 0) nil (576 . 8) (15 . 16)) 1 0 (0.0 . 1.0)))
>   funcall-interactively(pixel-scroll-precision (wheel-up (#<window 4 on  *Minibuf-0*> vertical-scroll-bar (576 . 8) 137763384 nil 1 (81 . 0) nil (576 . 8) (15 . 16)) 1 0 (0.0 . 1.0)))
>   command-execute(pixel-scroll-precision)

That's pretty odd, I can't reproduce the problem at all.  The next time
I get access to a Mac (it may be a while) I will see if it can be
reproduced there.

Thanks.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23  6:12 bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil Gerd Möllmann
  2022-08-23  7:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-23 11:57 ` Eli Zaretskii
  2022-08-23 12:15   ` Gerd Möllmann
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2022-08-23 11:57 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57349

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Date: Tue, 23 Aug 2022 08:12:54 +0200
> 
> emacs -Q
> M-x pixel-scroll-precision-mode RET
> 
> Move the mouse to the lower right corner of the Emacs frame.  On macOS,
> the mouse cursor changes shape to a double-arrow pointing 45 degrees in
> the direction of the upper-left and lower-right corner of the screen.
> 
> Scroll the mouse wheel.
> 
> This either prints messages like this
> 
> <nil> <wheel-up> is undefined
> <nil> <double-wheel-up> is undefined
> <nil> <triple-wheel-up> is undefined [45 times]
> <nil> <wheel-down> is undefined

It may surprise this, but why do you think this is a problem?  How is
it different from what happens if you do this, for example:

  C-M-<F10>

(assuming that sequence is not bound to some command)?

> or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.

This shouldn't happen, indeed.

> Not sure what to make of this.  Looks like posn-at-x-y returns a posn
> with a nil point?  Or maybe posn-point returns nil?

Either this should be fixed, or the code should be prepared for nil in
this case.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23 11:57 ` Eli Zaretskii
@ 2022-08-23 12:15   ` Gerd Möllmann
  2022-08-23 12:36     ` Gerd Möllmann
  2022-08-23 12:36     ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Gerd Möllmann @ 2022-08-23 12:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57349

Eli Zaretskii <eliz@gnu.org> writes:

>> <nil> <wheel-down> is undefined
>
> It may surprise this, but why do you think this is a problem?  How is
> it different from what happens if you do this, for example:
>
>   C-M-<F10>
>
> (assuming that sequence is not bound to some command)?

I mentioned it only because I thought it might have been relevant in
some way.  One never knows.

>> or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.
>
> This shouldn't happen, indeed.
>
>> Not sure what to make of this.  Looks like posn-at-x-y returns a posn
>> with a nil point?  Or maybe posn-point returns nil?
>
> Either this should be fixed, or the code should be prepared for nil in
> this case.

Yup.

I could add a check in the function that does the (goto-char nil), but I
don't know if that would be only fixing a symptom of something else.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23 11:27     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-23 12:17       ` Gerd Möllmann
  0 siblings, 0 replies; 11+ messages in thread
From: Gerd Möllmann @ 2022-08-23 12:17 UTC (permalink / raw)
  To: Po Lu; +Cc: 57349

Po Lu <luangruo@yahoo.com> writes:

> That's pretty odd, I can't reproduce the problem at all.  The next time
> I get access to a Mac (it may be a while) I will see if it can be
> reproduced there.

Ok, thanks.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23 12:15   ` Gerd Möllmann
@ 2022-08-23 12:36     ` Gerd Möllmann
  2022-08-23 12:46       ` Eli Zaretskii
  2022-08-23 12:36     ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Gerd Möllmann @ 2022-08-23 12:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57349

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> I could add a check in the function that does the (goto-char nil), but I
> don't know if that would be only fixing a symptom of something else.

I just had an idea.  What if this deoends on the mini-window.  One of
the functions signalling looks like this:

(defun pixel-scroll-precision-scroll-up-page (delta)
  "Scroll the current window up by DELTA pixels.
Note that this function doesn't work if DELTA is larger than
the height of the current window."
  (let* ((edges (window-edges nil t nil t))
         (max-y (- (nth 3 edges)
                   (nth 1 edges)))
         (usable-height max-y)
         (posn (posn-at-x-y 0 (+ (window-tab-line-height)
                                 (window-header-line-height)
                                 (- max-y delta))))
         (point (posn-point posn))
         (up-point (save-excursion
                     (goto-char point)
                     ^^^ here point is nil
                     (vertical-motion (- (1+ scroll-margin)))
                     (point))))

The documentation of window-edges says it is using the selected window
when its window argument is nil.  The selected window can't be the
mini-window unless the minibuffer is active.

And indeed, when I enter the minibuffer (M-:), and mouse-wheel as
descibed before, no error occurs.

Does that sound plausible?






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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23 12:15   ` Gerd Möllmann
  2022-08-23 12:36     ` Gerd Möllmann
@ 2022-08-23 12:36     ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2022-08-23 12:36 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57349

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 57349@debbugs.gnu.org
> Date: Tue, 23 Aug 2022 14:15:59 +0200
> 
> >> or sometimes errors 'Wrong type argument: integer-or-marker-p, nil'.
> >
> > This shouldn't happen, indeed.
> >
> >> Not sure what to make of this.  Looks like posn-at-x-y returns a posn
> >> with a nil point?  Or maybe posn-point returns nil?
> >
> > Either this should be fixed, or the code should be prepared for nil in
> > this case.
> 
> Yup.
> 
> I could add a check in the function that does the (goto-char nil), but I
> don't know if that would be only fixing a symptom of something else.

I don't think it's reasonable to expect that posn-WHATEVER functions
will always return a valid buffer position.  There are parts on the
window/frame decorations where no buffer position makes sense.  We
sometimes forcibly put some close position there, or get it as a side
effect of the implementation, but I don't think we should rely on it.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23 12:36     ` Gerd Möllmann
@ 2022-08-23 12:46       ` Eli Zaretskii
  2022-08-23 13:59         ` Gerd Möllmann
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2022-08-23 12:46 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: 57349

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 57349@debbugs.gnu.org
> Date: Tue, 23 Aug 2022 14:36:52 +0200
> 
> The documentation of window-edges says it is using the selected window
> when its window argument is nil.  The selected window can't be the
> mini-window unless the minibuffer is active.
> 
> And indeed, when I enter the minibuffer (M-:), and mouse-wheel as
> descibed before, no error occurs.
> 
> Does that sound plausible?

It does to me.





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

* bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil
  2022-08-23 12:46       ` Eli Zaretskii
@ 2022-08-23 13:59         ` Gerd Möllmann
  0 siblings, 0 replies; 11+ messages in thread
From: Gerd Möllmann @ 2022-08-23 13:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 57349

Eli Zaretskii <eliz@gnu.org> writes:

>> Does that sound plausible?
>
> It does to me.

Thanks.  Pushed to master.

FYI, I also stumbled into an infloop with the 1 line high mini-window,
which should also be fixed.





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

end of thread, other threads:[~2022-08-23 13:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23  6:12 bug#57349: 29.0.50; pixel-scroll-precision-mode. error integer-or-marker-p nil Gerd Möllmann
2022-08-23  7:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-23  9:03   ` Gerd Möllmann
2022-08-23 11:27     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-23 12:17       ` Gerd Möllmann
2022-08-23 11:57 ` Eli Zaretskii
2022-08-23 12:15   ` Gerd Möllmann
2022-08-23 12:36     ` Gerd Möllmann
2022-08-23 12:46       ` Eli Zaretskii
2022-08-23 13:59         ` Gerd Möllmann
2022-08-23 12:36     ` Eli Zaretskii

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).