aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/lpr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1995-02-08 06:35:50 +0000
committerRichard M. Stallman <[email protected]>1995-02-08 06:35:50 +0000
commit8fa64b34f50dc9092d430b71dfeb90e64908d350 (patch)
tree6d295afd148a47945a6f96c5301441609cea7724 /lisp/lpr.el
parentd75f49aa5a11b800be4935a917949062f956c4ca (diff)
(print-region-new-buffer): Return new start and end.
(print-region-1): Use new calling convention.
Diffstat (limited to 'lisp/lpr.el')
-rw-r--r--lisp/lpr.el27
1 files changed, 15 insertions, 12 deletions
diff --git a/lisp/lpr.el b/lisp/lpr.el
index b05d8a1889..e331060e9b 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -97,8 +97,8 @@ See definition of `print-region-1' for calling conventions.")
(save-excursion
(message "Spooling...")
(if (/= tab-width 8)
- (progn
- (print-region-new-buffer start end)
+ (let ((new-coords (print-region-new-buffer start end)))
+ (setq start (car new-coords) end (cdr new-coords))
(setq tab-width width)
(save-excursion
(goto-char end)
@@ -113,7 +113,8 @@ See definition of `print-region-1' for calling conventions.")
lpr-headers-switches)
switches))
;; Run a separate program to get page headers.
- (print-region-new-buffer start end)
+ (let ((new-coords (print-region-new-buffer start end)))
+ (setq start (car new-coords) end (cdr new-coords)))
(apply 'call-process-region start end lpr-page-header-program
t t nil
(nconc (and lpr-add-switches
@@ -134,16 +135,18 @@ See definition of `print-region-1' for calling conventions.")
(message "Spooling...done"))))
;; This function copies the text between start and end
-;; into a new buffer, makes that buffer current,
-;; and sets start and end to the buffer bounds.
-;; start and end are used free.
+;; into a new buffer, makes that buffer current.
+;; It returns the new range to print from the new current buffer
+;; as (START . END).
+
(defun print-region-new-buffer (ostart oend)
- (or (string= (buffer-name) " *spool temp*")
- (let ((oldbuf (current-buffer)))
- (set-buffer (get-buffer-create " *spool temp*"))
- (widen) (erase-buffer)
- (insert-buffer-substring oldbuf ostart oend)
- (setq start (point-min) end (point-max)))))
+ (if (string= (buffer-name) " *spool temp*")
+ (cons ostart oend)
+ (let ((oldbuf (current-buffer)))
+ (set-buffer (get-buffer-create " *spool temp*"))
+ (widen) (erase-buffer)
+ (insert-buffer-substring oldbuf ostart oend)
+ (cons (point-min) (point-max)))))
(defun printify-region (begin end)
"Turn nonprinting characters (other than TAB, LF, SPC, RET, and FF)