Fix fallout from `save-excursion' changes
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 25 Apr 2015 12:44:07 +0000 (14:44 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 25 Apr 2015 12:44:07 +0000 (14:44 +0200)
* hashcash.el (hashcash-insert-payment-async-2): Save the mark when
altering the buffer.

lisp/ChangeLog
lisp/hashcash.el

index d582dca..13d5b06 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * hashcash.el (hashcash-insert-payment-async-2): Save the mark when
+       altering the buffer.
+
 2015-04-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-uu.el (gnus-uu-save-article):
index 7017065..dd677d4 100644 (file)
@@ -252,12 +252,13 @@ Only start calculation.  Results are inserted when ready."
     (with-current-buffer buffer
       (save-excursion
        (save-restriction
-         (setq hashcash-process-alist (delq
-                                       (assq process hashcash-process-alist)
-                                       hashcash-process-alist))
-         (message-goto-eoh)
-         (when pay
-           (insert-before-markers "X-Hashcash: " pay)))))))
+         (cl-letf (((mark)))
+           (setq hashcash-process-alist (delq
+                                         (assq process hashcash-process-alist)
+                                         hashcash-process-alist))
+           (message-goto-eoh)
+           (when pay
+             (insert-before-markers "X-Hashcash: " pay))))))))
 
 (defun hashcash-cancel-async (&optional buffer)
   "Delete any hashcash processes associated with BUFFER.
@@ -317,6 +318,7 @@ for each recipient address.  Prefix arg sets default payment temporarily.
 Set ASYNC to t to start asynchronous calculation.  (See
 `mail-add-payment-async')."
   (interactive "P")
+  (debug)
   (let ((hashcash-default-payment (if arg (prefix-numeric-value arg)
                                    hashcash-default-payment))
        (addrlist nil))