From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Visher Subject: Set heading text from elisp? Date: Mon, 11 Nov 2019 09:19:11 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ec0f19059712d22c" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53664) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUAXn-0007Bv-Cz for emacs-orgmode@gnu.org; Mon, 11 Nov 2019 09:19:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUAXl-0008Li-VG for emacs-orgmode@gnu.org; Mon, 11 Nov 2019 09:19:51 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:40018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUAXl-0008LU-P5 for emacs-orgmode@gnu.org; Mon, 11 Nov 2019 09:19:49 -0500 Received: by mail-wm1-x334.google.com with SMTP id f3so13363096wmc.5 for ; Mon, 11 Nov 2019 06:19:48 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --000000000000ec0f19059712d22c Content-Type: text/plain; charset="UTF-8" I'm wondering if there's builtin support for editing components of the heading? I'm trying to set the text component (i.e. `(nth 4 (org-heading-components))`) without altering anything else and while I can obviously achieve this with generic elisp I wanted to be sure I had to. The cleanest elisp I came up with was: ``` (save-excursion (org-back-to-heading t) (let (case-fold-search) (looking-at org-complex-heading-regexp) (replace-match text t t nil 4) (org-align-tags))) ``` -- In Christ, Timmy V. https://blog.twonegatives.com https://five.sentenc.es --000000000000ec0f19059712d22c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm wondering if there's builtin support for editi= ng components of the heading? I'm trying to set the text component (i.e= . `(nth 4 (org-heading-components))`) without altering anything else and wh= ile I can obviously achieve this with generic elisp I wanted to be sure I h= ad to.

The cleanest elisp I came up with was:
=
```
(save-excursion
=C2=A0 (org-back-to-heading t)
= =C2=A0 (let (case-fold-search)
=C2=A0 =C2=A0 (looking-at org-complex-hea= ding-regexp)
=C2=A0 =C2=A0 (replace-match text t t nil 4)
=C2=A0 =C2= =A0 (org-align-tags)))

```

--000000000000ec0f19059712d22c--