-
Notifications
You must be signed in to change notification settings - Fork 11
/
kit.el
executable file
·34 lines (31 loc) · 1015 Bytes
/
kit.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
#!/usr/bin/emacs --script
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NAME
;; kit.el ---- an example elisp script, which is
;; used to calculate intern salary.
;;
;; USAGE
;; emacs -Q --script kit.el iday
;; ./kit.el iday
;;
;; NOTE
;; #!/ shebang works for emacs22 and later.
;;
;; AUTHOR
;; Aborn Jiang (aborn.jiang@gmail.com)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;(print argv)
(message "input argument are %s" argv)
(message "system-type:%s system-name:%s" system-type system-name)
(defun cal-salary (iday)
"Calculate the salary for intern in shanghai"
(interactive "p")
(setq total (* iday 180))
(if (> total 800)
(setq value (+ 800 (* 0.8 (- total 800)))
tvalue (- total value)) ;; if true
(setq value total ;; else part
tvalue 0))
(message "You have worked %d day(s), and salary is %d, tax is %d." iday value tvalue)
)
(cal-salary (string-to-number (elt argv 0)))