From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51658: [PATCH] Haiku port (again) Date: Sun, 14 Nov 2021 12:28:22 +0200 Message-ID: <83ilwvuj3t.fsf@gnu.org> References: <87ee7surtv.fsf.ref@yahoo.com> <87ee7surtv.fsf@yahoo.com> <83mtmd43fa.fsf@gnu.org> <87ilx0yj52.fsf@yahoo.com> <83czn8424l.fsf@gnu.org> <87o86s41at.fsf@yahoo.com> <83tugk2iuy.fsf@gnu.org> <871r3n4jvd.fsf@yahoo.com> <835ysz2niq.fsf@gnu.org> <87sfw3w372.fsf@yahoo.com> <83zgq7x5zj.fsf@gnu.org> <87r1bjlf26.fsf@yahoo.com> <83wnlbuq7p.fsf@gnu.org> <877ddb6pvi.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4931"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51658@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 14 11:29:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmCl9-0000wO-N1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 11:29:15 +0100 Original-Received: from localhost ([::1]:47564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmCl3-0001uO-1C for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 05:29:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCkw-0001uE-MZ for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:29:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmCkw-0008Ey-EN for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmCkw-0004je-B2 for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 05:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Nov 2021 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51658-submit@debbugs.gnu.org id=B51658.163688572318174 (code B ref 51658); Sun, 14 Nov 2021 10:29:02 +0000 Original-Received: (at 51658) by debbugs.gnu.org; 14 Nov 2021 10:28:43 +0000 Original-Received: from localhost ([127.0.0.1]:49235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmCkd-0004j4-5p for submit@debbugs.gnu.org; Sun, 14 Nov 2021 05:28:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmCkb-0004is-Rn for 51658@debbugs.gnu.org; Sun, 14 Nov 2021 05:28:42 -0500 Original-Received: from [2001:470:142:3::e] (port=50222 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCkW-0008E2-KX; Sun, 14 Nov 2021 05:28:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oGPsloJTwb5vyUQq4rzV0Rp7wXdY/hJwkB2Lk2Px77s=; b=ex0f0FKi0lXb 3WtvsXz1+O148OQI+qeoXU4m+WlFxx64gNF+aMThq3b8QhOzdfZaguajWIXE9amo/1W8YFvsKwhPS DsDqQmgOtEhFljFatpujzFbNjrZe54O21vq/co2k6LOT7MTkY/GgzhOHHaF7Q/5O6mk1c9p/J8GCQ JYKdapy9mFit6DMvtM5q0gx4Bniz8gQGYPmOU5K+Yg6DMTwZXLZBcWzNMtq+zVje8GFYoDyO9nZ5C rjBHbd5kdfte7ChHesZ5LRUnuHP9RMKJJmpeeDkmSF0biULsQT4k8mlYkYlI2GHZWzfQY+RMLdPiw /HprWBWcZUAlSO1+s+2TKQ==; Original-Received: from [87.69.77.57] (port=4597 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmCkV-00072l-Jn; Sun, 14 Nov 2021 05:28:36 -0500 In-Reply-To: <877ddb6pvi.fsf@yahoo.com> (message from Po Lu on Sun, 14 Nov 2021 17:36:01 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219922 Archived-At: > From: Po Lu > Cc: 51658@debbugs.gnu.org > Date: Sun, 14 Nov 2021 17:36:01 +0800 > > >> > Why isn't this treated as drag-and-drop on other platforms? Then you > >> > won't need Haiku-specific documentation and events. > >> > >> It might not specifically be a drag event: for example, the Tracker > >> could ask Emacs to open a file, because the user selected it from the > >> "Recent files" menu. > > > The result is the same: Emacs visits a file. I don't think I > > understand why these events should be exposed to Lisp. > > But drag-n-drop events have a POSITION argument, while a position isn't > available when the system sends Emacs a B_REFS_FOUND message. How is POSITION used? Can't you fake POSITION, so we get the same event as on other platforms? > > Which part is specific to X? > > The entire file is preconditioned on HAVE_X_SM, and is based on things > such as `SmcInteractDone' that only make sense on X. > > It also relies on functions like `emacs-session-save', which are in > x-win.el and rely on X specific code. > > > And if the current implementation uses X-specific code, it just means > > the implementation should be extended to allow other platforms trigger > > the same mechanism. Any reason Haiku couldn't do that? > > Haiku doesn't have a session manager, so it doesn't make sense to use > the mechanism in xsmfns.c: the system doesn't try to restore Emacs when > the system restarts, or to save Emacs's session information when it > quits. > > It tells the application that it's about to quit as a courtesy, so it > can perhaps run a few popup dialogs informing the user to save his > files. Every modern system has something similar, so it would make sense to have a unified mechanism for handling those system messages in Emacs. If xsmfns.c is too X-specific, we should build a layer above it, and then implement th lower layer for Haiku. It makes no sense to me to introduce new events for specific platforms when similar features already exist and just need to be extended or abstracted.