[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fri, 30 Mar 2007 10:56:28 +0200
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)
On 29 Mar 2007 14:32:05 GMT Joost Kremers wrote:
> Andreas Roehler wrote:
>> needed a check at several occassions, if the current line
>> contains printable characters.
>> What about the following to solve this?
>> (defun empty-line-p ()
>> "Returns t if cursor is at an empty line "
>> (looking-at "^[ \t\f\r]*$")
> you don't need the if-statement here:
> (defun empty-line-p ()
> "Returns t if cursor is at an empty line "
> (looking-at "^[ \t\f\r]*$")))
> looking-at already returns t or nil.
And to avoid some painful bug hunting (happened to me with nearly
the same code) wrap it in a `save-match-data'.