autobm.el
changeset 1287 3848ca89b2b6
parent 1286 bfbf02088de8
child 1288 6333a733046f
--- a/autobm.el	Mon Apr 20 02:41:54 2015 +0300
+++ b/autobm.el	Wed Apr 22 00:54:41 2015 +0300
@@ -1,5 +1,7 @@
 ;;; autobm.el --- suggest bookmark name from local context
 
+(require 'cl-lib)
+
 (defvar autobm-mode-handlers
   '((emacs-lisp-mode . (autobm-try-semantic))
     (semantic-decoration-mode . (autobm-try-semantic))
@@ -15,11 +17,7 @@
   '(symbol url email))
 
 (defun autobm-try-thingatpt ()
-  (let ((things autobm-try-thingatpt-things) name)
-    (while (and things (not name))
-      (setq name (thing-at-point (car things)))
-      (setq things (cdr things)))
-    name))
+  (cl-some #'thing-at-point autobm-try-thingatpt-things))
 
 (defun autobm-get-active-handlers ()
   (let ( h handlers (modes (list t)) )