help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to reliably edit a file from within Emacs Lisp and return a stri


From: Eli Zaretskii
Subject: Re: How to reliably edit a file from within Emacs Lisp and return a string?
Date: Sat, 24 Aug 2019 19:55:58 +0300

> Date: Sat, 24 Aug 2019 18:44:39 +0200
> From: Jean Louis <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> 
> * Eli Zaretskii <eliz@gnu.org> [2019-08-24 18:12]:
> > Is the program iterating over the fields in some predefined order?
> 
> I can choose which field to edit, like using helm and then choosing a
> field to edit. But more often I keep it without helm. There is
> completing-read. And I have choices like to choose what to edit, then
> it comes back.
> 
> > Also, are you feeding back each field individually, or do you need to
> > have them all edited before feeding them back as a single record?
> 
> Each field individually.

Then I don't understand the difficulty.  You already have a loop that
goes over the fields one by one, right?  So, for each field let the
user edit it, then feed the result back to the database, and continue
to the next field.  The "feed back to the database" part can be done
from a function called by kill-buffer-hook, and it will be triggered
by the user killing the edit buffer once he/she is done editing.

What is missing from this idea to make it work for your program?

> M-x shell
> 
> ยง emacsclient "file"
> 
> it works here inside of M-x shell where it says "Waiting for
> Emacs..."
> 
> So I can launch emacsclient from shell within Emacs with waiting
> stage.

Yes, but this won't get you anywhere past the waiting stage, because
there's no Emacs server that can serve the emacsclient's request.  I
thought I explained that earlier.  You cannot do that via emacsclient,
when the server is in the same Emacs which invoked emacsclient.  It
doesn't matter how you invoke emacsclient from Emacs, you cannot have
its request served within that same Emacs session.

Moreover: you don't need it.  You have all of Emacs already at your
server; why would you want to ask it to edit something via an outside
client??



reply via email to

[Prev in Thread] Current Thread [Next in Thread]