all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Klaus Jantzen <k.d.jantzen@mailbox.org>
To: emacs-list <help-gnu-emacs@gnu.org>
Subject: Function-Problem
Date: Wed, 17 Aug 2016 12:49:11 +0200	[thread overview]
Message-ID: <5715d4d8-fe9c-851f-8a2c-308a9da10e37@mailbox.org> (raw)

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.




             reply	other threads:[~2016-08-17 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 10:49 Klaus Jantzen [this message]
2016-08-17 13:27 ` Function-Problem tomas
2016-08-17 14:38   ` Function-Problem Drew Adams
2016-08-17 14:49     ` Function-Problem tomas
2016-08-17 13:59 ` Function-Problem Óscar Fuentes
2016-08-17 17:06 ` Function-Problem Klaus Jantzen
2016-08-17 17:33   ` Function-Problem John Mastro
2016-08-17 18:07     ` Function-Problem tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5715d4d8-fe9c-851f-8a2c-308a9da10e37@mailbox.org \
    --to=k.d.jantzen@mailbox.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.