From dea44d7d39aeb8b1f28c314f0991dbc1fdd35ecc Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 30 Jul 2018 19:53:54 +0200 Subject: [PATCH] Move commands from zim.el to the Org config --- configuration.org | 24 ++++++++++++++++++++++++ init.el | 1 - lisp/zim.el | 19 ------------------- 3 files changed, 24 insertions(+), 20 deletions(-) delete mode 100644 lisp/zim.el diff --git a/configuration.org b/configuration.org index 412376d..3f64bad 100644 --- a/configuration.org +++ b/configuration.org @@ -629,6 +629,30 @@ Copied from https://ryuslash.org/posts/C-d-to-close-eshell.html (message "I will zone out after idling for 60 seconds.")) #+END_SRC +** Utility functions for editing Zim wiki files + +#+BEGIN_SRC emacs-lisp +(defun zim-timestamp () + (with-temp-buffer + (insert (format-time-string "%Y-%m-%dT%H:%M:%S%z")) + (forward-char -2) + (insert ":") + (buffer-string))) + +(defun insert-zim-timestamp () + (interactive) + (insert (zim-timestamp))) + +(defun insert-zim-header () + (interactive) + (save-excursion + (goto-char (point-min)) + (insert + (concat "Content-Type: text/x-zim-wiki\n" + "Wiki-Format: zim 0.4\n" + "Creation-Date: " (zim-timestamp) "\n\n")))) +#+END_SRC + * UI preferences ** Tweak window chrome diff --git a/init.el b/init.el index 3508b5a..22fba5c 100644 --- a/init.el +++ b/init.el @@ -28,7 +28,6 @@ ;; Load my own functions (load "gnu-c-header") (load "round-number-to-decimals") -(load "zim") (load "window-manip") ;; From gmane.emacs.orgmode diff --git a/lisp/zim.el b/lisp/zim.el deleted file mode 100644 index d4f422c..0000000 --- a/lisp/zim.el +++ /dev/null @@ -1,19 +0,0 @@ -(defun zim-timestamp () - (with-temp-buffer - (insert (format-time-string "%Y-%m-%dT%H:%M:%S%z")) - (forward-char -2) - (insert ":") - (buffer-string))) - -(defun insert-zim-timestamp () - (interactive) - (insert (zim-timestamp))) - -(defun insert-zim-header () - (interactive) - (save-excursion - (goto-char (point-min)) - (insert - (concat "Content-Type: text/x-zim-wiki\n" - "Wiki-Format: zim 0.4\n" - "Creation-Date: " (zim-timestamp) "\n\n"))))