-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path040_operate_emacs.el
66 lines (46 loc) · 1.21 KB
/
040_operate_emacs.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
54
55
56
57
58
59
60
61
62
63
64
65
66
;; 040_ useful to configure emacs
;; To run: M-x ielm RET
;; To run buffer: M-x eval-buffer
;; To run ONE line; M-x eval-region
;; **Position AFTER code; C-x C-e evaluates**
(+ 4 5)
(emacs-version)
buffer-file-name
;; function
(defun add-nums (+ a b) )
(add-nums 2 3)
;; load, import library
(require 'ert)
;; return logical
(equal 5 5)
;; if-then
(if (< 0 4) "yes" "no")
;; predicate; no space before p
(numberp 1.1) ;; t
(numberp "a") ;; nil
;; REGISTERS
;; set-register to open a file (C-x C-3 AFTER code)
(set-register ?i (cons 'file "~/code/elisp_project/second"))
(set-register ?r (cons 'file "~/code/docs/tech_notes/310_R_notes.qmd")
(set-register ?z (cons 'file "~/code/elisp_project/second"))
;; position AFTER ) C-x C-e
(buffer-file-name)
;; evaluates to itsef
'(5 6 "A")
;;
?A
;; 10
?\n
?C-c
;; ^c
(kbd "C-c")
;; list, self-evaluates to itself?
;; but a macro, would evaluate (??)
[1 2 (+ 1 2)]
[+ 2 (+ 1 2)]
(+ 2 (+ 1 2))
;; REGISTERS (put in init.el)
;; set-register to open a file (C-x C-3 AFTER code)
(set-register ?i (cons 'file "~/code/elisp_project/second"))
(set-register ?r (cons 'file "~/code/docs/tech_notes/310_R_notes.qmd")
(set-register ?z (cons 'file "~/code/elisp_project/second"))