Subject: Re: bug#67341: 29.1.90; Open frame on display doesn't work in wayland

From: Eli Zaretskii <[email-masked]>
Date: Thu, 30 Nov 2023 08:23:50 +0200

> From: Phillip Susi <[email-masked]>
> Cc: [email-masked]
> Date: Wed, 29 Nov 2023 15:42:02 -0500
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Can you step in Edebug through make-frame-on-display and make-frame,
> > and try to figure out how come wayland-2 becomes wayland-1, during the
> > processing of the command?
> 
> I've never tried using the emacs debugger before, but I managed to get
> it to enter debug on entry to make-frame-on-display, and had to hit 'd'
> to step through it a LOT.  I only ever saw "wayland-2", never
> "wayland-1".  There were a bunch of window on "Minibuf-0".

I meant Edebug, not the basic debugger.  Edebug is easier to use, and
it is fully documented in the ELisp manual.

Something like the below should get you started:

  emacs -Q
  M-x load-library RET frame.el RET
  C-x C-f /path/to/lisp/frame.el RET
  C-s defun make-frame ( RET
  M-x edebug-defun RET
  M-x make-frame-on-display RET wayland-2 RET

Now you should see Edebug kick in: Emacs will show the make-frame
function with a little arrow on the fringe to the left of the
beginning of its code.  You can press SPC to step through the code.
Step like that until you get to this part:

    (setq frame (let ((window-system w)) ; Hack attack!
                  (frame-creation-function params)))

and tell the value of 'params' passed to frame-creation-function (the
value will be shown in the echo-area when the cursor is just after
"params").

Let me know if you need more help with Edebug.

Thanks.