From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: [PATCH] xml-escape-region Date: Wed, 7 Oct 2009 14:56:31 -0400 Organization: Merrill Print Message-ID: <200910071456.31966.danc@merrillprint.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1254941821 9192 80.91.229.12 (7 Oct 2009 18:57:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Oct 2009 18:57:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 07 20:56:52 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mvbgw-0007lZ-5x for ged-emacs-devel@m.gmane.org; Wed, 07 Oct 2009 20:56:50 +0200 Original-Received: from localhost ([127.0.0.1]:38086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mvbgv-0006DS-LO for ged-emacs-devel@m.gmane.org; Wed, 07 Oct 2009 14:56:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mvbgo-0006CP-Kh for emacs-devel@gnu.org; Wed, 07 Oct 2009 14:56:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mvbgj-00069Y-Ht for emacs-devel@gnu.org; Wed, 07 Oct 2009 14:56:42 -0400 Original-Received: from [199.232.76.173] (port=40638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mvbgh-00069I-NI for emacs-devel@gnu.org; Wed, 07 Oct 2009 14:56:35 -0400 Original-Received: from vpn.merrillpress.com ([64.61.107.78]:53133) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mvbgh-0001pY-BK for emacs-devel@gnu.org; Wed, 07 Oct 2009 14:56:35 -0400 Original-Received: from pluto.merrillpress.net ([10.136.5.5] helo=pluto.localnet) by vpn.merrillpress.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Mvbge-0007uJ-V3 for emacs-devel@gnu.org; Wed, 07 Oct 2009 14:56:32 -0400 User-Agent: KMail/1.12.1 (Linux/2.6.30.5-43.fc11.i586; KDE/4.3.1; i686; ; ) X-Face: 9VC; >}hM+`K4j{H4n=pq/!61'7Rt"vEaPUdCwpS'=; @B7Ll,~Q.xb(|A>; 8M[\UzKQi{>Q Iptc6NY\M(0<{W?ob}e/91Y!k|XE:2SA2LU"cni>#Dmw4siEWG7|L9zkOZ\[nQPe9[PG|s P2n_jW\TzsG2N1Z0q:E#NmWU~0i]JE)gqB|4{jCjolaX6)KO[@k\:>01.58.Pk5Nb\5s": R,Q78_s; 6+vLj\V1y(`]\G3("(Y!G^79x}q[4L8w[.qEs|+ZN0R`Hk,>y; d7!SFx%M2M39 y[/Kc!p!:.E3Zx')v*l6IlR X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115965 Archived-At: Index: xml.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/xml.el,v retrieving revision 1.64 diff -u -r1.64 xml.el --- xml.el 5 Jan 2009 03:19:57 -0000 1.64 +++ xml.el 7 Oct 2009 18:56:08 -0000 @@ -852,6 +852,13 @@ ;; grabbing the string works here. string "")) +;;;##autoload +(defun xml-escape-region (beg end) + (interactive "*r") + (let ((escaped (xml-escape-string (buffer-substring beg end)))) + (delete-region beg end) + (insert escaped))) + (defun xml-debug-print-internal (xml indent-string) "Outputs the XML tree in the current buffer. The first line is indented with INDENT-STRING."