+2012-07-18 Julien Danjou <julien@danjou.info>
+
+ * sieve-mode.el (sieve-mode-map): Bind C-c C-c to
+ `sieve-upload-and-kill'.
+
+ * sieve.el (sieve-bury-buffer): Remove function.
+ (sieve-manage-mode-map): Map "q" to `kill-buffer'.
+ (sieve-upload-and-kill): New function, mapped to C-c C-c.
+
2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
* shr.el (shr-expand-url): Handle URL starting with `//'.
(defvar sieve-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-l" 'sieve-upload)
- (define-key map "\C-c\C-c" 'sieve-upload-and-bury)
+ (define-key map "\C-c\C-c" 'sieve-upload-and-kill)
(define-key map "\C-c\C-m" 'sieve-manage)
map)
"Key map used in sieve mode.")
;; various
(define-key map "?" 'sieve-help)
(define-key map "h" 'sieve-help)
- (define-key map "q" 'sieve-bury-buffer)
+ (define-key map "q" 'kill-buffer)
;; activating
(define-key map "m" 'sieve-activate)
(define-key map "u" 'sieve-deactivate)
(message "%s" (substitute-command-keys
"`\\[sieve-edit-script]':edit `\\[sieve-activate]':activate `\\[sieve-deactivate]':deactivate `\\[sieve-remove]':remove"))))
-(defun sieve-bury-buffer (buf &optional mainbuf)
- "Hide the buffer BUF that was temporarily popped up.
-BUF is assumed to be a temporary buffer used from the buffer MAINBUF."
- (interactive (list (current-buffer)))
- (save-current-buffer
- (let ((win (if (eq buf (window-buffer (selected-window))) (selected-window)
- (get-buffer-window buf t))))
- (when win
- (if (window-dedicated-p win)
- (condition-case ()
- (delete-window win)
- (error (iconify-frame (window-frame win))))
- (if (and mainbuf (get-buffer-window mainbuf))
- (delete-window win)))))
- (with-current-buffer buf
- (bury-buffer (unless (and (eq buf (window-buffer (selected-window)))
- (not (window-dedicated-p (selected-window))))
- buf)))
- (when mainbuf
- (let ((mainwin (or (get-buffer-window mainbuf)
- (get-buffer-window mainbuf 'visible))))
- (when mainwin (select-window mainwin))))))
-
;; Create buffer:
(defun sieve-setup-buffer (server port)
(sieve-upload name)
(bury-buffer))
+;;;###autoload
+(defun sieve-upload-and-kill (&optional name)
+ (interactive)
+ (sieve-upload name)
+ (kill-buffer))
+
(provide 'sieve)
;; sieve.el ends here