aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-02-08 06:35:50 +0000
committerRichard M. Stallman1995-02-08 06:35:50 +0000
commit8fa64b34f50dc9092d430b71dfeb90e64908d350 (patch)
tree6d295afd148a47945a6f96c5301441609cea7724
parentd75f49aa5a11b800be4935a917949062f956c4ca (diff)
downloademacs-8fa64b34f50dc9092d430b71dfeb90e64908d350.tar.gz
emacs-8fa64b34f50dc9092d430b71dfeb90e64908d350.zip
(print-region-new-buffer): Return new start and end.
(print-region-1): Use new calling convention.
-rw-r--r--lisp/lpr.el27
1 files changed, 15 insertions, 12 deletions
diff --git a/lisp/lpr.el b/lisp/lpr.el
index b05d8a18891..e331060e9b9 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -97,8 +97,8 @@ See definition of `print-region-1' for calling conventions.")
97 (save-excursion 97 (save-excursion
98 (message "Spooling...") 98 (message "Spooling...")
99 (if (/= tab-width 8) 99 (if (/= tab-width 8)
100 (progn 100 (let ((new-coords (print-region-new-buffer start end)))
101 (print-region-new-buffer start end) 101 (setq start (car new-coords) end (cdr new-coords))
102 (setq tab-width width) 102 (setq tab-width width)
103 (save-excursion 103 (save-excursion
104 (goto-char end) 104 (goto-char end)
@@ -113,7 +113,8 @@ See definition of `print-region-1' for calling conventions.")
113 lpr-headers-switches) 113 lpr-headers-switches)
114 switches)) 114 switches))
115 ;; Run a separate program to get page headers. 115 ;; Run a separate program to get page headers.
116 (print-region-new-buffer start end) 116 (let ((new-coords (print-region-new-buffer start end)))
117 (setq start (car new-coords) end (cdr new-coords)))
117 (apply 'call-process-region start end lpr-page-header-program 118 (apply 'call-process-region start end lpr-page-header-program
118 t t nil 119 t t nil
119 (nconc (and lpr-add-switches 120 (nconc (and lpr-add-switches
@@ -134,16 +135,18 @@ See definition of `print-region-1' for calling conventions.")
134 (message "Spooling...done")))) 135 (message "Spooling...done"))))
135 136
136;; This function copies the text between start and end 137;; This function copies the text between start and end
137;; into a new buffer, makes that buffer current, 138;; into a new buffer, makes that buffer current.
138;; and sets start and end to the buffer bounds. 139;; It returns the new range to print from the new current buffer
139;; start and end are used free. 140;; as (START . END).
141
140(defun print-region-new-buffer (ostart oend) 142(defun print-region-new-buffer (ostart oend)
141 (or (string= (buffer-name) " *spool temp*") 143 (if (string= (buffer-name) " *spool temp*")
142 (let ((oldbuf (current-buffer))) 144 (cons ostart oend)
143 (set-buffer (get-buffer-create " *spool temp*")) 145 (let ((oldbuf (current-buffer)))
144 (widen) (erase-buffer) 146 (set-buffer (get-buffer-create " *spool temp*"))
145 (insert-buffer-substring oldbuf ostart oend) 147 (widen) (erase-buffer)
146 (setq start (point-min) end (point-max))))) 148 (insert-buffer-substring oldbuf ostart oend)
149 (cons (point-min) (point-max)))))
147 150
148(defun printify-region (begin end) 151(defun printify-region (begin end)
149 "Turn nonprinting characters (other than TAB, LF, SPC, RET, and FF) 152 "Turn nonprinting characters (other than TAB, LF, SPC, RET, and FF)