[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Re: Electric insert of headline stars
From: |
Bastien |
Subject: |
Re: [Orgmode] Re: Electric insert of headline stars |
Date: |
Thu, 25 Oct 2007 14:17:59 +0100 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux) |
"Piotr Zielinski" <address@hidden> writes:
> This is what I came up with after following the suggestion from the
> manual, but it looks complicated to me, so I don't really like it:
>
> (defun local-org-insert-stars ()
> (interactive)
> (when (looking-back "^ +" (point-at-bol))
> (save-excursion
> (while (search-backward " " (point-at-bol) t)
> (replace-match "*" nil t))))
> (org-self-insert-command 1))
A bit more complicated but using `replace-match' instead of
`replace-string' has also the advantage of getting rid of the messages.
--
Bastien