From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jan Newsgroups: gmane.emacs.help Subject: Re: detect if line has only white space? Date: 11 Nov 2003 13:38:52 -0800 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068518614 1356 80.91.224.253 (11 Nov 2003 02:43:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2003 02:43:34 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 11 03:43:31 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AJOV8-000607-00 for ; Tue, 11 Nov 2003 03:43:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AJPMi-0007B3-LC for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Nov 2003 22:38:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AJPM8-0007AN-RK for help-gnu-emacs@gnu.org; Mon, 10 Nov 2003 22:38:16 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AJPLc-0006pE-CC for help-gnu-emacs@gnu.org; Mon, 10 Nov 2003 22:38:15 -0500 Original-Received: from [210.50.76.52] (helo=smtp02.syd.iprimus.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AJPLV-0006Zd-NF for help-gnu-emacs@gnu.org; Mon, 10 Nov 2003 22:37:37 -0500 Original-Received: from ABE (210.50.172.76) by smtp02.syd.iprimus.net.au (7.0.020) id 3F8F522A0085A366; Tue, 11 Nov 2003 13:36:10 +1100 Original-To: Miguel Frasson In-Reply-To: Original-Lines: 17 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14024 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14024 Miguel Frasson 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