From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Keiichi Suzuki Newsgroups: gmane.emacs.bugs Subject: printify-region Date: 30 Jul 2003 11:25:26 +0900 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1059539097 12110 80.91.224.249 (30 Jul 2003 04:24:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2003 04:24:57 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 30 06:24:55 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19hiWF-00039A-00 for ; Wed, 30 Jul 2003 06:24:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19hiW8-0003Dq-Ad for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jul 2003 00:24:48 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19hhKi-0004DT-MT for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2003 23:08:56 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19hgrN-0003wA-5t for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2003 22:38:37 -0400 Original-Received: from vs-kg004.ocn.ad.jp ([210.232.239.83]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19hgem-0003EO-Mv for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2003 22:25:36 -0400 Original-Received: from sgc002.ocn.ne.jp (vc-kg002.ocn.ad.jp [211.129.14.106]) by vs-kg004.ocn.ad.jp (Postfix) with SMTP id 491591798 for ; Wed, 30 Jul 2003 11:25:27 +0900 (JST) Original-Received: from suzuki-kei.meidensha-mobile.jp (p3001-ipbffx01atuta2.shizuoka.ocn.ne.jp [219.162.137.1]) by sgc002.ocn.ne.jp (Postfix) with ESMTP id 2262C1571 for ; Wed, 30 Jul 2003 11:25:25 +0900 (JST) Original-To: bug-gnu-emacs@gnu.org X-Face: 0HQ&#IHug\fiylKRC^d:J+!+[je8r1v"r7GU:GkB{MNpfAz@SM-+1s0#L)PeKq=-0^[P2S; WClrugwLtM'\$"Jp3z)RiLVj8@0/te.QtuixK$2(7~F'_-M7kgZT_k`BIBAa,_ X-URI: http://www.nanap.org/ Original-Lines: 43 User-Agent: Nana-gnus/7.1.0.32 SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/2.00-Beta2-dev (WOMINAHESHI) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:5456 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5456 `printify-region()' ends conversion before the expected position. A patch from the CVS HEAD is following. -------- 8>< -------- 8>< -------- 8>< -------- 8>< -------- Index: lpr.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/lpr.el,v retrieving revision 1.63 diff -u -u -r1.63 lpr.el --- lpr.el 4 Feb 2003 11:34:44 -0000 1.63 +++ lpr.el 30 Jul 2003 02:14:56 -0000 @@ -283,14 +283,16 @@ 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. -------- 8>< -------- 8>< -------- 8>< -------- 8>< -------- -- Keiichi Suzuki / keiichi@nanap.org PGP finger print (DH/DSS) 0B32 B37E 6DE9 3BC1 68A4 4089 7AAF 2B03 ECBD 614B