From 09ed893f1f09fb5954f3adfa96d904db1f4c1834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sat, 2 Jul 2022 21:15:51 +0100 Subject: [PATCH] Add org format function --- agenda-common.el | 1 + custom/org-format.el | 17 +++++++++++++++++ init.el | 2 -- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 custom/org-format.el diff --git a/agenda-common.el b/agenda-common.el index 7c4525e..1febe62 100644 --- a/agenda-common.el +++ b/agenda-common.el @@ -1,4 +1,5 @@ (setq org-agenda-show-current-time-in-grid nil) +(setq org-extend-today-until 3) (setq org-agenda-skip-scheduled-if-done t) (setq org-agenda-skip-deadline-if-done t) (setq org-agenda-skip-timestamp-if-done t) diff --git a/custom/org-format.el b/custom/org-format.el new file mode 100644 index 0000000..764c99a --- /dev/null +++ b/custom/org-format.el @@ -0,0 +1,17 @@ +(defun org-format () + (interactive) + (goto-char (region-beginning)) + (while (re-search-forward " -" nil t) + (replace-match " –")) + (goto-char (region-beginning)) + (while (re-search-forward "'" nil t) + (replace-match "’")) + (goto-char (region-beginning)) + (while (re-search-forward "\\R\"" nil t) + (replace-match "\\R“")) + (goto-char (region-beginning)) + (while (re-search-forward " \"" nil t) + (replace-match " “")) + (goto-char (region-beginning)) + (while (re-search-forward "\"" nil t) + (replace-match "”"))) diff --git a/init.el b/init.el index b8d380d..18de9c9 100644 --- a/init.el +++ b/init.el @@ -284,8 +284,6 @@ (setq org-startup-with-inline-images "inlineimages") (setq org-image-actual-width '(300)) -(setq org-extend-today-until 3) - (load-file "~/.emacs.d/agenda-common.el") ;; for agenda things used in both emacs and batch