-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelisp-goodies.el
80 lines (71 loc) · 2.95 KB
/
elisp-goodies.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
;; tea-timer (after X minutes, no repeat)
(defun fbr/tea-timer(minutes)
"my function for timing tee"
(interactive "nHow many minutes does the tea need? ")
;; setup
(require 'alert)
(setq alert-default-style 'libnotify)
;; actual command
;; smiley-code: \xF0\x9F\x98\x84
;; hourglass-code: \xE2\x8C\x9B
;; Listing: http://apps.timwhitlock.info/emoji/tables/unicode
(run-with-timer (* minutes 60) nil 'alert "Tea is ready \xF0\x9F\x98\x84" :title "Tea-time")
)
(defun fbr/reload-yasnippet ()
(interactive)
(yas-recompile-all)
(yas-reload-all)
)
;; (shell-command "Msg asd")
;; (call-process "~\\.emacs.d\\notifu\\notifu.exe" nil t nil "/m" "aads" "/d" "10000" "/i" "~\\emacs.d\\emacs.ico")
;; ;; ich brauche start-process
;; (start-process "my-process" "~\\.emacs.d\\notifu\\notifu.exe" "/m" "aads" "/d" "10000" "/i" "~\\emacs.d\\emacs.ico")
;; (start-process "my-process" "~/.emacs.d/notifu/notifu.exe" "/m" "aads" "/d" "10000")
;; (defun execvp (&rest args)
;; "Simulate C's execvp() function.
;; Quote each argument seperately, join with spaces and call shell-command-to-string to run in a shell."
;; (let ((cmd (mapconcat 'shell-quote-argument args " ")))
;; (shell-command-to-string cmd)))
;; (shell-command-to-string "echo ")
;; (start-process "mvn-exec" "~\.emacs.d\notifu\notifu.exe" "/m" "aads" "/d" "10000" )
;; (setq debug-on-error t)
;; Correct orglzy formatting
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html#SEC_Contents
(defun fbr/my-orgzly-reformatting ()
"Reformat the file to undo changes from orgzly"
(interactive)
(setq m (mark-marker))
(beginning-of-buffer)
(while (re-search-forward "^\*.*" nil t)
(next-line)
(if (looking-at "^$")
;; delete the current line if it's empty without sending it to kill-ring
(let ((beg (progn (forward-line 0)
(point))))
(forward-line 1)
(delete-region beg (point)))
nil ;; else part does nothing
)
)
(set-mark-command m)
)
;; The idea of an external script:
;; http://emacs.stackexchange.com/questions/12148/how-to-pretty-format-code-auto-insert-newlines-indent-etc
;; das multiple-line flag aus perl nutzen, einfach ein perl script über die aktuelle datei laufen lassen
;; Settings to make the org-article pdf work
;; (setq org-export-with-broken-links t)
;; (require 'ox-latex)
;; (setq org-export-latex-listings t)
;; (add-to-list 'org-latex-packages-alist
;; '("AUTO" "inputenc" t))
;; (add-to-list 'org-latex-classes
;; '("org-article"
;; "\\documentclass{org-article}
;; [NO-DEFAULT-PACKAGES]
;; [PACKAGES]
;; [EXTRA]"
;; ("\\section{%s}" . "\\section*{%s}")
;; ("\\subsection{%s}" . "\\subsection*{%s}")
;; ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
;; ("\\paragraph{%s}" . "\\paragraph*{%s}")
;; ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))