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.devel Subject: Re: Documentation fix Date: Sat, 08 Apr 2023 18:37:52 +0300 Message-ID: <83lej2mlkf.fsf@gnu.org> References: <871qkvq4o4.fsf.ref@yahoo.com> <871qkvq4o4.fsf@yahoo.com> <83ttxroph8.fsf@gnu.org> <87wn2nolt1.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9262"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 08 17:38:09 2023 Return-path: Envelope-to: ged-emacs-devel@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 1plAdl-0002Ch-0Y for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Apr 2023 17:38:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plAcz-00086W-Io; Sat, 08 Apr 2023 11:37:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plAcx-00086M-0q for emacs-devel@gnu.org; Sat, 08 Apr 2023 11:37:19 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plAcw-0002Xw-Ne; Sat, 08 Apr 2023 11:37:18 -0400 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=OnKBGFUR8H1MuQwo0GIJ1Hv1fMGalW3JJ8G3rYQMr18=; b=WXFFkeuo1+xc ZCTMq7DQMCS2KEc2d+jnv3F7FBX8hOQQXF+aphbioyYLQvl1ybRjVPlR77K8+6QlkangBLHUBWWST YCybTyIcYiATXNXgGDVLURTkkB4cNjGUsGrQ0qsqprFCiodHTBVVeHikc5ia8OlHYZnBcIszgsyKw DrWaikoKGiZsANKjUhOp+pk4JrZwQVOInUlxWi9eUD0HIlyylOuxXR+SCkskgH2A0IOHMI3Hr9di8 01froxcGNr0RDE/wA4HEKQqC94hV0xaRxMPoa9kV9hPwpHuxTTjvMfOE8FO0ZYQ/zFVa3TXPArR5l ZS/+ZfD3ECRHRsNE5zVE/Q==; Original-Received: from [87.69.77.57] (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 1plAcv-0005rp-Uu; Sat, 08 Apr 2023 11:37:18 -0400 In-Reply-To: <87wn2nolt1.fsf@yahoo.com> (message from Po Lu on Fri, 07 Apr 2023 21:37:30 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305189 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Fri, 07 Apr 2023 21:37:30 +0800 > > Eli Zaretskii writes: > > > Does this mean the function gets on the basename of the file, without > > any leading directories? Or does it mean something else? > > Yes. > > >> + The function should return the complete file name under which the > >> +file should be saved, including the directory where it should be > >> +saved, under which Emacs will ask the other program to save the file. > > > > How would the function know what is the "right" directory to save the > > file? Without some hints to that effect, this documentation is not > > very useful, IMO. > > How about: > > For example, a function defined for Dired buffers may want to return > the directory containing the file under the position of the drop. > > >> + If the file was successfully saved, > > > > And if not? > > Emacs never gets a reply from the program performing the drop, and thus > cannot do anything. > > >> the function is called again, > >> +this time with the first argument set to @code{nil}, and the second > >> +argument set to the file name that was returned. The function should > >> +then perform whatever action is appropriate (i.e., opening the file or > >> +refreshing a directory listing.) ^^^^ > > > > I guess, you mean "e.g." there. > > Yes, sorry. > > > More importantly, I don't understand why would Emacs need to do > > anything with the file at all. As a matter of fact, I don't think I > > understand the purpose of this protocol at all, and I don't see it > > clarified in the manual. Can you explain what is this used for? > > Without such explanation, this documentation lacks context without > > which the information makes no sense. > > It allows a program to drop files into a file manager, such as Dired, > and directly save the file into the directory that is currently open in > the file manager's window. > > This is a three-step process: > > 1. The program performing the drop sends the name of a file to Emacs, > such as gen_sqrtab.c. > > 2. Emacs replies with the file name under which the file should be > saved. If it's dropped on top of a Dired buffer visiting > /export/home/user/Documents, for example, Emacs should reply with > /export/home/user/Documents/gen_sqrtab.c. > > 3. If saving the file is successful, the program performing the drop > notifies Emacs, at which point the Dired buffer is reverted. > > This protocol is mainly supported by web browsers and GTK based file > managers, and now Emacs as well. Thanks. I rewrote the documentation of the XDS support, please take a look and tell if I made any mistakes.