From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: Commands to insert a heading and a new page Date: Wed, 27 Mar 2024 18:48:24 -0400 Message-ID: <87le63fg07.fsf@gmail.com> References: <4WUuQL20YTsYDAkZrAEn-bQhNMGdVJVvGstbcI3F-ubHqcgctXVdEryoO7rgjvU51mk_uwxQYtCjS89ffdnVD6-dQd8wvE7kem231VD-a6s=@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14611"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 27 23:49:15 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rpc54-0003V1-UT for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 27 Mar 2024 23:49:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpc4N-0003Zk-Ce; Wed, 27 Mar 2024 18:48:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpc4L-0003ZJ-LX for help-gnu-emacs@gnu.org; Wed, 27 Mar 2024 18:48:29 -0400 Original-Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpc4K-0004a0-AU for help-gnu-emacs@gnu.org; Wed, 27 Mar 2024 18:48:29 -0400 Original-Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-696147fb5a7so3630926d6.0 for ; Wed, 27 Mar 2024 15:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711579706; x=1712184506; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sjm/+2kLBIfK4MVNJ2E00/xSSVvLAKobimRlIAUsd5k=; b=mHdLsT26sVbWjfAXnYcCfIzMD2csZJzOBzHZZnNTvk+mfEdsOKz79Tsb406zA74gpi hhfMCnsgZPaCQC0a5fiHUejqGl+AS8M9sorLSRLZ6W1Vnfc1LSDKbj5VwUnNJZU+5cwB WtXdmtcmyg5uxF4Y9LcUZd9djjbY6Nrg7QUejzKP/j/CSFu4TScg6gTFK4UV9S5H3O0W AHmpGnNwyTxdrL5h2MzZln9G4h5Bit3MKbmPjcSb2g7+tnGrDcZfwvkMjiQffimeCagY qoZZnbGRDSEDhefSdG3C+YtDd5joFxfPASG07GD8ZQyJmZMMdWVG6VQZbGmD6KkvRiz8 2KOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711579706; x=1712184506; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sjm/+2kLBIfK4MVNJ2E00/xSSVvLAKobimRlIAUsd5k=; b=ChTtKysahDN1PrqHTaqT85zMAfh68sL1ohrvZxGJDu4cRXmGEWsc1hjTiVmctmRGPI X7zOgA0NCLSAESXePBJc1LUltjNU+Rjev+zCge/5MFap9gT/kR0OKuSbqcMQaCkOLYJo qSMCOG4YDJpSK6KfFJ+ueF94ihxfGmKWaDo+vgLdyQwAYQlEQVYQ7RkJsLvEgrJTQP8p li736bxYzyqtqLOQpVACm+xqNMIdMUztYC8o3hQWX48W+LS1fMjlqRRj0ZTpnS5DcrJH GEZwIgYdRNgaNdX3yg/UxE44NWN04whgck3HNvBTq5+8PRT8P02IDov2Sima2WwmFfij cDdA== X-Gm-Message-State: AOJu0YwN9fYL34pCEdabcPsVuKNklmF+cO5WLUiwD5oAPYZHaZbodky9 sl19VQIgZFo9lf8WYcnoi8uI4kS5Ba5wZFvFIBYUd7a/Kf4ujqOA X-Google-Smtp-Source: AGHT+IEluMKIieGjGGX6gNpG6EEcz0tKLqgmf1A9D+gi8ywN2kRhGRD5KyBRmkKz784IaFeZwDkHow== X-Received: by 2002:ad4:51d2:0:b0:696:a1f1:21e with SMTP id p18-20020ad451d2000000b00696a1f1021emr936472qvq.60.1711579706381; Wed, 27 Mar 2024 15:48:26 -0700 (PDT) Original-Received: from t530.local ([2600:8806:a821:2b00::5acf]) by smtp.gmail.com with ESMTPSA id gy10-20020a056214242a00b0069150311189sm51312qvb.134.2024.03.27.15.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 15:48:25 -0700 (PDT) In-Reply-To: <4WUuQL20YTsYDAkZrAEn-bQhNMGdVJVvGstbcI3F-ubHqcgctXVdEryoO7rgjvU51mk_uwxQYtCjS89ffdnVD6-dQd8wvE7kem231VD-a6s=@protonmail.com> (Heime's message of "Tue, 26 Mar 2024 09:16:17 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::f33; envelope-from=tpeplt@gmail.com; helo=mail-qv1-xf33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146189 Archived-At: Heime 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 bu= ffer. The Emacs function =E2=80=98insert=E2=80=99 inserts text into the current b= uffer: (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)) =E2=80=98insert=E2=80=99 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)) --