]> code.delx.au - gnu-emacs/blobdiff - lisp/lpr.el
(gs-options): Add -dSAFER. Mark it risky.
[gnu-emacs] / lisp / lpr.el
index 21e82208e6abbd3107d5866a4848ec9097475829..0eac7b7ba3105442123c76cf35fe86e6c2a55e3c 100644 (file)
@@ -1,6 +1,7 @@
 ;;; lpr.el --- print Emacs buffer on line printer
 
-;; Copyright (C) 1985, 1988, 1992, 1994, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1988, 1992, 1994, 2001, 2003
+;; Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: unix
@@ -164,7 +165,7 @@ If it is nil (the default), we run the `pr' program (or whatever program
 
 Otherwise, the switches in `lpr-headers-switches' are used
 in the print command itself; we expect them to request pagination.
+
 See the variables `lpr-switches' and `lpr-command'
 for further customization of the printer command."
   (interactive)
@@ -189,7 +190,7 @@ If it is nil (the default), we run the `pr' program (or whatever program
 
 Otherwise, the switches in `lpr-headers-switches' are used
 in the print command itself; we expect them to request pagination.
+
 See the variables `lpr-switches' and `lpr-command'
 for further customization of the printer command."
   (interactive "r")
@@ -283,14 +284,16 @@ The printable representations use ^ (for ASCII control characters) or hex.
 The characters tab, linefeed, space, return and formfeed are not affected."
   (interactive "r")
   (save-excursion
-    (goto-char begin)
-    (let (c)
-      (while (re-search-forward "[\^@-\^h\^k\^n-\^_\177-\377]" end t)
-       (setq c (preceding-char))
-       (delete-backward-char 1)
-       (insert (if (< c ?\ )
-                   (format "\\^%c" (+ c ?@))
-                 (format "\\%02x" c)))))))
+    (save-restriction
+      (narrow-to-region begin end)
+      (goto-char (point-min))
+      (let (c)
+       (while (re-search-forward "[\^@-\^h\^k\^n-\^_\177-\377]" nil t)
+         (setq c (preceding-char))
+         (delete-backward-char 1)
+         (insert (if (< c ?\ )
+                     (format "\\^%c" (+ c ?@))
+                   (format "\\%02x" c))))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Functions hacked from `ps-print' package.
@@ -323,4 +326,5 @@ The characters tab, linefeed, space, return and formfeed are not affected."
 
 (provide 'lpr)
 
+;;; arch-tag: 21c3f821-ebec-4ca9-ac67-a81e4b75c62a
 ;;; lpr.el ends here