From 5bfb2e94894e03be62dd16fd80c5d0d0babc1fca Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sun, 18 Jun 2017 21:08:42 +0200 Subject: [PATCH] Fix field addition when using rst. --- pelican-mode.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican-mode.el b/pelican-mode.el index 15db6cf..fe4eea0 100644 --- a/pelican-mode.el +++ b/pelican-mode.el @@ -103,15 +103,19 @@ (defun pelican-set-field (field value) "Set FIELD to VALUE." + (interactive "sField: \nsValue: ") (save-excursion (goto-char 0) (if (re-search-forward (concat "^" (pelican-field field ".+*")) nil t) (replace-match (pelican-field field value)) + (re-search-forward "#") + (forward-line 2) (re-search-forward "^$") (replace-match (pelican-field field value))))) (defun pelican-set-title (title) "Set the title to TITLE." + (interactive "sTitle: ") (if (pelican-is-markdown) (pelican-set-field "title" title) (save-excursion -- 2.30.2