From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Re: Electric insert of headline stars Date: Thu, 25 Oct 2007 14:17:59 +0100 Message-ID: <87myu7cozc.fsf@bzg.ath.cx> References: <3c12eb8d0710250315r633d0c9au1fdcc8c8000437b@mail.gmail.com> <878x5rpg0l.fsf@poczta.po.opole.pl> <3c12eb8d0710250511k51750491r5ecbfdb8df66b5dc@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Il1ex-00013H-5s for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 08:17:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Il1es-0000w7-Gm for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 08:17:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Il1es-0000vy-Dn for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 08:17:54 -0400 Received: from ug-out-1314.google.com ([66.249.92.169]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Il1es-0007Vb-6d for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 08:17:54 -0400 Received: by ug-out-1314.google.com with SMTP id a2so550999ugf for ; Thu, 25 Oct 2007 05:17:53 -0700 (PDT) In-Reply-To: <3c12eb8d0710250511k51750491r5ecbfdb8df66b5dc@mail.gmail.com> (Piotr Zielinski's message of "Thu, 25 Oct 2007 13:11:05 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Piotr Zielinski" 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