# HG changeset patch # User Oleksandr Gavenko # Date 1429653281 -10800 # Node ID 3848ca89b2b628feefa0aa85a99b5fbb96803140 # Parent bfbf02088de8441209f836ab5c43bfaddcb7dd5d Simplify code. diff -r bfbf02088de8 -r 3848ca89b2b6 autobm.el --- 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)) )