help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Messages - Avoiding newlines


From: pietru
Subject: Re: Messages - Avoiding newlines
Date: Tue, 8 Dec 2020 15:23:21 +0100

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
> 
>



reply via email to

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