Fix completing-read, don’t use tabs, don’t lock into org-format

master
trémeur 1 year ago
parent c61d26f465
commit 9814f3a36b

@ -141,6 +141,12 @@ Make new directories automatically (from [[https://emacsredux.com/blog/2022/06/1
(add-to-list 'find-file-not-found-functions #'er-auto-create-missing-dirs)
#+END_SRC
Indent using spaces.
#+BEGIN_SRC emacs-lisp
(setq-default indent-tabs-mode nil)
#+END_SRC
** OS-specific stuff
On Linux, I have to tell Emacs to use Chrome for web links.

@ -44,30 +44,18 @@
(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")
(setq security (completing-read "Security (public, access, private): " '("public" "access" "private")))
(if (equal security "")
(sleep-for 0)
(insert (concat "post-security: "
(let* ((securityjunk
(format "%S" security))
(end (- (length securityjunk) 2)))
(substring securityjunk 2 end))"\n")))))
(insert (concat "post-security: " security "\n")))))
(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")
(setq mood (completing-read "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 (equal mood "")
(sleep-for 0)
(insert (concat "post-mood: "
(let* ((moodjunk
(format "%S" mood))
(end (- (length moodjunk) 2)))
(substring moodjunk 2 end))"\n")))))
(insert (concat "post-mood: " mood "\n")))))
(unless (string-equal system-type "android")
(defun dwmusic ()

@ -1,7 +1,7 @@
(defun fic-ao3 ()
"Format fic for posting to AO3 and export it"
(interactive)
(org-format)
;; (org-format)
(save-buffer)
(goto-char (point-min))
(while (re-search-forward "\\[fn:.*\\]" nil t)
@ -63,7 +63,7 @@
(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)
;; (org-format)
(save-buffer)
(goto-char (point-min))
(while (re-search-forward "\\[fn:\\([0-9]*\\):\\(.*\\)\\]" nil t)

Loading…
Cancel
Save