unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Writing newline in message buffer
@ 2021-05-14 10:43 pauline-galea
  2021-05-14 13:37 ` Jeremie Juste
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: pauline-galea @ 2021-05-14 10:43 UTC (permalink / raw)
  To: Help Gnu Emacs

How can I add a newline in the messages buffer

Have read about terpri

I can write the following but want to avoid the \n at beginning of my string.

   (message "\nmymessage")






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

* Re: Writing newline in message buffer
  2021-05-14 10:43 Writing newline in message buffer pauline-galea
@ 2021-05-14 13:37 ` Jeremie Juste
  2021-05-14 14:07   ` Jean Louis
  2021-05-14 13:52 ` Jean Louis
  2021-05-14 16:22 ` Yuri Khan
  2 siblings, 1 reply; 5+ messages in thread
From: Jeremie Juste @ 2021-05-14 13:37 UTC (permalink / raw)
  To: pauline-galea; +Cc: Help Gnu Emacs

Hello Pauline,

> I can write the following but want to avoid the \n at beginning of my string.
>
>    (message "\nmymessage")
>
I know only 2 ways one of which you already suggested.
The other way would be:

(message "
mymessage")

Hope this helps,
-- 
Jeremie Juste



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

* Re: Writing newline in message buffer
  2021-05-14 10:43 Writing newline in message buffer pauline-galea
  2021-05-14 13:37 ` Jeremie Juste
@ 2021-05-14 13:52 ` Jean Louis
  2021-05-14 16:22 ` Yuri Khan
  2 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2021-05-14 13:52 UTC (permalink / raw)
  To: pauline-galea; +Cc: Help Gnu Emacs

* pauline-galea@gmx.com <pauline-galea@gmx.com> [2021-05-14 13:44]:
> How can I add a newline in the messages buffer
> 
> Have read about terpri
> 
> I can write the following but want to avoid the \n at beginning of my string.
> 
>    (message "\nmymessage") ⇒ "
mymessage"

It works my side. You don't need `terpri' for messages. Maybe if you
run Emacs on command line, you may need it.




-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Writing newline in message buffer
  2021-05-14 13:37 ` Jeremie Juste
@ 2021-05-14 14:07   ` Jean Louis
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2021-05-14 14:07 UTC (permalink / raw)
  To: Jeremie Juste; +Cc: Help Gnu Emacs, pauline-galea

* Jeremie Juste <jeremiejuste@gmail.com> [2021-05-14 16:38]:
> Hello Pauline,
> 
> > I can write the following but want to avoid the \n at beginning of my string.
> >
> >    (message "\nmymessage")

You could just get used to "\n" as that is handy. You can also use creative approached:

(setq oh-no (char-to-string 10))

(message (concat oh-no "my message"))

That way you avoid "\n" while still have it. 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Writing newline in message buffer
  2021-05-14 10:43 Writing newline in message buffer pauline-galea
  2021-05-14 13:37 ` Jeremie Juste
  2021-05-14 13:52 ` Jean Louis
@ 2021-05-14 16:22 ` Yuri Khan
  2 siblings, 0 replies; 5+ messages in thread
From: Yuri Khan @ 2021-05-14 16:22 UTC (permalink / raw)
  To: pauline-galea; +Cc: Help Gnu Emacs

On Fri, 14 May 2021 at 17:44, <pauline-galea@gmx.com> wrote:

> How can I add a newline in the messages buffer
>
> Have read about terpri
>
> I can write the following but want to avoid the \n at beginning of my string.
>
>    (message "\nmymessage")

The line ending character is usually put at the end of a line:

(message "mymessage\n")



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

end of thread, other threads:[~2021-05-14 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-14 10:43 Writing newline in message buffer pauline-galea
2021-05-14 13:37 ` Jeremie Juste
2021-05-14 14:07   ` Jean Louis
2021-05-14 13:52 ` Jean Louis
2021-05-14 16:22 ` Yuri Khan

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