From d8ce7b6ccede65bb2e0c6aece9cccee7ecce5f73 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 7 Oct 2012 13:19:23 +0200 Subject: .emacs.d/site-lisp/eltuki.el --- .emacs.d/site-lisp/eltuki.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '.emacs.d/site-lisp/eltuki.el') diff --git a/.emacs.d/site-lisp/eltuki.el b/.emacs.d/site-lisp/eltuki.el index cc5d1b3..4815108 100644 --- a/.emacs.d/site-lisp/eltuki.el +++ b/.emacs.d/site-lisp/eltuki.el @@ -84,8 +84,8 @@ (let ((newtime (format-time-string " %s"))) (if (re-search-forward "^#\\+TIMESTAMP:\\(.*\\)$" nil t) (replace-match newtime nil t nil 1) - (search-forward "\n\n") - (backward-char) + (when (search-forward "\n\n" nil t) + (backward-char)) (insert "#+TIMESTAMP:" newtime "\n"))))) (defun eltuki-get-tags () @@ -102,8 +102,8 @@ (goto-char (point-min)) (if (re-search-forward "^#\\+TAGS:\\(.*\\)$" nil t) (replace-match tags t t nil 1) - (search-forward "\n\n") - (backward-char) + (when (search-forward "\n\n" nil t) + (backward-char)) (insert "#+TAGS:" tags "\n")))) (defun eltuki-get-status () @@ -123,8 +123,8 @@ " draft"))) (if (re-search-forward "^#\\+STATUS:\\(.*\\)$" nil t) (replace-match newstatus t t nil 1) - (search-forward "\n\n") - (backward-char) + (when (search-forward "\n\n" nil t) + (backward-char)) (insert "#+STATUS:" newstatus "\n"))))) (defun eltuki-get-comment-status () @@ -145,8 +145,8 @@ " closed"))) (if (re-search-forward "^#\\+COMMENTSTATUS:\\(.*\\)$" nil t) (replace-match newstatus t t nil 1) - (search-forward "\n\n") - (backward-char) + (when (search-forward "\n\n" nil t) + (backward-char)) (insert "#+COMMENTSTATUS:" newstatus "\n"))))) (defun eltuki-slugify-string (str) -- cgit v1.2.3-54-g00ecf