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

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

Re: How to test if the current line contains only white-spache?


From: Rolf Ade
Subject: Re: How to test if the current line contains only white-spache?
Date: Thu, 19 Nov 2015 02:56:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Emanuel Berg <embe8573@student.uu.se> writes:
> Rolf Ade <rolf@pointsman.de> writes:
>
>> Works fine and is much simpler. Thanks.
>
> Here is another solution that is all C, and doesn't
> move point. Is that an advantage? ... (Open question.)
> [...]
> (defun blank-line-p ()
>   (string-match "^[[:space:]]*$"
>                 (buffer-substring-no-properties
>                  (line-beginning-position)
>                  (line-end-position) )))

That in fact opened my thinking about the real problem a bit. I 
wasn't aware of line-beginning-position and line-end-position. Lesser
moving the point around may help in finding a better solution.

Btw, what should this -p naming convention signal to me?



reply via email to

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