unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Function-Problem
@ 2016-08-17 10:49 Klaus Jantzen
  2016-08-17 13:27 ` Function-Problem tomas
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Klaus Jantzen @ 2016-08-17 10:49 UTC (permalink / raw)
  To: emacs-list

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.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-17 18:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17 10:49 Function-Problem Klaus Jantzen
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).