summaryrefslogtreecommitdiff
path: root/lisp/lpr.el
diff options
context:
space:
mode:
authorVinicius Jose Latorre <viniciusjl@ig.com.br>2003-08-01 23:40:00 +0000
committerVinicius Jose Latorre <viniciusjl@ig.com.br>2003-08-01 23:40:00 +0000
commit5a1173cba051ce5e8d943898bf69d18f7440053e (patch)
treeeeaabcdb5634351260d632d8c2be2ae8180c1f28 /lisp/lpr.el
parent674dd916f1fbabaecb1645da8672e72c4a6018f9 (diff)
downloademacs-5a1173cba051ce5e8d943898bf69d18f7440053e.tar.gz
printify-region fix
Diffstat (limited to 'lisp/lpr.el')
-rw-r--r--lisp/lpr.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/lpr.el b/lisp/lpr.el
index 4d1ec5d77e7..7b827704cad 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -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
@@ -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.