emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/emacsql ed86b098ce 197/427: Add prefix arg to emacsql-show


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql ed86b098ce 197/427: Add prefix arg to emacsql-show-last-sql.
Date: Tue, 13 Dec 2022 02:59:41 -0500 (EST)

branch: elpa/emacsql
commit ed86b098ce341997058e6fa4c06a84c96ed7ee2d
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Add prefix arg to emacsql-show-last-sql.
---
 emacsql.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/emacsql.el b/emacsql.el
index 623c340a25..e8f4a36a02 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -272,9 +272,13 @@ A statement can be a list, containing a statement with its 
arguments."
                                     collect (intern (format "$%d" i))))))
 
 ;;;###autoload
-(defun emacsql-show-last-sql ()
-  "Display the compiled SQL of the s-expression SQL expression before point."
-  (interactive)
-  (emacsql-show-sql (emacsql-flatten-sql (preceding-sexp))))
+(defun emacsql-show-last-sql (&optional prefix)
+  "Display the compiled SQL of the s-expression SQL expression before point.
+A prefix argument causes the SQL to be printed into the current buffer."
+  (interactive "P")
+  (let ((sql (emacsql-flatten-sql (preceding-sexp))))
+    (if prefix
+        (insert sql)
+      (emacsql-show-sql ))))
 
 ;;; emacsql.el ends here



reply via email to

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