-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto mode rules lisp
42 lines (42 loc) · 2.73 KB
/
auto mode rules lisp
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
;; List of auto-mode rules.
;; It is made to be easily readable and editable, but you still need to remember some things:
;;
;; Every rule starts on a new line and consists of one or more of the following elements:
;; - Condition for rule activation. It is either (match-domain ...),
;; (match-host ...), (match-regex ...) or a string.
;; - :included (optional) -- List of the modes to enable on condition.
;; - :excluded (optional) -- List of the modes to disable on condition.
;; - :exact-p (optional) -- Whether to enable only :included modes and disable
;; everything else (if :exact-p is t), or just add :included and exclude :excluded
;; modes from the current modes list (if :exact-p is nil or not present).
;;
;; Included modes is a list of mode symbols, or a list of lists in the form
;; of (MODE-SYMBOL INIT-ARGS), where init-args are passed to the mode when instantiated.
;;
;; Conditions work this way:
;; - match-domain matches the URL domains only.
;; Example: (match-domain "reddit.com") will work for all of Reddit.
;; - match-host is more specific -- it activates only on certain subdomains of the website.
;; Example: (match-host "old.reddit.com") will work on old Reddit only.
;; - match-regex works for any address that matches a given regex. You can add these manually,
;; but remember: with great regex comes great responsibility!
;; Example: (match-regex "https://github\.com/.*/.*") will activate only in repos on GitHub.
;; - String format matches the exact URL and nothing else
;; Example: "https://lispcookbook.github.io/cl-cookbook/pattern_matching.html"
;; will work on the Pattern Matching article of CL Cookbook, and nowhere else.
;;
;; You can write additional URLs in the bracketed conditions, to reuse the rule for other URL
;; Example: (match-host "reddit.com" "old.reddit.com" "www6.reddit.com")
(
((match-domain "github.com") :included (nowebgl-mode emacs-mode nosound-mode
reduce-tracking-mode
certificate-exception-mode) :exact-p t)
((match-host "old.reddit.com") :included (nowebgl-mode emacs-mode nosound-mode
reduce-tracking-mode
certificate-exception-mode) :exact-p t)
((match-host "discourse.atlas.engineer") :included (nowebgl-mode emacs-mode
nosound-mode
reduce-tracking-mode
certificate-exception-mode) :exact-p t)
((match-host "nyxt.atlas.engineer") :excluded (noscript-mode noscript-mode))
)