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

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

Re: Determining existence of text following point


From: michael-franzese
Subject: Re: Determining existence of text following point
Date: Tue, 18 May 2021 01:53:48 +0200

I could use something based on the follewing

 (if (looking-at "[[:alnum:]]+")

But I am quite unsure about the regexp.  If there exists at least a character,
I would not insert any text.


> Sent: Tuesday, May 18, 2021 at 11:05 AM
> From: "Eric Abrahamsen" <eric@ericabrahamsen.net>
> To: michael-franzese@gmx.com
> Cc: "Skip Montanaro" <skip.montanaro@gmail.com>, "Help Gnu Emacs" 
> <help-gnu-emacs@gnu.org>
> Subject: Re: Determining existence of text following point
>
> michael-franzese@gmx.com writes:
> 
> >    Would like to delete and insert a string "s" only if there is no text
> >    folloming point.
> >
> >    (delete-region (point) (line-end-position))
> >    (save-excursion (insert s))
> 
> There's a function for this: `eolp'
> 
> Return t if point is at the end of a line.
> ‘End of a line’ includes point being at the end of the buffer.
>



reply via email to

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