From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xavier Maillard Newsgroups: gmane.emacs.help Subject: Re: empty-line-p Date: Sat, 31 Mar 2007 17:17:17 +0200 Organization: GNU's Not UNIX! Message-ID: <200703311517.l2VFHHFN021493@localhost.localdomain> References: <877iszcdoj.fsf@localhorst.mine.nu> <460DF657.40201@easy-emacs.de> Reply-To: Xavier Maillard NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1175530196 9682 80.91.229.12 (2 Apr 2007 16:09:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2007 16:09:56 +0000 (UTC) Cc: david.hansen@gmx.net, help-gnu-emacs@gnu.org To: Andreas Roehler Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 02 18:09:45 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HYP6F-0003NZ-VM for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Apr 2007 18:09:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYP9I-0002d0-Lj for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Apr 2007 12:12:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HYP7L-0005g9-02 for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 12:10:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HYP7I-0005VX-1O for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 12:10:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYP7H-0005UH-Uj for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 12:10:47 -0400 Original-Received: from smtp5-g19.free.fr ([212.27.42.35]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HYP4E-0002oo-0n for help-gnu-emacs@gnu.org; Mon, 02 Apr 2007 12:07:38 -0400 Original-Received: from zogzog.home (chn51-3-88-163-173-156.fbx.proxad.net [88.163.173.156]) by smtp5-g19.free.fr (Postfix) with ESMTP id 5483A38405; Mon, 2 Apr 2007 18:07:37 +0200 (CEST) Original-Received: from zogzog.home (IDENT:25@localhost [127.0.0.1]) by zogzog.home (8.13.8/8.13.8) with ESMTP id l32F4VjQ001331; Mon, 2 Apr 2007 17:04:34 +0200 Original-Received: (from zedek@localhost) by localhost.localdomain (8.13.8/8.13.8/Submit) id l2VFHHFN021493; Sat, 31 Mar 2007 17:17:17 +0200 X-Authentication-Warning: localhost.localdomain: zedek set sender to zedek@gnu.org using -f In-reply-to: <460DF657.40201@easy-emacs.de> (andreas.roehler@easy-emacs.de) User-Agent: Rmail in GNU Emacs 23.0.51.1 on GNU/Linux Jabber-ID: zedek@im.lolica.org X-detected-kernel: Linux 2.4 (Google crawlbot) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42367 Archived-At: > wrap it in a `save-match-data'. > > David > OK, thanks. So I got this now: Here is what I would do instead: (defun empty-line-p (&optional ispec) "Returns t if cursor is at an empty line, nil otherwise. Displays result in minibuffer when called interactive." (interactive "p") (save-excursion (beginning-of-line) (save-match-data (let ((res (looking-at empty-line-p-chars))) (or (and ispec (message "%s" res)) res))))) Xavier