branch: elpa/emacsql commit 8fa7c00978882d9c7c41897ba53f2e7bd949718b Author: Christopher Wellons <well...@nullprogram.com> Commit: Christopher Wellons <well...@nullprogram.com>
Add sentinel cleanup to psql. --- emacsql-psql.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/emacsql-psql.el b/emacsql-psql.el index adac77bc99..008eb8334c 100644 --- a/emacsql-psql.el +++ b/emacsql-psql.el @@ -50,14 +50,17 @@ :process process :dbname dbname))) (prog1 connection + (setf (process-sentinel process) + (lambda (_proc _) (kill-buffer buffer))) (emacsql-register connection) - (emacsql-send-string connection "\\pset pager off") - (emacsql-send-string connection "\\pset null nil") - (emacsql-send-string connection "\\a") - (emacsql-send-string connection "\\t") - (emacsql-send-string connection "\\f ' '") - (emacsql-send-string connection "\\set PROMPT1 ]") - (emacsql-send-string connection "EMACSQL;") ; error message flush + (mapc (apply-partially #'emacsql-send-string connection) + '("\\pset pager off" + "\\pset null nil" + "\\a" + "\\t" + "\\f ' '" + "\\set PROMPT1 ]" + "EMACSQL;")) ; error message flush (emacsql-wait connection))))) (defmethod emacsql-close ((connection emacsql-psql-connection))