emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Set heading text from elisp?


From: Tim Visher
Subject: Set heading text from elisp?
Date: Mon, 11 Nov 2019 09:19:11 -0500

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]