From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to reliably edit a file from within Emacs Lisp and return a string? Date: Fri, 23 Aug 2019 00:46:04 +0200 Message-ID: <20190822224604.GA10900@protected.rcdrun.com> References: <20190822213103.GA26548@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="143670"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: GNU Emacs Help To: Noam Postavsky Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 23 00:46:37 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0vqm-000bHL-Rx for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Aug 2019 00:46:36 +0200 Original-Received: from localhost ([::1]:48468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0vqk-0008Qw-U0 for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Aug 2019 18:46:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50341) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0vqL-0008MI-OP for help-gnu-emacs@gnu.org; Thu, 22 Aug 2019 18:46:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0vqK-0000H6-NV for help-gnu-emacs@gnu.org; Thu, 22 Aug 2019 18:46:09 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:33353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i0vqK-0000G7-EA for help-gnu-emacs@gnu.org; Thu, 22 Aug 2019 18:46:08 -0400 Original-Received: from protected.rcdrun.com ([::ffff:31.223.149.45]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000320ED.000000005D5F1B2E.0000098D; Thu, 22 Aug 2019 15:46:06 -0700 Original-Received: from localhost (localhost [127.0.0.1]) (uid 1001) by protected.rcdrun.com with local id 00000000000C9452.000000005D5F1B2C.00002AB6; Fri, 23 Aug 2019 00:46:04 +0200 Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.170.207.13 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121346 Archived-At: * Noam Postavsky [2019-08-23 00:03]: > On Thu, 22 Aug 2019 at 17:31, Jean Louis wrote: > > killing the buffer is also not > > conclusive for Emacs Lisp, > > Why do you say that? I cannot conclusively know and I do not know how to know it, from within Emacs Lisp, that a buffer has been killed. Function `find-file' finishes as soon as file is opened, just as you said. > > basically from within Emacs Lisp, how can I know that find-file > > has finished its job, that buffer has been closed, so that I can > > read the string? > > find-file finishes as soon as the buffer is opened. It sounds like > you want to know when the user is finished with the file; the user > has to tell you somehow (e.g., by killing the buffer). Yes. I need to be able to run function that waits on the buffer to be killed, so that I can read string from the file that related to the buffer. Do you know how to do it? Jean