dev.fron.io nixrc / 06bc3a6
emacs: tweaks Tony Olagbaiye a month ago
7 changed file(s) with 22 addition(s) and 212 deletion(s). Raw diff Collapse all Expand all
3030
3131 (setq counsel-describe-function-function #'helpful-callable)
3232 (setq counsel-describe-variable-function #'helpful-variable)
33
34 (with-eval-after-load 'evil
35 (add-to-list 'evil-emacs-state-modes 'helpful-mode))
3336 '';
3437 };
3538 }
1313 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
1414 (setq magit-section-initial-visibility-alist nil)
1515 (setq magit-wip-merge-branch t)
16 (setf (alist-get 'unpushed magit-section-initial-visibility-alist) 'show)
1617 (magit-wip-mode)
1718
1819 ; temp fix
22 {
33 emacs.loader.shackle = {
44 demand = true;
5 config = ''
6 (shackle-mode t)
7 '';
58 };
69 }
22 {
33 emacs.loader.vterm-toggle = {
44 demand = true;
5 config = ''
6 (setq vterm-toggle-reset-window-configration-after-exit nil)
7 '';
58 };
69 }
33 emacs.loader.vterm = {
44 demand = true;
55 config = ''
6 ;; banish ansi-term :)
7 ;(defalias 'ansi-term (lambda (&rest _) (call-interactively #'vterm)))
86 (setq vterm-shell "${pkgs.xonsh.pname}")
97 (setq vterm-kill-buffer-on-exit t)
108 (defun bqv/nested-emacs ()
44 demand = true;
55 package = epkgs: epkgs.weechat-patched;
66 after = [ "tracking" ];
7 init = ''
8 (require 'bindat)
9 (defun bindat--unpack-group (spec)
10 (with-suppressed-warnings ((lexical struct last))
11 (defvar struct) (defvar last))
12 (let (struct last)
13 (while spec
14 (let* ((item (car spec))
15 (field (car item))
16 (type (nth 1 item))
17 (len (nth 2 item))
18 (vectype (and (eq type 'vec) (nth 3 item)))
19 (tail 3)
20 data)
21 (setq spec (cdr spec))
22 (if (and (consp field) (eq (car field) 'eval))
23 (setq field (eval (car (cdr field)) t)))
24 (if (and type (consp type) (eq (car type) 'eval))
25 (setq type (eval (car (cdr type)) t)))
26 (if (and len (consp len) (eq (car len) 'eval))
27 (setq len (eval (car (cdr len)) t)))
28 (if (memq field '(eval fill align struct union))
29 (setq tail 2
30 len type
31 type field
32 field nil))
33 (if (and (consp len) (not (eq type 'eval)))
34 (setq len (apply #'bindat-get-field struct len)))
35 (if (not len)
36 (setq len 1))
37 (cond
38 ((eq type 'eval)
39 (if field
40 (setq data (eval len t))
41 (eval len t)))
42 ((eq type 'fill)
43 (setq bindat-idx (+ bindat-idx len)))
44 ((eq type 'align)
45 (while (/= (% bindat-idx len) 0)
46 (setq bindat-idx (1+ bindat-idx))))
47 ((eq type 'struct)
48 (setq data (bindat--unpack-group (eval len t))))
49 ((eq type 'repeat)
50 (let ((index 0) (count len))
51 (while (< index count)
52 (push (bindat--unpack-group (nthcdr tail item)) data)
53 (setq index (1+ index)))
54 (setq data (nreverse data))))
55 ((eq type 'union)
56 (with-suppressed-warnings ((lexical tag))
57 (defvar tag))
58 (let ((tag len) (cases (nthcdr tail item)) case cc)
59 (while cases
60 (setq case (car cases)
61 cases (cdr cases)
62 cc (car case))
63 (if (or (equal cc tag) (equal cc t)
64 (and (consp cc) (eval cc t)))
65 (setq data (bindat--unpack-group (cdr case))
66 cases nil)))))
67 (t
68 (setq data (bindat--unpack-item type len vectype)
69 last data)))
70 (if data
71 (setq struct (if field
72 (cons (cons field data) struct)
73 (append data struct))))))
74 struct))
75
76 (defun bindat--length-group (struct spec)
77 (with-suppressed-warnings ((lexical struct last))
78 (defvar struct) (defvar last))
79 (let ((struct struct) last)
80 (while spec
81 (let* ((item (car spec))
82 (field (car item))
83 (type (nth 1 item))
84 (len (nth 2 item))
85 (vectype (and (eq type 'vec) (nth 3 item)))
86 (tail 3))
87 (setq spec (cdr spec))
88 (if (and (consp field) (eq (car field) 'eval))
89 (setq field (eval (car (cdr field)) t)))
90 (if (and type (consp type) (eq (car type) 'eval))
91 (setq type (eval (car (cdr type)) t)))
92 (if (and len (consp len) (eq (car len) 'eval))
93 (setq len (eval (car (cdr len)) t)))
94 (if (memq field '(eval fill align struct union))
95 (setq tail 2
96 len type
97 type field
98 field nil))
99 (if (and (consp len) (not (eq type 'eval)))
100 (setq len (apply #'bindat-get-field struct len)))
101 (if (not len)
102 (setq len 1))
103 (while (eq type 'vec)
104 (if (consp vectype)
105 (setq len (* len (nth 1 vectype))
106 type (nth 2 vectype))
107 (setq type (or vectype 'u8)
108 vectype nil)))
109 (cond
110 ((eq type 'eval)
111 (if field
112 (setq struct (cons (cons field (eval len t)) struct))
113 (eval len t)))
114 ((eq type 'fill)
115 (setq bindat-idx (+ bindat-idx len)))
116 ((eq type 'align)
117 (while (/= (% bindat-idx len) 0)
118 (setq bindat-idx (1+ bindat-idx))))
119 ((eq type 'struct)
120 (bindat--length-group
121 (if field (bindat-get-field struct field) struct) (eval len t)))
122 ((eq type 'repeat)
123 (let ((index 0) (count len))
124 (while (< index count)
125 (bindat--length-group
126 (nth index (bindat-get-field struct field))
127 (nthcdr tail item))
128 (setq index (1+ index)))))
129 ((eq type 'union)
130 (with-suppressed-warnings ((lexical tag))
131 (defvar tag))
132 (let ((tag len) (cases (nthcdr tail item)) case cc)
133 (while cases
134 (setq case (car cases)
135 cases (cdr cases)
136 cc (car case))
137 (if (or (equal cc tag) (equal cc t)
138 (and (consp cc) (eval cc t)))
139 (progn
140 (bindat--length-group struct (cdr case))
141 (setq cases nil))))))
142 (t
143 (if (setq type (assq type bindat--fixed-length-alist))
144 (setq len (* len (cdr type))))
145 (if field
146 (setq last (bindat-get-field struct field)))
147 (setq bindat-idx (+ bindat-idx len))))))))
148
149 (defun bindat--pack-group (struct spec)
150 (with-suppressed-warnings ((lexical struct last))
151 (defvar struct) (defvar last))
152 (let ((struct struct) last)
153 (while spec
154 (let* ((item (car spec))
155 (field (car item))
156 (type (nth 1 item))
157 (len (nth 2 item))
158 (vectype (and (eq type 'vec) (nth 3 item)))
159 (tail 3))
160 (setq spec (cdr spec))
161 (if (and (consp field) (eq (car field) 'eval))
162 (setq field (eval (car (cdr field)) t)))
163 (if (and type (consp type) (eq (car type) 'eval))
164 (setq type (eval (car (cdr type)) t)))
165 (if (and len (consp len) (eq (car len) 'eval))
166 (setq len (eval (car (cdr len)) t)))
167 (if (memq field '(eval fill align struct union))
168 (setq tail 2
169 len type
170 type field
171 field nil))
172 (if (and (consp len) (not (eq type 'eval)))
173 (setq len (apply #'bindat-get-field struct len)))
174 (if (not len)
175 (setq len 1))
176 (cond
177 ((eq type 'eval)
178 (if field
179 (setq struct (cons (cons field (eval len t)) struct))
180 (eval len t)))
181 ((eq type 'fill)
182 (setq bindat-idx (+ bindat-idx len)))
183 ((eq type 'align)
184 (while (/= (% bindat-idx len) 0)
185 (setq bindat-idx (1+ bindat-idx))))
186 ((eq type 'struct)
187 (bindat--pack-group
188 (if field (bindat-get-field struct field) struct) (eval len t)))
189 ((eq type 'repeat)
190 (let ((index 0) (count len))
191 (while (< index count)
192 (bindat--pack-group
193 (nth index (bindat-get-field struct field))
194 (nthcdr tail item))
195 (setq index (1+ index)))))
196 ((eq type 'union)
197 (with-suppressed-warnings ((lexical tag))
198 (defvar tag))
199 (let ((tag len) (cases (nthcdr tail item)) case cc)
200 (while cases
201 (setq case (car cases)
202 cases (cdr cases)
203 cc (car case))
204 (if (or (equal cc tag) (equal cc t)
205 (and (consp cc) (eval cc t)))
206 (progn
207 (bindat--pack-group struct (cdr case))
208 (setq cases nil))))))
209 (t
210 (setq last (bindat-get-field struct field))
211 (bindat--pack-item last type len vectype)
212 ))))))
213 '';
2147 config = let
2158 creds = usr.secrets.weechat.credentials;
2169 in ''
21912 weechat-complete-nick-postfix ": "
22013 weechat-read-marker-always-show t
22114 weechat-max-nick-length 12
222 ;weechat-modules '(weechat-button weechat-complete weechat-spelling weechat-tracking weechat-notifications weechat-image weechat-read-marker weechat-color))
223 weechat-modules '(weechat-button weechat-complete weechat-spelling weechat-tracking weechat-image weechat-read-marker weechat-color))
15 ;weechat-modules '(weechat-button weechat-complete weechat-spelling weechat-tracking weechat-notifications weechat-image weechat-read-marker weechat-color)
16 weechat-modules '(weechat-button weechat-complete weechat-spelling weechat-tracking weechat-image weechat-read-marker weechat-color)
17 weechat-buffer-kill-buffers-on-disconnect t
18 weechat-buffer-line-limit 2000
19 weechat-initial-lines 256
20 weechat-input-ring-size 64
21 weechat-mode-default 'ssl
22 weechat-port-default 6697
23 weechat-return-always-replace-input nil
24 weechat-sync-active-buffer t
25 weechat-sync-buffer-read-status t)
22426 ;(setq weechat-auto-monitor-buffers '("weechat" "relay.list" "fset" "exec.0"))
22527 (setq weechat-color-list '(unspecified "aquamarine4" "PaleGreen3" "LemonChiffon4" "burlywood" "LightGoldenrod2" "tan2" "LightSalmon2" "coral2" "IndianRed3" "IndianRed" "MediumPurple3" "PaleVioletRed2" "HotPink3" "CadetBlue" "SteelBlue3" "DarkSeaGreen"))
22628 (dolist (module weechat-modules nil)
7777 Unit.Documentation = service.Unit.Documentation;
7878 Socket.ListenStream = "%t/emacs/server";
7979 Socket.Symlinks = "%h/.emacs.d/server/server";
80 Socket.DirectoryMode="700";
80 Socket.DirectoryMode="500";
8181 Install.WantedBy = [ "sockets.target" ];
8282 };
8383 };