1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(finder-current-item): Throw an error on an empty line.

This commit is contained in:
Eli Zaretskii 2005-03-19 14:35:59 +00:00
parent 09ad1a5b64
commit 62832105d7

View file

@ -301,11 +301,13 @@ FILE should be in a form suitable for passing to `locate-library'."
(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."