From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Klaus Jantzen Newsgroups: gmane.emacs.help Subject: Function-Problem Date: Wed, 17 Aug 2016 12:49:11 +0200 Message-ID: <5715d4d8-fe9c-851f-8a2c-308a9da10e37@mailbox.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1471436655 10079 195.159.176.226 (17 Aug 2016 12:24:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2016 12:24:15 +0000 (UTC) To: emacs-list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 17 14:24:06 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZzt8-0002D2-ER for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Aug 2016 14:24:06 +0200 Original-Received: from localhost ([::1]:47296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZzt5-0006hk-KB for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Aug 2016 08:24:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZyPO-00053X-Mw for help-gnu-emacs@gnu.org; Wed, 17 Aug 2016 06:49:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZyPK-0000qL-HC for help-gnu-emacs@gnu.org; Wed, 17 Aug 2016 06:49:17 -0400 Original-Received: from mx1.mailbox.org ([80.241.60.212]:55056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZyPK-0000qG-6S for help-gnu-emacs@gnu.org; Wed, 17 Aug 2016 06:49:14 -0400 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id C228F442F8 for ; Wed, 17 Aug 2016 12:49:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :date:date:message-id:subject:subject:from:from:received; s= mail20150812; t=1471430951; bh=3Fck41fvclP/W8RIsqOPlBD2IDQyyvetR gH+ZvAPhZ8=; b=s+IRlgOc+/eq5XIhyTQD9CIyR0TlCz+LpHrgp7+my+BO0Yuu1 150KW1H+IcpdwU8s2NKxGLhgIo2SQrphfglbO1jHwg1hloTP/dxE+SY7zk1i3Aom vmlloMucud38reVRtucmG+T8T6MQ+2kHMtRKxGa8LRdTx8+IDDWZ7bR1ceoZKX9u +CI+peWazkC56g0lgKCm5+O6Xj9UZ5QsGZA/sGrZImK/X8kx+EorFLRuLG+n0W8w Bb2KOBAwFrUVSNPAs35nml7GwFIaGYVUUw5pRetyCOAzbM+JqKhaF+A5Q+qq+25G x6HuSbAf4uEmnbH67u4JZZ7zJXP/f6Tqyx7mA== X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id HVeyeAJt0W2E for ; Wed, 17 Aug 2016 12:49:11 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.241.60.212 X-Mailman-Approved-At: Wed, 17 Aug 2016 08:23:26 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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 Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111161 Archived-At: Hello, the attached function should return true if a line contains all blanks or is empty. Currently the function returns a quick 'nil' and then the message "No catch for tag: --cl-block-nil--, nil" What is my problem? ===== (defun blank-line-p () "Returns t if line contains all blanks or is empty" (let ((lep (line-end-position)) (cpp (point)) ; the current position (res 0) ) (beginning-of-line) (if (re-search-forward "^[ ]+$\|^$" lep t) (progn (goto-char cpp) ; line is blank/empty (message "t") t) (progn (goto-char cpp) ; line is not blank/empty (message "nil") (return nil)) ) ) ; end of let ) ; end of 'blank-line-p' ==== Thanks for any hint. -- K.D.J.