Add Android functionality

master
trémeur 1 year ago
parent cd9c277a69
commit 0c96e9885c

File diff suppressed because it is too large Load Diff

@ -41,101 +41,109 @@
(with-current-buffer oldname
(delete-file newname)))
(defun dwsecurity ()
"Set security level for DW post"
(setq security (completing-read-multiple "Security (public, access, private): " '("public" "access" "private")))
(if (not security)
(setq security "skip"))
(if (equal security "skip")
(sleep-for 0)
(unless (string-equal system-type "android")
(defun dwsecurity ()
"Set security level for DW post"
(setq security (completing-read-multiple "Security (public, access, private): " '("public" "access" "private")))
(if (not security)
(setq security "skip"))
(if (equal security "skip")
(sleep-for 0)
(insert (concat "post-security: "
(let* ((securityjunk
(format "%S" security))
(end (- (length securityjunk) 2)))
(substring securityjunk 2 end))"\n"))))
(let* ((securityjunk
(format "%S" security))
(end (- (length securityjunk) 2)))
(substring securityjunk 2 end))"\n")))))
(defun dwmood ()
"Set mood for DW post"
(setq mood (completing-read-multiple "Mood: " '("accomplished" "aggravated" "amused" "angry" "annoyed" "anxious" "apathetic" "artistic" "awake" "bitchy" "blah" "blank" "bored" "bouncy" "busy" "calm" "cheerful" "chipper" "cold" "complacent" "confused" "contemplative" "content" "cranky" "crappy" "crazy" "creative" "crushed" "curious" "cynical" "depressed" "determined" "devious" "dirty" "disappointed" "discontent" "distressed" "ditzy" "dorky" "drained" "drunk" "ecstatic" "embarrassed" "energetic" "enraged" "enthralled" "envious" "exanimate" "excited" "exhausted" "flirty" "frustrated" "full" "geeky" "giddy" "giggly" "gloomy" "good" "grateful" "groggy" "grumpy" "guilty" "happy" "high" "hopeful" "horny" "hot" "hungry" "hyper" "impressed" "indescribable" "indifferent" "infuriated" "intimidated" "irate" "irritated" "jealous" "jubilant" "lazy" "lethargic" "listless" "lonely" "loved" "melancholy" "mellow" "mischievous" "moody" "morose" "naughty" "nauseated" "nerdy" "nervous" "nostalgic" "numb" "okay" "optimistic" "peaceful" "pensive" "pessimistic" "pissed off" "pleased" "predatory" "productive" "quixotic" "recumbent" "refreshed" "rejected" "rejuvenated" "relaxed" "relieved" "restless" "rushed" "sad" "satisfied" "scared" "shocked" "sick" "silly" "sleepy" "sore" "stressed" "surprised" "sympathetic" "thankful" "thirsty" "thoughtful" "tired" "touched" "uncomfortable" "weird" "working" "worried")))
(if (not mood)
(setq mood "skip"))
(if (equal mood "skip")
(sleep-for 0)
(unless (string-equal system-type "android")
(defun dwmood ()
"Set mood for DW post"
(setq mood (completing-read-multiple "Mood: " '("accomplished" "aggravated" "amused" "angry" "annoyed" "anxious" "apathetic" "artistic" "awake" "bitchy" "blah" "blank" "bored" "bouncy" "busy" "calm" "cheerful" "chipper" "cold" "complacent" "confused" "contemplative" "content" "cranky" "crappy" "crazy" "creative" "crushed" "curious" "cynical" "depressed" "determined" "devious" "dirty" "disappointed" "discontent" "distressed" "ditzy" "dorky" "drained" "drunk" "ecstatic" "embarrassed" "energetic" "enraged" "enthralled" "envious" "exanimate" "excited" "exhausted" "flirty" "frustrated" "full" "geeky" "giddy" "giggly" "gloomy" "good" "grateful" "groggy" "grumpy" "guilty" "happy" "high" "hopeful" "horny" "hot" "hungry" "hyper" "impressed" "indescribable" "indifferent" "infuriated" "intimidated" "irate" "irritated" "jealous" "jubilant" "lazy" "lethargic" "listless" "lonely" "loved" "melancholy" "mellow" "mischievous" "moody" "morose" "naughty" "nauseated" "nerdy" "nervous" "nostalgic" "numb" "okay" "optimistic" "peaceful" "pensive" "pessimistic" "pissed off" "pleased" "predatory" "productive" "quixotic" "recumbent" "refreshed" "rejected" "rejuvenated" "relaxed" "relieved" "restless" "rushed" "sad" "satisfied" "scared" "shocked" "sick" "silly" "sleepy" "sore" "stressed" "surprised" "sympathetic" "thankful" "thirsty" "thoughtful" "tired" "touched" "uncomfortable" "weird" "working" "worried")))
(if (not mood)
(setq mood "skip"))
(if (equal mood "skip")
(sleep-for 0)
(insert (concat "post-mood: "
(let* ((moodjunk
(format "%S" mood))
(end (- (length moodjunk) 2)))
(substring moodjunk 2 end))"\n"))))
(let* ((moodjunk
(format "%S" mood))
(end (- (length moodjunk) 2)))
(substring moodjunk 2 end))"\n")))))
(defun dwmusic ()
"Set current music for DW post"
(setq music (lastfm-user-get-recent-tracks :user lastfm-user :from 1 :to 1))
(setq music (replace-regexp-in-string (regexp-quote "\" \"") " " (format "%S" music) nil 'literal))
(sleep-for 1)
(if (not music)
(setq music "nil"))
(if (equal music "nil")
(sleep-for 0)
(insert (concat "post-music: "
(let* ((musicjunk
(format "%S" music))
(end (- (length musicjunk) 4)))
(substring musicjunk 4 end))"\n"))))
(unless (string-equal system-type "android")
(defun dwmusic ()
"Set current music for DW post"
(setq music (lastfm-user-get-recent-tracks :user lastfm-user :from 1 :to 1))
(setq music (replace-regexp-in-string (regexp-quote "\" \"") " " (format "%S" music) nil 'literal))
(sleep-for 1)
(if (not music)
(setq music "nil"))
(if (equal music "nil")
(sleep-for 0)
(insert (concat "post-music: "
(let* ((musicjunk
(format "%S" music))
(end (- (length musicjunk) 4)))
(substring musicjunk 4 end))"\n")))))
(defun dwicon (thefile)
"Set icon for DW post"
(setq icon "skip")
(load-file dw-iconfile)
(with-current-buffer thefile
(iconchoose))
(if (equal icon "skip")
(sleep-for 0)
(insert (concat "post-icon: "icon "\n"))))
(unless (string-equal system-type "android")
(defun dwicon (thefile)
"Set icon for DW post"
(setq icon "skip")
(load-file dw-iconfile)
(with-current-buffer thefile
(iconchoose))
(if (equal icon "skip")
(sleep-for 0)
(insert (concat "post-icon: "icon "\n")))))
(defun dwlocation ()
"Set location for DW post"
(setq location (read-string "Location: " dw-defaultlocation))
(if (equal location "")
(sleep-for 0)
(insert (concat "post-location: " location "\n"))))
(unless (string-equal system-type "android")
(defun dwlocation ()
"Set location for DW post"
(setq location (read-string "Location: " dw-defaultlocation))
(if (equal location "")
(sleep-for 0)
(insert (concat "post-location: " location "\n")))))
(defun dwmusic-manual ()
"Set current music for DW post if lastfm.el not set up"
(setq music (read-string "Music: "))
(if (equal music "")
(sleep-for 0)
(insert (concat "post-music: " music "\n"))))
(unless (string-equal system-type "android")
(defun dwmusic-manual ()
"Set current music for DW post if lastfm.el not set up"
(setq music (read-string "Music: "))
(if (equal music "")
(sleep-for 0)
(insert (concat "post-music: " music "\n")))))
(defun dw-posted ()
"Log DW post"
(find-file-noselect "~/Documents/drive/org/calendar/habit.org")
(with-current-buffer "habit.org"
(goto-char (point-min))
(re-search-forward "RECUR dw posts")
(org-shiftright)
(sleep-for 1)
(save-buffer)))
(unless (string-equal system-type "android")
(defun dw-posted ()
"Log DW post"
(find-file-noselect "~/Documents/drive/org/calendar/habit.org")
(with-current-buffer "habit.org"
(goto-char (point-min))
(re-search-forward "RECUR dw posts")
(org-shiftright)
(sleep-for 4)
(save-buffer))))
(defun dwpost (psubject tags)
"Post to DW"
(interactive (list (read-string "Post title (REQUIRED): ")
(read-string "Tags (comma-separated): ")))
(dwexport)
(compose-mail (concat dw-username "+" dw-pin "@post.dreamwidth.org") psubject)
(with-current-buffer (concat "*unsent mail to " dw-username "*")
(insert (concat "post-tags: org-export, " tags "\n"))
(dwsecurity)
(dwlocation)
(dwicon newname)
(cond
(lastfm-login t (dwmusic))
((dwmusic-manual)))
(dwmood)
(insert (concat "\n"))
(insert-file-contents newname)
(message-send-and-exit))
(kill-buffer newname)
(kill-buffer (concat "*sent mail to " dw-username "*"))
(with-current-buffer oldname
(delete-file newname))
(dw-posted))
(unless (string-equal system-type "android")
(defun dwpost (psubject tags)
"Post to DW"
(interactive (list (read-string "Post title (REQUIRED): ")
(read-string "Tags (comma-separated): ")))
(dwexport)
(compose-mail (concat dw-username "+" dw-pin "@post.dreamwidth.org") psubject)
(with-current-buffer (concat "*unsent mail to " dw-username "*")
(insert (concat "post-tags: org-export, " tags "\n"))
(dwsecurity)
(dwlocation)
(dwicon newname)
(cond
(lastfm-login t (dwmusic))
((dwmusic-manual)))
(dwmood)
(insert (concat "\n"))
(insert-file-contents newname)
(message-send-and-exit))
(kill-buffer newname)
(kill-buffer (concat "*sent mail to " dw-username "*"))
(with-current-buffer oldname
(delete-file newname))
(dw-posted)))

@ -44,199 +44,200 @@
(with-current-buffer oldname
(delete-file newname)))
(defun fic-export ()
"Export fic to HTML, EPUB, PDF"
(interactive)
(shell-command "cp ~/.emacs.d/fic-export-files/FFXYevon.ttf .")
(setq asal (y-or-n-p "ASAL?"))
(if asal
(unless (string-equal system-type "android")
(defun fic-export ()
"Export fic to HTML, EPUB, PDF"
(interactive)
(shell-command "cp ~/.emacs.d/fic-export-files/FFXYevon.ttf .")
(setq asal (y-or-n-p "ASAL?"))
(if asal
(progn
(setq title t)
(setq multichapter t)
(setq chaptertitles nil)
(setq ffx t))
(progn
(setq title t)
(setq multichapter t)
(setq chaptertitles nil)
(setq ffx t))
(progn
(setq title (y-or-n-p "Use the fic title in exports?"))
(setq multichapter (y-or-n-p "Multichapter?"))
(if multichapter
(setq chaptertitles (y-or-n-p "Titled chapters?")))
(setq ffx (y-or-n-p "FFX fic?"))))
(setq draftmode (y-or-n-p "Edit LaTeX file manually?"))
(org-format)
(save-buffer)
(goto-char (point-min))
(while (re-search-forward "\\[fn:\\([0-9]*\\):\\(.*\\)\\]" nil t)
(replace-match "@@html:<label for=\"\\1\" class=\"margin-toggle sidenote-number\"></label><input type=\"checkbox\" id=\"\\1\" class=\"margin-toggle\"/><span class=\"sidenote\">\\2</span>@@@@latex:\\\\footnote{\\2}@@"))
(let ((user-full-name "ovely")
(org-html-head "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"/><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin/><link href=\"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,700;1,400;1,700&display=swap\" rel=\"stylesheet\"/><link rel=\"stylesheet\" href=\"/fic/tufte.css\"/>"))
(org-html-export-to-html)
(org-latex-export-to-latex))
(revert-buffer t t)
(setq htmlfile (concat (file-name-base) ".html"))
(find-file-noselect htmlfile)
(with-current-buffer htmlfile
(goto-char (point-min))
(while (re-search-forward "<div id=\"content\"" nil t)
(replace-match "<article id=\"content\""))
(goto-char (point-min))
(while (re-search-forward "<div id=\"outline-container-" nil t)
(replace-match "<section id=\"outline-container-"))
(goto-char (point-min))
(while (re-search-forward "</div>\n</div>" nil t)
(replace-match "</div>\n</section>"))
(goto-char (point-min))
(while (re-search-forward "<hr />\n\n<p>" nil t)
(replace-match "</section>\n<section>\n<p class=\"newthought\">"))
(goto-char (point-min))
(while (re-search-forward "<hr>\n\n<p>" nil t)
(replace-match "</section>\n<section>\n<p class=\"newthought\">"))
(goto-char (point-min))
(while (re-search-forward "<div class=\"outline-text-2\" id=\".*\">" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "<div id=\"postamble\" class=\"status\">" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "<p class=\"validation\"><a href=.*>Validate</a></p>" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "</div>" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "section-number-2\">\\([0-9]*\\)<" nil t)
(replace-match "section-number-2\">\\1\.<"))
(goto-char (point-min))
(while (re-search-forward "<p class=\"author.*</p>" nil t)
(replace-match ""))
(setq title (y-or-n-p "Use the fic title in exports?"))
(setq multichapter (y-or-n-p "Multichapter?"))
(if multichapter
(setq chaptertitles (y-or-n-p "Titled chapters?")))
(setq ffx (y-or-n-p "FFX fic?"))))
(setq draftmode (y-or-n-p "Edit LaTeX file manually?"))
(org-format)
(save-buffer)
(goto-char (point-min))
(while (re-search-forward "\n\n</body>" nil t)
(replace-match "\n</article>\n</body>"))
(if (not title)
(while (re-search-forward "\\[fn:\\([0-9]*\\):\\(.*\\)\\]" nil t)
(replace-match "@@html:<label for=\"\\1\" class=\"margin-toggle sidenote-number\"></label><input type=\"checkbox\" id=\"\\1\" class=\"margin-toggle\"/><span class=\"sidenote\">\\2</span>@@@@latex:\\\\footnote{\\2}@@"))
(let ((user-full-name "ovely")
(org-html-head "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"/><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin/><link href=\"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,700;1,400;1,700&display=swap\" rel=\"stylesheet\"/><link rel=\"stylesheet\" href=\"/fic/tufte.css\"/>"))
(org-html-export-to-html)
(org-latex-export-to-latex))
(revert-buffer t t)
(setq htmlfile (concat (file-name-base) ".html"))
(find-file-noselect htmlfile)
(with-current-buffer htmlfile
(goto-char (point-min))
(while (re-search-forward "<div id=\"content\"" nil t)
(replace-match "<article id=\"content\""))
(goto-char (point-min))
(while (re-search-forward "<div id=\"outline-container-" nil t)
(replace-match "<section id=\"outline-container-"))
(goto-char (point-min))
(while (re-search-forward "</div>\n</div>" nil t)
(replace-match "</div>\n</section>"))
(goto-char (point-min))
(while (re-search-forward "<hr />\n\n<p>" nil t)
(replace-match "</section>\n<section>\n<p class=\"newthought\">"))
(goto-char (point-min))
(while (re-search-forward "<hr>\n\n<p>" nil t)
(replace-match "</section>\n<section>\n<p class=\"newthought\">"))
(goto-char (point-min))
(while (re-search-forward "<div class=\"outline-text-2\" id=\".*\">" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "<div id=\"postamble\" class=\"status\">" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "<p class=\"validation\"><a href=.*>Validate</a></p>" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "</div>" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "section-number-2\">\\([0-9]*\\)<" nil t)
(replace-match "section-number-2\">\\1\.<"))
(goto-char (point-min))
(while (re-search-forward "<p class=\"author.*</p>" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "\n\n</body>" nil t)
(replace-match "\n</article>\n</body>"))
(if (not title)
(progn
(goto-char (point-min))
(while (re-search-forward "<h1.*" nil t)
(replace-match ""))))
(if multichapter
(if (not chaptertitles)
(progn
(goto-char (point-min))
(while (re-search-forward "<span class=\"section-number-.*</span>" nil t)
(replace-match ""))))
(progn
(goto-char (point-min))
(while (re-search-forward "<h1.*" nil t)
(while (re-search-forward "<h2.*" nil t)
(replace-match ""))))
(if multichapter
(if (not chaptertitles)
(progn
(goto-char (point-min))
(while (re-search-forward "<span class=\"section-number-.*</span>" nil t)
(replace-match ""))))
(progn
(goto-char (point-min))
(while (re-search-forward "<h2.*" nil t)
(replace-match ""))))
(save-buffer)
(kill-current-buffer))
(setq texfile (concat (file-name-base) ".tex"))
(find-file-noselect texfile)
(with-current-buffer texfile
(shell-command
(format "pandoc %s -o %s.epub"
(shell-quote-argument (buffer-file-name))
(shell-quote-argument (file-name-base))))
(goto-char (point-min))
(while (re-search-forward "label{\\(.*\\)}\n\\([A-Z]\\)\\([a-z]*\\)" nil t)
(replace-match "label{\\1}\n\\\\lettrine{\\2}{\\3}"))
(goto-char (point-min))
(while (re-search-forward "label{\\(.*\\)}\n\\([A-Z]\\)\\([a-z]*\\)" nil t)
(replace-match "label{\\1}\n\\\\lettrine{“\\2}{\\3}"))
(if ffx
(save-buffer)
(kill-current-buffer))
(setq texfile (concat (file-name-base) ".tex"))
(find-file-noselect texfile)
(with-current-buffer texfile
(shell-command
(format "pandoc %s -o %s.epub"
(shell-quote-argument (buffer-file-name))
(shell-quote-argument (file-name-base))))
(goto-char (point-min))
(while (re-search-forward "label{\\(.*\\)}\n\\([A-Z]\\)\\([a-z]*\\)" nil t)
(replace-match "label{\\1}\n\\\\lettrine{\\2}{\\3}"))
(goto-char (point-min))
(while (re-search-forward "label{\\(.*\\)}\n\\([A-Z]\\)\\([a-z]*\\)" nil t)
(replace-match "label{\\1}\n\\\\lettrine{“\\2}{\\3}"))
(if ffx
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\noindent\\\\rule{\\\\textwidth}{0.5pt}" nil t)
(replace-match "\\sepffx" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\noindent\\\\rule{\\\\textwidth}{0.5pt}" nil t)
(replace-match "\\sepffx" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\noindent\\\\rule{\\\\textwidth}{0.5pt}" nil t)
(replace-match "\\sephim" nil t))))
(if multichapter
(if title
(if asal
(replace-match "\\sephim" nil t))))
(if multichapter
(if title
(if asal
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match "\\begin{titlingpage}\n\\titleasal\n\\end{titlingpage}" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match "\\begin{titlingpage}\n\\titleasal\n\\end{titlingpage}" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match "\\begin{titlingpage}\n\\titlegen\n\\end{titlingpage}" nil t))))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match ""))))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match ""))))
(if multichapter
(if (not chaptertitles)
(replace-match "\\begin{titlingpage}\n\\titlegen\n\\end{titlingpage}" nil t))))
(progn
(goto-char (point-min))
(while (re-search-forward "namechapters" nil t)
(replace-match "nonamechapters"))))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\chapter.*" nil t)
(replace-match ""))
(if title
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\\\begin{document}\n\\\\chapter\*{\\\\thetitle}"))))))
(if multichapter
(if title
(if chaptertitles
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match ""))))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\maketitle" nil t)
(replace-match ""))))
(if multichapter
(if (not chaptertitles)
(progn
(goto-char (point-min))
(while (re-search-forward "namechapters" nil t)
(replace-match "nonamechapters"))))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\chapter.*" nil t)
(replace-match ""))
(if title
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\\\begin{document}\n\\\\chapter\*{\\\\thetitle}"))))))
(if multichapter
(if title
(if chaptertitles
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{multititlechapters}" nil t))
(goto-char (point-min))
(while (re-search-forward "\\\\end{titlingpage}" nil t)
(replace-match "\\end{titlingpage}\n\\tableofcontents\*" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{multititlechapters}" nil t))
(replace-match "\\begin{document}\n\\pagestyle{multititlenochapters}" nil t))))
(if chaptertitles
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\end{titlingpage}" nil t)
(replace-match "\\end{titlingpage}\n\\tableofcontents\*" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{multititlenochapters}" nil t))))
(if chaptertitles
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{multinotitlechapters}\n\\tableofcontents\*" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{multinotitlechapters}\n\\tableofcontents\*" nil t)))
(replace-match "\\begin{document}\n\\pagestyle{multinotitlenochapters}" nil t)))))
(if title
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{multinotitlenochapters}" nil t)))))
(if title
(replace-match "\\begin{document}\n\\pagestyle{singletitle}" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{singletitle}" nil t)))
(progn
(goto-char (point-min))
(while (re-search-forward "\\\\begin{document}" nil t)
(replace-match "\\begin{document}\n\\pagestyle{plain}" nil t)))))
(goto-char (point-max))
(save-buffer)
(replace-match "\\begin{document}\n\\pagestyle{plain}" nil t)))))
(goto-char (point-max))
(save-buffer)
(unless draftmode
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name))))
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name)))))
(kill-current-buffer))
(unless draftmode
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name))))
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name)))))
(kill-current-buffer))
(unless draftmode
(delete-file "FFXYevon.ttf")
(if (file-exists-p (concat (file-name-base) ".aux"))
(delete-file (concat (file-name-base) ".aux")))
(if (file-exists-p (concat (file-name-base) ".log"))
(delete-file (concat (file-name-base) ".log")))
(if (file-exists-p (concat (file-name-base) ".out"))
(delete-file (concat (file-name-base) ".out")))
(if (file-exists-p (concat (file-name-base) ".toc"))
(delete-file (concat (file-name-base) ".toc")))
(if (file-exists-p "texput.log")
(delete-file "texput.log"))
(delete-file texfile))
(message "Done"))
(delete-file "FFXYevon.ttf")
(if (file-exists-p (concat (file-name-base) ".aux"))
(delete-file (concat (file-name-base) ".aux")))
(if (file-exists-p (concat (file-name-base) ".log"))
(delete-file (concat (file-name-base) ".log")))
(if (file-exists-p (concat (file-name-base) ".out"))
(delete-file (concat (file-name-base) ".out")))
(if (file-exists-p (concat (file-name-base) ".toc"))
(delete-file (concat (file-name-base) ".toc")))
(if (file-exists-p "texput.log")
(delete-file "texput.log"))
(delete-file texfile))
(message "Done")))

@ -1,6 +1,7 @@
(setq periodfile (concat (file-name-as-directory fileroot) "admin/emacs/period.org"))
(defun periodise ()
"Return day of menstrual cycle"
(setq periodfile "~/Documents/drive/admin/emacs/period.org")
(find-file-noselect periodfile)
(setq thebuffer (file-name-nondirectory periodfile))
(with-current-buffer thebuffer
@ -20,7 +21,6 @@
(defun menstruate ()
"Mark beginning of menstrual cycle"
(interactive)
(setq periodfile "~/Documents/drive/admin/emacs/period.org")
(find-file-noselect periodfile)
(setq thebuffer (file-name-nondirectory periodfile))
(with-current-buffer thebuffer

@ -1,4 +1,6 @@
(load-file "~/Documents/drive/admin/emacs/daysoff.el")
(if (string-equal system-type "android")
(load-file "/storage/emulated/0/Documents/admin/emacs/daysoff.el")
(load-file "~/Documents/drive/admin/emacs/daysoff.el"))
(defcustom workday nil
"Returns true on working days"

Loading…
Cancel
Save