equal
deleted
inserted
replaced
1 ;;; autobm.el --- suggest bookmark name from local context |
1 ;;; autobm.el --- suggest bookmark name from local context |
|
2 |
|
3 (require 'cl-lib) |
2 |
4 |
3 (defvar autobm-mode-handlers |
5 (defvar autobm-mode-handlers |
4 '((emacs-lisp-mode . (autobm-try-semantic)) |
6 '((emacs-lisp-mode . (autobm-try-semantic)) |
5 (semantic-decoration-mode . (autobm-try-semantic)) |
7 (semantic-decoration-mode . (autobm-try-semantic)) |
6 (t . (autobm-try-which-func autobm-try-thingatpt))) |
8 (t . (autobm-try-which-func autobm-try-thingatpt))) |
13 |
15 |
14 (defvar autobm-try-thingatpt-things |
16 (defvar autobm-try-thingatpt-things |
15 '(symbol url email)) |
17 '(symbol url email)) |
16 |
18 |
17 (defun autobm-try-thingatpt () |
19 (defun autobm-try-thingatpt () |
18 (let ((things autobm-try-thingatpt-things) name) |
20 (cl-some #'thing-at-point autobm-try-thingatpt-things)) |
19 (while (and things (not name)) |
|
20 (setq name (thing-at-point (car things))) |
|
21 (setq things (cdr things))) |
|
22 name)) |
|
23 |
21 |
24 (defun autobm-get-active-handlers () |
22 (defun autobm-get-active-handlers () |
25 (let ( h handlers (modes (list t)) ) |
23 (let ( h handlers (modes (list t)) ) |
26 (dolist (m minor-mode-list) |
24 (dolist (m minor-mode-list) |
27 (when (and (boundp m) (symbol-value m)) |
25 (when (and (boundp m) (symbol-value m)) |