emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Don't print arguments of post-process arguments to stdout
@ 2022-10-06 11:43 Jonas Bernoulli
  2022-10-06 11:43 ` [PATCH 1/2] " Jonas Bernoulli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonas Bernoulli @ 2022-10-06 11:43 UTC (permalink / raw)
  To: emacs-orgmode

I run org-babel-execute-buffer from a Makefile and the output is quite
noisy, forcing me to filter out some output using grep -v so that I am
still able to spot any unexpected output that indicates some issue.

Now that I have started using post-processing code blocks, the output
has gotten even more noisy and unfortunately filtering out the unwanted
additions is not possible.

Currently all arguments to post-processing blocks are printed to
stdout.  I am not able to filter them out using grep because this
output seems to be split across multiple lines, so a regexp like
"^(" only matches parts of the noise.

It is unclear whether the arguments were printed on purpose.  It might
be useful to do so at times for debugging purposes, but generally they
make things harder, by obscuring output one would want to notice.

The second commit addresses a cosmetic, but somewhat related,
annoyance.

Jonas Bernoulli (2):
  Don't print arguments of post-process arguments to stdout
  Begin messages about executing code blocks with a capital letter

 lisp/ob-awk.el        | 2 +-
 lisp/ob-core.el       | 2 +-
 lisp/ob-emacs-lisp.el | 2 +-
 lisp/ob-groovy.el     | 2 +-
 lisp/ob-maxima.el     | 2 +-
 lisp/ob-sed.el        | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.37.3



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] Don't print arguments of post-process arguments to stdout
  2022-10-06 11:43 [PATCH 0/2] Don't print arguments of post-process arguments to stdout Jonas Bernoulli
@ 2022-10-06 11:43 ` Jonas Bernoulli
  2022-10-06 11:43 ` [PATCH 2/2] Begin messages about executing code blocks with a capital letter Jonas Bernoulli
  2022-10-07  5:55 ` [PATCH 0/2] Don't print arguments of post-process arguments to stdout Ihor Radchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Jonas Bernoulli @ 2022-10-06 11:43 UTC (permalink / raw)
  To: emacs-orgmode

It is unclear whether the arguments were printed on purpose.  It might
be useful to do so at times for debugging purposes, but generally they
drown out other messages when a lot of post-processing is being done;
making it harder to spot messages of interest that would otherwise
allow noticing regressions.  This is particularly troublesome when
running org-babel-execute-buffer from a Makefile or script.

lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): Do not
print post-processing argument.
---
 lisp/ob-emacs-lisp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el
