aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-03-08 19:21:49 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-03-08 19:21:49 -0300
commit62e8ced2af638f3646ae53b0472b4ec3284a9cc7 (patch)
tree1cd1528bb76ca896185c1ebc0950ad7e2cc2c92a
parenta9555faec10dbdde9c27888fa3892406a325d90d (diff)
Don't erase question headers when sending. Fix #271
-rw-r--r--sx-compose.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/sx-compose.el b/sx-compose.el
index ae13fb6..e3f9c00 100644
--- a/sx-compose.el
+++ b/sx-compose.el
@@ -294,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"))
@@ -314,13 +313,11 @@ other keywords are read from the header "
(error "No Tags header found"))
(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'.