From: pietru@caramail.com
To: "Stefan Möding" <s.moeding@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Messages - Avoiding newlines
Date: Tue, 8 Dec 2020 15:23:21 +0100 [thread overview]
Message-ID: <trinity-0fbd8e92-a2c5-4c63-90e3-f77ca8f60b67-1607437401775@3c-app-mailcom-bs08> (raw)
In-Reply-To: <m2360gtoi7.fsf@athena.moeding.net>
When using
(message "\nBounds: %s | $ma $mb [%s,%s] |"
(replace-regexp-in-string "\n+$" "" (pp bounds)) $ma $mb)
I get
-------- result --------
(78 . 84)
Bounds: (78 . 84) | $ma $mb [78,84] |
------ result --------
> Sent: Tuesday, December 08, 2020 at 2:29 PM
> From: "Stefan Möding" <s.moeding@gmail.com>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Messages - Avoiding newlines
>
> pietru@caramail.com writes:
>
> > I would like to print some values but I am getting a new-line
> > after (pp bounds). Haw may I avoid it?
>
> You could remove the trailing newlines returned by pp:
>
> (message "Bounds: %s [%s, %s]"
> (replace-regexp-in-string "\n+$" "" (pp bounds)) $ma $mb)
>
> pp (Pretty Print) is meant to be used interactively so the newline make
> sense when showing the output on a terminal.
>
> --
> Stefan
>
>
next prev parent reply other threads:[~2020-12-08 14:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 12:51 Messages - Avoiding newlines pietru
2020-12-08 13:29 ` Stefan Möding
2020-12-08 13:47 ` 2QdxY4RzWzUUiLuE
2020-12-08 13:47 ` pietru
2020-12-08 14:23 ` pietru [this message]
2020-12-08 15:32 ` Michael Heerdegen
2020-12-15 3:34 ` Tim Landscheidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-0fbd8e92-a2c5-4c63-90e3-f77ca8f60b67-1607437401775@3c-app-mailcom-bs08 \
--to=pietru@caramail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=s.moeding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).