changeset 60746:23533546bb38

(finder-current-item): Throw an error on an empty line.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 19 Mar 2005 14:35:59 +0000
parents 82892a53d9be
children 86c528510d44
files lisp/finder.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/finder.el	Sat Mar 19 14:25:29 2005 +0000
+++ b/lisp/finder.el	Sat Mar 19 14:35:59 2005 +0000
@@ -301,11 +301,13 @@
     (finder-summary)))
 
 (defun finder-current-item ()
-  (if (and finder-headmark (< (point) finder-headmark))
-      (error "No keyword or filename on this line")
-    (save-excursion
-      (beginning-of-line)
-      (current-word))))
+  (let ((key (save-excursion
+	       (beginning-of-line)
+	       (current-word))))
+    (if (or (and finder-headmark (< (point) finder-headmark))
+	    (= (length key) 0))
+	(error "No keyword or filename on this line")
+      key)))
 
 (defun finder-select ()
   "Select item on current line in a finder buffer."