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: Sat, 24 Aug 2019 19:37:11 +0200 Message-ID: <20190824173711.GG11684@protected.rcdrun.com> References: <20190824141421.GB11116@protected.rcdrun.com> <20190824145512.GA11684@protected.rcdrun.com> <83h866iopc.fsf@gnu.org> <20190824155103.GB11684@protected.rcdrun.com> <83ef1ailw5.fsf@gnu.org> <20190824164439.GC11684@protected.rcdrun.com> <83blweijtt.fsf@gnu.org> <83a7byijji.fsf@gnu.org> <20190824171711.GF11684@protected.rcdrun.com> <837e72iikb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="189877"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: GNU Emacs Help To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 24 19:37:36 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 1i1Zyq-000nFd-L1 for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Aug 2019 19:37:36 +0200 Original-Received: from localhost ([::1]:38878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1Zyo-0002hO-QH for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Aug 2019 13:37:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43383) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1ZyZ-0002gx-Oq for help-gnu-emacs@gnu.org; Sat, 24 Aug 2019 13:37:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1ZyX-0004fi-Mr for help-gnu-emacs@gnu.org; Sat, 24 Aug 2019 13:37:19 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:50819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i1ZyW-0004UC-93; Sat, 24 Aug 2019 13:37:16 -0400 Original-Received: from protected.rcdrun.com ([::ffff:31.223.149.228]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000320E9.000000005D6175C8.000058A9; Sat, 24 Aug 2019 10:37:12 -0700 Original-Received: from localhost (localhost [127.0.0.1]) (uid 1001) by protected.rcdrun.com with local id 00000000000C9452.000000005D6175C7.0000389F; Sat, 24 Aug 2019 19:37:11 +0200 Content-Disposition: inline In-Reply-To: <837e72iikb.fsf@gnu.org> X-Mime-Autoconverted: from 8bit to quoted-printable by courier 1.0.6 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:121378 Archived-At: * Eli Zaretskii [2019-08-24 19:24]: > > Date: Sat, 24 Aug 2019 19:17:11 +0200 > > From: Jean Louis > > Cc: help-gnu-emacs@gnu.org > >=20 > > > > > =C2=A7 emacsclient "file" > > > > >=20 > > > > > it works here inside of M-x shell where it says "Waiting for > > > > > Emacs..." > > > > >=20 > > > > > So I can launch emacsclient from shell within Emacs with waitin= g > > > > > stage. > > > >=20 > > > > Yes, but this won't get you anywhere past the waiting stage, beca= use > > > > there's no Emacs server that can serve the emacsclient's request. > > >=20 > > > Actually, you know what: it will work. So if you insist on doing i= t > > > via emacsclient, go ahead and do it via the shell buffer. > >=20 > > I have strong feeling that it can work. Please give me better > > specification. Which function you propose? >=20 > I don't understand the question. I thought you have already figured > everything out for doing this via emacsclient. Otherwise, why did you > keep asking about emacsclient all the time? I have three possible directions to solve that: - use recursive-edit, if it would not interrupt while calling emacsclient in the same time, is that a bug? - use simple editing of buffer with kill-buffer-hook, if I can come back to initial program execution, as program execution must be wait for editing to finish, I do not know how - use emacsclient from external program somehow, provided that I can wait for it to finish Jean