diff options
Diffstat (limited to 'lisp/ps-print.el')
-rw-r--r-- | lisp/ps-print.el | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 8bf3d91607d..3f0538fa3c3 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -4734,8 +4734,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th (ps-output 'prologue (if (stringp args) (list args) args))) (defun ps-flush-output () - (save-excursion - (set-buffer ps-spool-buffer) + (with-current-buffer ps-spool-buffer (goto-char (point-max)) (while ps-output-head (let ((it (car ps-output-head))) @@ -4756,8 +4755,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th (defun ps-insert-file (fname) (ps-flush-output) - (save-excursion - (set-buffer ps-spool-buffer) + (with-current-buffer ps-spool-buffer (goto-char (point-max)) (insert-file-contents fname))) @@ -4840,8 +4838,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th (defun ps-get-boundingbox () - (save-excursion - (set-buffer ps-spool-buffer) + (with-current-buffer ps-spool-buffer (save-excursion (if (re-search-forward ps-boundingbox-re nil t) (vector (string-to-number ; lower x @@ -4909,8 +4906,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th ;; coordinate adjustment to center image ;; around x and y position (let ((box (ps-get-boundingbox))) - (save-excursion - (set-buffer ps-spool-buffer) + (with-current-buffer ps-spool-buffer (save-excursion (if (re-search-backward "^--back--" nil t) (replace-match @@ -5795,8 +5791,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-line-number-step ps-zebra-stripe-height)))) ;; spooling buffer - (save-excursion - (set-buffer ps-spool-buffer) + (with-current-buffer ps-spool-buffer (goto-char (point-max)) (and (re-search-backward "^%%Trailer$" nil t) (delete-region (match-beginning 0) (point-max)))) @@ -6573,8 +6568,7 @@ If FACE is not a valid face name, use default face." (and ps-razzle-dazzle (message "Wrote %s" filename))) ;; Else, spool to the printer (and ps-razzle-dazzle (message "Printing...")) - (save-excursion - (set-buffer ps-spool-buffer) + (with-current-buffer ps-spool-buffer (let* ((coding-system-for-write 'raw-text-unix) (ps-printer-name (or ps-printer-name (and (boundp 'printer-name) |