all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Trent W. Buck" <trentbuck@gmail.com>
Cc: 65332@debbugs.gnu.org
Subject: bug#65332: 29.1; browse-url calls pgtk-backend-display-class, which errors when window-system is nil
Date: Wed, 16 Aug 2023 15:14:46 +0800	[thread overview]
Message-ID: <87r0o3jw61.fsf@yahoo.com> (raw)
In-Reply-To: <f4f4e71688f63cf656ee653bdfae325c.trentbuck@gmail.com> (Trent W. Buck's message of "Wed, 16 Aug 2023 15:45:38 +1000")

"Trent W. Buck" <trentbuck@gmail.com> writes:

> Minimum recipe to reproduce:
>
>   1. Get emacs with pgtk, start daemon, connect to it from a tty frame:
>
>         twb@hera[Desktop]$ emacs-pgtk --version
>         GNU Emacs 29.1
>         Copyright (C) 2023 Free Software Foundation, Inc.
>         GNU Emacs comes with ABSOLUTELY NO WARRANTY.
>         You may redistribute copies of GNU Emacs
>         under the terms of the GNU General Public License.
>         For more information about these matters, see the file named COPYING.
>
>         twb@hera[Desktop]$ emacs-pgtk --quick --daemon
>         Due to a limitation in GTK 3, Emacs built with PGTK will simply exit when a
>         display connection is closed.  The problem is especially difficult to fix,
>         such that Emacs on Wayland with multiple displays is unlikely ever to be able
>         to survive disconnects.
>         Starting Emacs daemon.
>
>         twb@hera[Desktop]$ emacsclient --create-frame --tty
>
>   2. M-x browse url RET https://example.com RET
>
>      Get this error:
>
>          Frames are not in use or not initialized
>
>   3. Explicitly setting browse-url-browser-function to eww-browse-url does not help.
>
> With toggle-debug-on-error, the backtrace I got during normal usage was:
>
>     Debugger entered--Lisp error: (error "Frames are not in use or not initialized")
>       browse-url("http://ix.io/4DCN")
>       find-file-at-point()
>       ido-file-internal(selected-window)
>       ido-find-file()
>       funcall-interactively(ido-find-file)
>       command-execute(ido-find-file)
>
> The problem is it's calling (pgtk-backend-display-class) even when the current frame isn't a GTK frame, I think?
>
>     ELISP> (browse-url "https://example.com")
>     *** Eval error ***  Frames are not in use or not initialized
>     ELISP> (w3m-browse-url "https://example.com")
>     nil
>     ELISP> browse-url-browser-function
>     w3m-browse-url
>     ELISP> (pgtk-backend-display-class)
>     *** Eval error ***  Frames are not in use or not initialized
>     ELISP> window-system
>     nil
>     ELISP> (frame-parameter nil 'display)
>     ":0"
>     ELISP> (getenv "DISPLAY")
>     ":0"
>     ELISP> (getenv "WAYLAND_DISPLAY")
>     "wayland-0"

Your analysis of the problem is correct.

But to correct it, we need to know what display our users expect the
browser window to open in under such a situation?





      reply	other threads:[~2023-08-16  7:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  5:45 bug#65332: 29.1; browse-url calls pgtk-backend-display-class, which errors when window-system is nil Trent W. Buck
2023-08-16  7:14 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0o3jw61.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65332@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=trentbuck@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.