[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Function-Problem
From: |
Klaus Jantzen |
Subject: |
Function-Problem |
Date: |
Wed, 17 Aug 2016 12:49:11 +0200 |
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.
- Function-Problem,
Klaus Jantzen <=