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: Jean Louis
Subject: Re: How to reliably edit a file from within Emacs Lisp and return a string?
Date: Sat, 24 Aug 2019 16:55:12 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

* Jean Louis <bugs@gnu.support> [2019-08-24 16:15]:
> Thank you, it is solved!
> 
> Jean
> 
> (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.

Very sad...
Jean



reply via email to

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