aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-05-06 13:38:02 -0300
committerStefan Monnier2011-05-06 13:38:02 -0300
commit6c19f744bb93693e848d4045891733688cbcb9eb (patch)
tree58afbf43275ff479fdec3d5e599658abdb577cb5
parentaf4c0e284957da53404fbdd7c80fe0f5c22f8599 (diff)
downloademacs-6c19f744bb93693e848d4045891733688cbcb9eb.tar.gz
emacs-6c19f744bb93693e848d4045891733688cbcb9eb.zip
* lisp/lpr.el (print-region-1): Echo lpr-program's output, so error messages
and warnings are not silently discarded (e.g. use "-d" instead of "-P").
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/lpr.el41
2 files changed, 31 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 01c646412d4..ce62ee3cccf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lpr.el (print-region-1): Echo lpr-program's output, so error messages
4 and warnings are not silently discarded (e.g. use "-d" instead of "-P").
5
12011-05-06 Glenn Morris <rgm@gnu.org> 62011-05-06 Glenn Morris <rgm@gnu.org>
2 7
3 * calendar/appt.el (appt-message-warning-time): Doc fix. 8 * calendar/appt.el (appt-message-warning-time): Doc fix.
diff --git a/lisp/lpr.el b/lisp/lpr.el
index 709f992b2b8..76c69f3308c 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -29,6 +29,8 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(eval-when-compile (require 'cl))
33
32;;;###autoload 34;;;###autoload
33(defvar lpr-windows-system 35(defvar lpr-windows-system
34 (memq system-type '(ms-dos windows-nt))) 36 (memq system-type '(ms-dos windows-nt)))
@@ -258,21 +260,30 @@ for further customization of the printer command."
258 lpr-page-header-switches))) 260 lpr-page-header-switches)))
259 (setq start (point-min) 261 (setq start (point-min)
260 end (point-max)))) 262 end (point-max))))
261 (apply (or print-region-function 'call-process-region) 263 (let ((buf (current-buffer)))
262 (nconc (list start end lpr-command 264 (with-temp-buffer
263 nil nil nil) 265 (let ((tempbuf (current-buffer)))
264 (and lpr-add-switches 266 (with-current-buffer buf
265 (list "-J" name)) 267 (apply (or print-region-function 'call-process-region)
266 ;; These belong in pr if we are using that. 268 (nconc (list start end lpr-command
267 (and lpr-add-switches lpr-headers-switches 269 nil tempbuf nil)
268 (list "-T" title)) 270 (and lpr-add-switches
269 (and (stringp printer-name) 271 (list "-J" name))
270 (list (concat lpr-printer-switch 272 ;; These belong in pr if we are using that.
271 printer-name))) 273 (and lpr-add-switches lpr-headers-switches
272 nswitches)) 274 (list "-T" title))
273 (if (markerp end) 275 (and (stringp printer-name)
274 (set-marker end nil)) 276 (list (concat lpr-printer-switch
275 (message "Spooling%s...done" switch-string)))) 277 printer-name)))
278 nswitches))))
279 (if (markerp end)
280 (set-marker end nil))
281 (message "Spooling%s...done%s%s" switch-string
282 (case (count-lines (point-min) (point-max))
283 (0 "")
284 (1 ": ")
285 (t ":\n"))
286 (buffer-string)))))))
276 287
277;; This function copies the text between start and end 288;; This function copies the text between start and end
278;; into a new buffer, makes that buffer current. 289;; into a new buffer, makes that buffer current.