unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: tpeplt <tpeplt@gmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Commands to insert a heading and a new page
Date: Thu, 28 Mar 2024 09:42:29 +0000	[thread overview]
Message-ID: <NJpWLptgUZ1vX1DjENJhzUyXDoDXn7gcvF7IL41xkM-goy1Le-lSwnBA--HrAsb5Pte3Bip-ksM4OFqcJPdt2JnHYJcvxjrI7KE91rzCEJE=@protonmail.com> (raw)
In-Reply-To: <87le63fg07.fsf@gmail.com>






Sent with Proton Mail secure email.

On Thursday, March 28th, 2024 at 10:48 AM, tpeplt <tpeplt@gmail.com> wrote:

> Heime heimeborgia@protonmail.com writes:
> 
> > I would like to have two commands, one to insert a heading, the other to
> > insert a new page in a buffer. So I can easily traverse the code in a buffer.
> 
> 
> The Emacs function ‘insert’ inserts text into the current buffer:
> 
> (insert &rest ARGS)
> 
> Insert the arguments, either strings or characters, at point.
> 
> A simple function to insert a form-feed character:
> 
> (defun new-page ()
> "Insert a page separator into the current buffer."
> (interactive)
> (newline)
> (insert ?\f) ;Form feed is \f or Ctrl-l or ASCII 012
> (newline))

That does the job.
 
> ‘insert’ accepts either characters or strings, so it could be used to
> define a command that inserts whatever text you want in a heading.
> 
> (newline)
> (insert "Header line 1\n")
> (insert "Line 2\n")
> (insert (format "Parameter is %s.\n" parm))
> 
> --



      parent reply	other threads:[~2024-03-28  9:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26  9:16 Commands to insert a heading and a new page Heime
2024-03-27 22:48 ` tpeplt
2024-03-28  3:12   ` Emanuel Berg
2024-03-31 15:49     ` [External] : " Drew Adams
2024-03-31 18:40       ` tpeplt
2024-03-31 20:32         ` Drew Adams
2024-04-01  2:07           ` Emanuel Berg
2024-04-01 16:53             ` Drew Adams
2024-04-01  1:20       ` Emanuel Berg
2024-03-28  9:42   ` Heime [this message]

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='NJpWLptgUZ1vX1DjENJhzUyXDoDXn7gcvF7IL41xkM-goy1Le-lSwnBA--HrAsb5Pte3Bip-ksM4OFqcJPdt2JnHYJcvxjrI7KE91rzCEJE=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tpeplt@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).