Subject: Re: bug#33690: 26.1; Wrong type argument: number-or-marker-p, nil in window-edges

From: "Pascal J. Bourguignon" <[email-masked]>
Date: Mon, 10 Dec 2018 11:05:27 +0100

You’re right, I have been overriding this frame-internal-border-width function from a macro defining functions for all the frame parameters. I’m changing the name used now.  You may close the bug report; sorry.

On 10 Dec 2018, at 08:01, Eli Zaretskii <[email-masked]> wrote:

>> From: "Pascal J. Bourguignon" <[email-masked]>
>> Date: Sun, 09 Dec 2018 22:34:12 +0100
>> 
>> 
>> Launching emacs in a terminal (DISPLAY=:0.0, but no X server running),
>> including my .emacs, I get 
>> Wrong type argument: number-or-marker-p, nil in window-edges
>> errors on C-n and C-p.
>> The error come from window-edges.
>> 
>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>>  window-edges(nil t nil t)
>>  window-inside-pixel-edges()
>>  window-screen-lines()
>>  line-move-partial(1 nil)
>>  line-move(1 nil nil 1)
>>  next-line(1 1)
>>  funcall-interactively(next-line 1 1)
>>  call-interactively(next-line nil nil)
>>  command-execute(next-line)
>> 
>> Running with a window-edges not compiled, we find that the problem is
>> that border-width is nil. I would therefore suggest to patch
>> window-edges, to use 0 when frame-internal-border-width returns nil
>> (which occurs when running in a terminal):
> 
> I don't understand.  The definition of frame-internal-border-width is
> this:
> 
>  DEFUN ("frame-internal-border-width", Fframe_internal_border_width, Sframe_internal_border_width, 0, 1, 0,
>     doc: /* Return width of FRAME's internal border in pixels.  */)
>    (Lisp_Object frame)
>  {
>    return make_number (FRAME_INTERNAL_BORDER_WIDTH (decode_any_frame (frame)));
>  }
> 
> This can only return numbers, never nil, even when we are on a text
> terminal.  Are you sure you don't override this definition with some
> local code?
> 
> Thanks.