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 18:10:39 +0300

> Date: Sat, 24 Aug 2019 16:55:12 +0200
> From: Jean Louis <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> 
> > (defun edit-db-field-value (table field type id value file)
> >   (string-to-file-force value file)
> >   (let* ((buffer (create-file-buffer file)))
> >     (switch-to-buffer buffer)
> >     (set-visited-file-name file)
> >     (insert value)
> >     (add-hook 'kill-buffer-hook `(lambda ()
> >                               (let ((new-value (file-to-string ,file)))
> >                                 (rcd-db-update-entry ,table ,field ,type 
> > ,id new-value)))
> >           0 t)))
> > 
> 
> I was just thinking it is solved, but it does not solves anything but
> that string can be read into the file.
> 
> However, that way program execution does not continue. There is no
> waiting loop or something like that.
> 
> It just makes sure that one field is read back into string.

So now you need to take that string and feed it back into the
database, right?  So why are you saying this is not the solution?
What else is missing?



reply via email to

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