-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemacs-launcher-sources.el
53 lines (47 loc) · 2 KB
/
emacs-launcher-sources.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(defvar anything-c-source-common-folders
'((name . "Common Folders")
(candidates . (lambda ()
(with-temp-buffer
(insert-file-contents
(format "%s.common-folders"
emacs-launcher-installation-directory))
(split-string (buffer-substring-no-properties
(point-min) (point-max)) "\n" t))))
(action . (("Open with Windows Explorer" . folder-open-explorer)
("Open command window in folder" . folder-open-explorer)))))
(defvar anything-c-source-urls
'((name . "Web Sites")
(candidates . url-names)
(action . (("Open URL" . open-common-url-from-name)
("Edit and Open URL" . edit-and-open-common-url-from-name)))))
;; Alternate version with flexible matching
(defvar anything-c-source-urls
'((name . "Web Sites")
(candidates . url-names)
(match . (anything-c-flexible-match))
(action . (("Open URL" . open-common-url-from-name)
("Edit and Open URL" . edit-and-open-common-url-from-name)))))
(defvar anything-c-source-commands
'((name . "Commands")
(candidates . (lambda () (mapcar 'car (list-commands))))
(action . (("Execute command" . run-command)))))
(defvar anything-c-source-clips
'((name . "Clips")
(candidates . (lambda () (mapcar 'car (get-clips))))
(action . (("Copy clip to clipboard" . get-clip)))))
(defvar anything-c-source-bookmarks
'((name . "Bookmarks in Emacs")
(init . (lambda () (require 'bookmark)))
(candidates . bookmark-all-names)
(action . (("Open" . open-bookmark)
("Edit and open" . edit-and-open-bookmark)))))
(defvar anything-c-source-special
'((name . "Special Commands")
(candidates . ("Cancel" "Quit"))
(action . (("Cancel" .
(lambda (x)
(cond ((string= x "Cancel")
(message "Canceled" x))
((string= x "Quit")
(let ((kill-emacs-hook nil))
(kill-emacs))))))))))