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

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

Re: detect if line has only white space?


From: jan
Subject: Re: detect if line has only white space?
Date: 11 Nov 2003 13:38:52 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Miguel Frasson <frasson@enquist.math.leidenuniv.nl> writes:

> I would like to have a elisp function that detects if the current
> line contains only white space. Some idea?

Probably not the best way to do it, but this is from my utils file

(defun line-empty-p ()
  "Returns non-nil if current line is empty."
  (save-excursion
    (end-of-line)
    (let ((eol (point)))
      (beginning-of-line)
      (not (re-search-forward "[^ \t]" eol t)))))

-- 
jan






reply via email to

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