;;;###autoload
(defun sieve-upload (&optional name)
(interactive)
- (when (or (get-buffer sieve-buffer) (call-interactively 'sieve-manage))
- (let ((script (buffer-string)) err)
+ (when (or (get-buffer sieve-buffer)
+ (save-current-buffer (call-interactively 'sieve-manage)))
+ (let ((script (buffer-string))
+ (script-name (file-name-sans-extension (buffer-name)))
+ err)
(with-current-buffer (get-buffer sieve-buffer)
(setq err (sieve-manage-putscript
- (or name sieve-buffer-script-name (buffer-name))
+ (or name sieve-buffer-script-name script-name)
script sieve-manage-buffer))
(if (sieve-manage-ok-p err)
(message (substitute-command-keys