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

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

Re: looking-at function behaviour


From: Lennart Borgman
Subject: Re: looking-at function behaviour
Date: Sun, 6 Jun 2010 17:04:49 +0200

On Sun, Jun 6, 2010 at 4:59 PM, Andrea Crotti <andrea.crotti.0@gmail.com> wrote:
> I don't understand how I should use the looking-at function, from what I
> see in the doc is not what I see happening.

looking-at takes a regexp as argument. Is not that clear from the doc
(i.e. describe-function)?

You probably want to use char-after instead here.


> --8<---------------cut here---------------start------------->8---
>  (when (not (looking-at closing-char))
>   (insert closing-char))
>  (newline-force))))
> --8<---------------cut here---------------end--------------->8---
>
> With this code I would like to
> - see if a char is before the end of line
> - insert it if not
>
> Is quite simple but it doesn't work.
> And even trying now on the fly
>
> (looking-at "a") ;; "a"
>
> Is anyway always nil, how then am I supposed to do it given that this is
> the function which reading at the info page should be used?
>
>
>



reply via email to

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