From 7a7e356657b6801b3a029d31c2f715593b28c2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Thu, 20 Feb 2025 19:46:40 +0000 Subject: [PATCH] Remove unnecessary functions --- custom/capture.el | 16 ++++++++-------- custom/dwuser.el | 23 ++++++----------------- snippets/org-mode/dwcut | 4 ---- snippets/org-mode/dwuser | 4 ---- snippets/org-mode/siteuser | 4 ---- 5 files changed, 14 insertions(+), 37 deletions(-) delete mode 100644 snippets/org-mode/dwcut delete mode 100644 snippets/org-mode/dwuser delete mode 100644 snippets/org-mode/siteuser diff --git a/custom/capture.el b/custom/capture.el index e38893e..dc08326 100644 --- a/custom/capture.el +++ b/custom/capture.el @@ -102,14 +102,14 @@ (insert "* places\n** visited")) (insert "\n** visited")))) - (defun finddw () - "Find or create heading for DW posts" + (defun findweb () + "Find or create heading for website posts" (filedate) (goto-char (point-min)) - (if (not (search-forward "* dw" nil t)) + (if (not (search-forward "* post" nil t)) (progn (goto-char (point-max)) - (insert "* dw")))) + (insert "* post")))) (defun therating () "Rate some media" @@ -195,10 +195,6 @@ (file+function "" findread) "* %^{Author} /%^{Title}/%(therating)%(theworkbook)" :jump-to-captured t) - ("d" "DW post" entry - (file+function "" finddw) - "* %^{Title}\n%?" - :jump-to-captured t) ("f" "Watched film" entry (file+function "" findwatched) "* %^{Title} (%^{Year})%(therating)" @@ -227,6 +223,10 @@ (file+function "" findreading) "* %^{Author} /%^{Title}/%(theworkbook)\n%(bookcalc)%?" :jump-to-captured t) + ("w" "Website post" entry + (file+function "" findweb) + "* %^{Title}\n%?" + :jump-to-captured t) ("1" "Completed game" entry (file+function "" findhundred) "* %^{Title} (%setconsole)" diff --git a/custom/dwuser.el b/custom/dwuser.el index 5c75e7c..19dfeb8 100644 --- a/custom/dwuser.el +++ b/custom/dwuser.el @@ -2,25 +2,14 @@ "Insert HTML link to a DW personal account" (interactive) (setq theuser (read-string "DW username: ")) - (setq ao3 (y-or-n-p "For AO3?")) - (if ao3 - (insert (concat "" theuser "")) - (insert (concat "\"[personal" theuser "")))) + (setq userdisplay (subst-char-in-string ?- ?_ theuser)) + (setq userlink (subst-char-in-string ?_ ?- theuser)) + (insert (concat "~" userdisplay ""))) (defun dwcomm () "Insert HTML link to a DW community" (interactive) (setq theuser (read-string "DW comm name: ")) - (setq ao3 (y-or-n-p "For AO3?")) - (if ao3 - (insert (concat "" theuser "")) - (insert (concat "\"[community" theuser "")))) - -(defun ao3user () - "Insert HTML link to an AO3 user" - (interactive) - (setq theuser (read-string "AO3 username: ")) - (setq ao3 (y-or-n-p "For AO3?")) - (if ao3 - (insert (concat "" theuser "")) - (insert (concat "\"[archiveofourown.org" theuser "")))) + (setq userdisplay (subst-char-in-string ?- ?_ theuser)) + (setq userlink (subst-char-in-string ?_ ?- theuser)) + (insert (concat "/" userdisplay ""))) diff --git a/snippets/org-mode/dwcut b/snippets/org-mode/dwcut deleted file mode 100644 index 657299c..0000000 --- a/snippets/org-mode/dwcut +++ /dev/null @@ -1,4 +0,0 @@ -# name: dreamwidth-cut -# key: dwcut -# -- -@@html:@@$0@@html:@@ \ No newline at end of file diff --git a/snippets/org-mode/dwuser b/snippets/org-mode/dwuser deleted file mode 100644 index 8027c2f..0000000 --- a/snippets/org-mode/dwuser +++ /dev/null @@ -1,4 +0,0 @@ -# name: dreamwidth-user -# key: dwuser -# -- -@@html:@@$0 \ No newline at end of file diff --git a/snippets/org-mode/siteuser b/snippets/org-mode/siteuser deleted file mode 100644 index d63f4bf..0000000 --- a/snippets/org-mode/siteuser +++ /dev/null @@ -1,4 +0,0 @@ -# name: site-user -# key: siteuser -# -- -@@html:@@$0 \ No newline at end of file