]> git.eshelyaron.com Git - emacs.git/commitdiff
printify-region fix
authorVinicius Jose Latorre <viniciusjl@ig.com.br>
Fri, 1 Aug 2003 23:40:00 +0000 (23:40 +0000)
committerVinicius Jose Latorre <viniciusjl@ig.com.br>
Fri, 1 Aug 2003 23:40:00 +0000 (23:40 +0000)
lisp/ChangeLog
lisp/lpr.el

index 556f82d38449977f5d5b79d65b649b5e52c304e6..d3667cdb0ca380384acfc655c28705de2dd39050 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-01  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * lpr.el (printify-region): It was ending conversion before the
+       expected position.  Reported by Keiichi Suzuki <keiichi@nanap.org>.
+
 2003-07-31  John Paul Wallington  <jpw@gnu.org>
 
        * net/browse-url.el (browse-url-epiphany): Doc fix.
index 4d1ec5d77e7b7e5166d03c265bbf122652900be2..7b827704cad331dd1dc5b48f4d6fe44d6f6dd694 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
@@ -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.