[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Messages - Avoiding newlines
From: |
Tim Landscheidt |
Subject: |
Re: Messages - Avoiding newlines |
Date: |
Tue, 15 Dec 2020 03:34:12 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
pietru@caramail.com wrote:
> I would like to print some values but I am getting a new-line
> after (pp bounds). Haw may I avoid it?
> (message "Bounds: %s [%s, %s]" (pp bounds) $ma $mb)
> Result:
> Bounds: (78 . 84)
> [78, 84]
Not strictly what you ask for, but for "simple" data struc-
tures, the "%S" format might fit your requirements:
| ELISP> (let*
| ((bounds '(78 . 84))
| ($ma (car bounds))
| ($mb (cdr bounds)))
| (message "Bounds: %S [%s, %s]" bounds $ma $mb))
^^
| "Bounds: (78 . 84) [78, 84]"
| ELISP>
In this specific case, it is equivalent to "%s"; but this is
different when for example you are printing (structures con-
taining) strings.
Tim