From: Joe Wreschnig Date: Sun, 18 Jun 2017 19:08:42 +0000 (+0200) Subject: Fix field addition when using rst. X-Git-Tag: v20170807~35 X-Git-Url: https://git.korewanetadesu.com/?a=commitdiff_plain;h=5bfb2e94894e03be62dd16fd80c5d0d0babc1fca;p=pelican-mode.git Fix field addition when using rst. --- 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