help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: insert text after a char depending on next char


From: james
Subject: Re: insert text after a char depending on next char
Date: 20 Apr 2007 11:05:44 -0700
User-agent: G2/1.0

On Apr 20, 9:17 am, Sebastian Meisel <sebastianmei...@web.de> wrote:
> Hallo,
>
> is the following possible in emacs, and if it is how can it be done:
>
> I want emacs  to insert  "\," after a dot ("."), when no space is following:
>
> I type: "Hallo World. Hallo World." -> emacs shall not insert anything,
> because a space is following.
> I type: "Hallo World.Hallo World." -> emacs shall insert "\," after the
> dot resulting in: "Hallo World.\,Hallo World.".
>
> Thanks for any hints.
>
> Sebastian Meisel

Something like this:

(defun qwerty()
  (interactive)
  (cond ((looking-at " ") (insert "."))
        (t (insert ".\\,"))))

(local-set-key (kbd ".") 'qwerty)


Seems like the sort of thing you'd want to add more conditions to



reply via email to

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