# HG changeset patch # User Chong Yidong # Date 1290284606 18000 # Node ID acd0ffe11c18654ab8a4bbe4a3ce98f25ac5b873 # Parent 70ad6f6f15c7db0a91c507d3bd5c44a1b36446d9 Prompt before running print commands. * lpr.el (lpr-buffer, print-buffer, lpr-region, print-region): Prompt user before actually printing. diff -r 70ad6f6f15c7 -r acd0ffe11c18 lisp/ChangeLog --- a/lisp/ChangeLog Sat Nov 20 14:52:20 2010 -0500 +++ b/lisp/ChangeLog Sat Nov 20 15:23:26 2010 -0500 @@ -1,7 +1,13 @@ +2010-11-20 Chong Yidong + + * lpr.el (lpr-buffer, print-buffer, lpr-region, print-region): + Prompt user before actually printing. + 2010-11-18 Stefan Monnier * simple.el (kill-new, kill-append, kill-region): - * comint.el (comint-kill-region): Make the yank-handler argument obsolete. + * comint.el (comint-kill-region): Make the yank-handler argument + obsolete. 2010-11-17 Stefan Monnier diff -r 70ad6f6f15c7 -r acd0ffe11c18 lisp/lpr.el --- a/lisp/lpr.el Sat Nov 20 14:52:20 2010 -0500 +++ b/lisp/lpr.el Sat Nov 20 15:23:26 2010 -0500 @@ -152,7 +152,9 @@ "Print buffer contents without pagination or page headers. See the variables `lpr-switches' and `lpr-command' for customization of the printer command." - (interactive) + (interactive + (unless (y-or-n-p "Send current buffer to default printer? ") + (error "Cancelled"))) (print-region-1 (point-min) (point-max) lpr-switches nil)) ;;;###autoload @@ -169,7 +171,9 @@ See the variables `lpr-switches' and `lpr-command' for further customization of the printer command." - (interactive) + (interactive + (unless (y-or-n-p "Send current buffer to default printer? ") + (error "Cancelled"))) (print-region-1 (point-min) (point-max) lpr-switches t)) ;;;###autoload @@ -177,7 +181,10 @@ "Print region contents without pagination or page headers. See the variables `lpr-switches' and `lpr-command' for customization of the printer command." - (interactive "r") + (interactive + (if (y-or-n-p "Send selected text to default printer? ") + (list (region-beginning) (region-end)) + (error "Cancelled"))) (print-region-1 start end lpr-switches nil)) ;;;###autoload @@ -194,7 +201,10 @@ See the variables `lpr-switches' and `lpr-command' for further customization of the printer command." - (interactive "r") + (interactive + (if (y-or-n-p "Send selected text to default printer? ") + (list (region-beginning) (region-end)) + (error "Cancelled"))) (print-region-1 start end lpr-switches t)) (defun print-region-1 (start end switches page-headers)