index bb311aa44..b8e6ef298 100644
--- a/lisp/ob-emacs-lisp.el
+++ b/lisp/ob-emacs-lisp.el
@@ -58,7 +58,7 @@ (defun org-babel-expand-body:emacs-lisp (body params)
       (format "(let (%s)\n%s\n)"
 	      (mapconcat
 	       (lambda (var)
-		 (format "%S" (print `(,(car var) ',(cdr var)))))
+		 (format "%S" `(,(car var) ',(cdr var))))
 	       vars "\n      ")
 	      body))))
 
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] Begin messages about executing code blocks with a capital letter
  2022-10-06 11:43 [PATCH 0/2] Don't print arguments of post-process arguments to stdout Jonas Bernoulli
  2022-10-06 11:43 ` [PATCH 1/2] " Jonas Bernoulli
@ 2022-10-06 11:43 ` Jonas Bernoulli
  2022-10-07  5:55 ` [PATCH 0/2] Don't print arguments of post-process arguments to stdout Ihor Radchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Jonas Bernoulli @ 2022-10-06 11:43 UTC (permalink / raw)
  To: emacs-orgmode

By Emacs' convention all messages should begin with a capital letter.

lisp/ob-awk.el (org-babel-expand-body:awk):
lisp/ob-core.el (org-babel-execute-src-block):
lisp/ob-groovy.el (org-babel-execute:groovy):
lisp/ob-maxima.el (org-babel-execute:maxima):
lisp/ob-sed.el (org-babel-execute:sed):
Begin message with capital letter.
---
 lisp/ob-awk.el    | 2 +-
 lisp/ob-core.el   | 2 +-
 lisp/ob-groovy.el | 2 +-
 lisp/ob-maxima.el | 2 +-
 lisp/ob-sed.el    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/ob-awk.el b/lisp/ob-awk.el
index e2dfb0c9b..1db9c6b00 100644
--- a/lisp/ob-awk.el
+++ b/lisp/ob-awk.el
@@ -55,7 +55,7 @@ (defun org-babel-expand-body:awk (body _params)
 (defun org-babel-execute:awk (body params)
   "Execute a block of Awk code with org-babel.
 This function is called by `org-babel-execute-src-block'."
-  (message "executing Awk source code block")
+  (message "Executing Awk source code block")
   (let* ((result-params (cdr (assq :result-params params)))
          (cmd-line (cdr (assq :cmd-line params)))
          (in-file (cdr (assq :in-file params)))
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 27947111f..18722d141 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -791,7 +791,7 @@ (defun org-babel-execute-src-block (&optional arg info params executor-type)
 		 result exec-start-time)
 	    (unless (fboundp cmd)
 	      (error "No org-babel-execute function for %s!" lang))
-	    (message "executing %s %s %s..."
+	    (message "Executing %s %s %s..."
 		     (capitalize lang)
                      (pcase executor-type
                        ('src-block "code block")
diff --git a/lisp/ob-groovy.el b/lisp/ob-groovy.el
index 426eaacdc..f1689ef12 100644
--- a/lisp/ob-groovy.el
+++ b/lisp/ob-groovy.el
@@ -52,7 +52,7 @@ (defcustom org-babel-groovy-command "groovy"
 (defun org-babel-execute:groovy (body params)
   "Execute a block of Groovy code with org-babel.
 This function is called by `org-babel-execute-src-block'."
-  (message "executing Groovy source code block")
+  (message "Executing Groovy source code block")
   (let* ((processed-params (org-babel-process-params params))
          (session (org-babel-groovy-initiate-session (nth 0 processed-params)))
          (result-params (nth 2 processed-params))
diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index 1a944376e..ada98bae8 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -76,7 +76,7 @@ (defun org-babel-maxima-expand (body params)
 (defun org-babel-execute:maxima (body params)
   "Execute a block of Maxima entries with org-babel.
 This function is called by `org-babel-execute-src-block'."
-  (message "executing Maxima source code block")
+  (message "Executing Maxima source code block")
   (let ((result-params (split-string (or (cdr (assq :results params)) "")))
 	(result
 	 (let* ((cmdline (or (cdr (assq :cmdline params)) ""))
diff --git a/lisp/ob-sed.el b/lisp/ob-sed.el
index 9befa7163..6e17501e4 100644
--- a/lisp/ob-sed.el
+++ b/lisp/ob-sed.el
@@ -65,7 +65,7 @@ (defun org-babel-execute:sed (body params)
 BODY is the source inside a sed source block and PARAMS is an
 association list over the source block configurations.  This
 function is called by `org-babel-execute-src-block'."
-  (message "executing sed source code block")
+  (message "Executing sed source code block")
   (let* ((result-params (cdr (assq :result-params params)))
          (cmd-line (cdr (assq :cmd-line params)))
          (in-file (cdr (assq :in-file params)))
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Don't print arguments of post-process arguments to stdout
  2022-10-06 11:43 [PATCH 0/2] Don't print arguments of post-process arguments to stdout Jonas Bernoulli
  2022-10-06 11:43 ` [PATCH 1/2] " Jonas Bernoulli
  2022-10-06 11:43 ` [PATCH 2/2] Begin messages about executing code blocks with a capital letter Jonas Bernoulli
@ 2022-10-07  5:55 ` Ihor Radchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2022-10-07  5:55 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: emacs-orgmode

Jonas Bernoulli <jonas@bernoul.li> writes:

> I run org-babel-execute-buffer from a Makefile and the output is quite
> noisy, forcing me to filter out some output using grep -v so that I am
> still able to spot any unexpected output that indicates some issue.
>
> Now that I have started using post-processing code blocks, the output
> has gotten even more noisy and unfortunately filtering out the unwanted
> additions is not possible.
>
> Currently all arguments to post-processing blocks are printed to
> stdout.  I am not able to filter them out using grep because this
> output seems to be split across multiple lines, so a regexp like
> "^(" only matches parts of the noise.
>
> It is unclear whether the arguments were printed on purpose.  It might
> be useful to do so at times for debugging purposes, but generally they
> make things harder, by obscuring output one would want to notice.

I suspect that it is remnants of previous code re-factoring in
5e0db0798. The old code used `print' for pretty-printing :results pp.

> The second commit addresses a cosmetic, but somewhat related,
> annoyance.
>
> Jonas Bernoulli (2):
>   Don't print arguments of post-process arguments to stdout
>   Begin messages about executing code blocks with a capital letter
>
>  lisp/ob-awk.el        | 2 +-
>  lisp/ob-core.el       | 2 +-
>  lisp/ob-emacs-lisp.el | 2 +-
>  lisp/ob-groovy.el     | 2 +-
>  lisp/ob-maxima.el     | 2 +-
>  lisp/ob-sed.el        | 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)

Applied onto main with amendments to commit messages.
Please refer to
https://orgmode.org/worg/org-contribute.html#commit-messages in future.

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2f4de60980b6b10770696c4ee0b610d0e96ab575
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fc8e375b9bd2685690e6ec9f0cc6ed078a6e938f

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-07  5:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 11:43 [PATCH 0/2] Don't print arguments of post-process arguments to stdout Jonas Bernoulli
2022-10-06 11:43 ` [PATCH 1/2] " Jonas Bernoulli
2022-10-06 11:43 ` [PATCH 2/2] Begin messages about executing code blocks with a capital letter Jonas Bernoulli
2022-10-07  5:55 ` [PATCH 0/2] Don't print arguments of post-process arguments to stdout Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).