Browse code
refactor(emacs): add fwoar: prefix to more functions
Edward Langley authored on 28/02/2024 08:27:50
Showing 4 changed files
Showing 4 changed files
- emacs.d/init.el
- emacs.d/lisp/configurations/org-conf.el
- emacs.d/lisp/configurations/slime-conf.el
- emacs.d/lisp/utils.el
... | ... |
@@ -151,9 +151,9 @@ |
151 | 151 |
(use-package fwoar-pastebin :ensure nil |
152 | 152 |
:custom |
153 | 153 |
(fwoar-pastebin-tramp-url (when (file-exists-p "~/.pastebin-name") |
154 |
- (car (read-sexps-in-file "~/.pastebin-name")))) |
|
154 |
+ (car (fwoar:read-sexps-in-file "~/.pastebin-name")))) |
|
155 | 155 |
(fwoar-pastebin-web-url-pattern (when (file-exists-p "~/.pastebin-name") |
156 |
- (cadr (read-sexps-in-file "~/.pastebin-name"))))) |
|
156 |
+ (cadr (fwoar:read-sexps-in-file "~/.pastebin-name"))))) |
|
157 | 157 |
|
158 | 158 |
(use-package fwoar-yank-buffer |
159 | 159 |
:init (require 'fwoar-yank-buffer) |
... | ... |
@@ -345,8 +345,8 @@ |
345 | 345 |
|
346 | 346 |
(define-key evil-insert-state-map (kbd "C-c j") 'skeleton-next-position) |
347 | 347 |
(define-key evil-insert-state-map (kbd "C-c k") 'skeleton-prev-position) |
348 |
- (evil-define-key 'normal 'global (kbd "<leader>g") 'helm-generate-lisp-skeleton) |
|
349 |
- (evil-define-key 'visual 'global (kbd "<leader>g") 'helm-generate-lisp-skeleton)) |
|
348 |
+ (evil-define-key 'normal 'global (kbd "<leader>g") 'fwoar:helm-generate-lisp-skeleton) |
|
349 |
+ (evil-define-key 'visual 'global (kbd "<leader>g") 'fwoar:helm-generate-lisp-skeleton)) |
|
350 | 350 |
|
351 | 351 |
|
352 | 352 |
(use-package htmlize |
... | ... |
@@ -513,7 +513,7 @@ |
513 | 513 |
'ibuffer) |
514 | 514 |
|
515 | 515 |
(defvar url-pattern (when (file-exists-p "~/.pastebin-name") |
516 |
- (car (read-sexps-in-file "~/.pastebin-name")))) |
|
516 |
+ (car (fwoar:read-sexps-in-file "~/.pastebin-name")))) |
|
517 | 517 |
|
518 | 518 |
(defun delete-mru-window () |
519 | 519 |
(interactive) |
... | ... |
@@ -86,15 +86,15 @@ |
86 | 86 |
(when current-form |
87 | 87 |
(cl-destructuring-bind (discriminator . packages) current-form |
88 | 88 |
(cl-case discriminator |
89 |
- (:use (remove-if (op (or (eql :cl _))) |
|
89 |
+ (:use (remove-if (fwoar:op (or (eql :cl _))) |
|
90 | 90 |
(cdr current-form))) |
91 | 91 |
(defpackage (find-use-clause |
92 | 92 |
(find-if (lambda (f) |
93 | 93 |
(and (listp f) |
94 | 94 |
(eql (car f) :use))) |
95 | 95 |
'(defpackage :tracking-sim |
96 |
- (:use :cl :alexandria :serapeum) |
|
97 |
- (:export))))))))) |
|
96 |
+ (:use :cl :alexandria :serapeum) |
|
97 |
+ (:export))))))))) |
|
98 | 98 |
|
99 | 99 |
(defun load-package-uses () |
100 | 100 |
(interactive) |
... | ... |
@@ -5,8 +5,7 @@ |
5 | 5 |
|
6 | 6 |
;;; Code: |
7 | 7 |
|
8 |
- |
|
9 |
-(defun read-sexps-in-buffer (buffer) |
|
8 |
+(defun fwoar:read-sexps-in-buffer (buffer) |
|
10 | 9 |
(with-temp-buffer |
11 | 10 |
(save-excursion |
12 | 11 |
(insert "(") |
... | ... |
@@ -15,7 +14,7 @@ |
15 | 14 |
(insert "\n)")) |
16 | 15 |
(read (current-buffer)))) |
17 | 16 |
|
18 |
-(defun read-sexps-in-file (fn) |
|
17 |
+(defun fwoar:read-sexps-in-file (fn) |
|
19 | 18 |
(with-temp-buffer |
20 | 19 |
(save-excursion |
21 | 20 |
(insert "(") |
... | ... |
@@ -24,7 +23,7 @@ |
24 | 23 |
(insert "\n)")) |
25 | 24 |
(read (current-buffer)))) |
26 | 25 |
|
27 |
-(defun read-strings-in-file (fn) |
|
26 |
+(defun fwoar:read-strings-in-file (fn) |
|
28 | 27 |
(with-temp-buffer |
29 | 28 |
(insert-file fn) |
30 | 29 |
(mark-whole-buffer) |
... | ... |
@@ -32,31 +31,32 @@ |
32 | 31 |
(goto-char (point-min)) |
33 | 32 |
(remove "" (s-lines (buffer-string))))) |
34 | 33 |
|
35 |
-(defun op--collect-args (body) |
|
34 |
+(defun fwoar::op--collect-args (body) |
|
36 | 35 |
(cl-flet ((walker (body &optional args) |
37 |
- (if (null body) |
|
38 |
- args |
|
39 |
- (if (symbolp body) |
|
40 |
- (when (eql ?\_ (elt (symbol-name body) 0)) |
|
41 |
- (cons body args)) |
|
42 |
- (if (listp body) |
|
43 |
- (append (op--collect-args (car body)) |
|
44 |
- (op--collect-args (cdr body)) |
|
45 |
- )))))) |
|
36 |
+ (if (null body) |
|
37 |
+ args |
|
38 |
+ (if (symbolp body) |
|
39 |
+ (when (eql ?\_ (elt (symbol-name body) 0)) |
|
40 |
+ (cons body args)) |
|
41 |
+ (if (listp body) |
|
42 |
+ (append (fwoar::op--collect-args (car body)) |
|
43 |
+ (fwoar::op--collect-args (cdr body)) |
|
44 |
+ )))))) |
|
46 | 45 |
(sort (walker body) |
47 | 46 |
(lambda (a b) |
48 | 47 |
(< (string-to-number (subseq (symbol-name a) 1)) |
49 | 48 |
(string-to-number (subseq (symbol-name b) 1))))))) |
50 | 49 |
|
51 |
-(defmacro op (&rest body) |
|
52 |
- `(lambda ,(op--collect-args body) |
|
50 |
+(defmacro fwoar:op (&rest body) |
|
51 |
+ `(lambda ,(fwoar::op--collect-args body) |
|
53 | 52 |
,@body)) |
54 | 53 |
|
55 |
-(defun blank-line-p () |
|
54 |
+(defun fwoar:blank-line-p () |
|
56 | 55 |
(= (current-indentation) |
57 |
- (- (line-end-position) (line-beginning-position)))) |
|
56 |
+ (- (line-end-position) |
|
57 |
+ (line-beginning-position)))) |
|
58 | 58 |
|
59 |
-(defun helm-generate-lisp-skeleton () |
|
59 |
+(defun fwoar:helm-generate-lisp-skeleton () |
|
60 | 60 |
(interactive) |
61 | 61 |
(let ((skeletons '(("defunction" . skel-defun) |
62 | 62 |
("defmacro" . skel-defmacro) |