diff options
Diffstat (limited to 'sx-compose.el')
-rw-r--r-- | sx-compose.el | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sx-compose.el b/sx-compose.el index eb5e2eb..e3f9c00 100644 --- a/sx-compose.el +++ b/sx-compose.el @@ -193,8 +193,7 @@ tags. Return a list of already inserted tags." 'noerror) (error "No Tags header found")) (save-match-data - (split-string (match-string 1) (rx (any space ",;")) - 'omit-nulls (rx space)))) + (sx--split-string (match-string 1) (rx (any space ",;"))))) (defun sx-compose--check-tags () "Check if tags in current compose buffer are valid." @@ -295,15 +294,14 @@ Keywords meant to be used in `sx-method-call'. `body' is read as the `buffer-string'. If IS-QUESTION is non-nil, other keywords are read from the header " + (goto-char (point-min)) `(,@(when is-question (let ((inhibit-point-motion-hooks t) - (inhibit-read-only t) (header-end (next-single-property-change (point-min) 'sx-compose-separator)) keywords) ;; Read the Title. - (goto-char (point-min)) (unless (search-forward-regexp "^Title: *\\(.*\\) *$" header-end 'noerror) (error "No Title header found")) @@ -313,16 +311,13 @@ other keywords are read from the header " (unless (search-forward-regexp "^Tags : *\\([^[:space:]].*\\) *$" header-end 'noerror) (error "No Tags header found")) - (push (cons 'tags (split-string (match-string 1) - "[[:space:],;]" 'omit-nulls)) + (push (cons 'tags (sx--split-string (match-string 1) "[[:space:],;]")) keywords) - ;; And erase the header so it doesn't get sent. - (delete-region - (point-min) - (next-single-property-change - header-end 'sx-compose-separator)) + ;; And move past the header so it doesn't get sent. + (goto-char (next-single-property-change + header-end 'sx-compose-separator)) keywords)) - (body . ,(buffer-string)))) + (body . ,(buffer-substring-no-properties (point) (point-max))))) (defun sx-compose--get-buffer-create (site data) "Get or create a buffer for use with `sx-compose-mode'. |