On Oct 25, 2007, at 1:53 PM, Seweryn Kokot wrote:
"Piotr Zielinski" <[EMAIL PROTECTED]> writes:
which of course doesn't normally work, hence this elisp code.
(defun local-org-insert-stars ()
(interactive)
(when (looking-back "^ *" (point-at-bol))
(replace-string " " "*" nil (point-at-bol) (point)))
(insert "*"))
(define-key org-mode-map "*" 'local-org-insert-stars)
Very nice idea!
A minor inconvenience is a warning when compiling the code
.emacs:2604:30:Warning: `replace-string' used from Lisp code
That command is designed for interactive use only.
How to get rid of this?
The docstring of replace-string shows what replacement code should be
used,
a combination of re-search-forward and replace-match.
Or you can wrap the call into a `with-no-warnings' form.
However, is the code is just in your own .emacs and works well, who
cares.
- Carsten
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode