From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: strip extraneous CR characters Date: Mon, 28 Sep 2009 10:01:24 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87y6nzf70b.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254150155 1755 80.91.229.12 (28 Sep 2009 15:02:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Sep 2009 15:02:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 28 17:02:28 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 1MsHk9-0007aY-LH for ged-emacs-devel@m.gmane.org; Mon, 28 Sep 2009 17:02:26 +0200 Original-Received: from localhost ([127.0.0.1]:38755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsHk9-0004hx-5B for ged-emacs-devel@m.gmane.org; Mon, 28 Sep 2009 11:02:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsHk0-0004ho-Uy for emacs-devel@gnu.org; Mon, 28 Sep 2009 11:02:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsHjv-0004h0-Ev for emacs-devel@gnu.org; Mon, 28 Sep 2009 11:02:15 -0400 Original-Received: from [199.232.76.173] (port=36555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsHju-0004gn-JP for emacs-devel@gnu.org; Mon, 28 Sep 2009 11:02:10 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:55111) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MsHjt-0005Vt-HG for emacs-devel@gnu.org; Mon, 28 Sep 2009 11:02:10 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MsHjm-0007Rb-SJ for emacs-devel@gnu.org; Mon, 28 Sep 2009 17:02:02 +0200 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Sep 2009 17:02:02 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Sep 2009 17:02:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:rV8oSWH5w8VPJ2AUfqZK1hDcxLI= 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:115722 Archived-At: This code in Gnus' nnheader.el was also useful for the imap-hash.el I put into Emacs recently: ;; from nnheader.el (defsubst imap-hash-remove-cr-followed-by-lf () (goto-char (point-max)) (while (search-backward "\r\n" nil t) (delete-char 1))) ;; from nnheader.el (defun imap-hash-ms-strip-cr (&optional string) "Strip ^M from the end of all lines in current buffer or STRING." (if string (with-temp-buffer (insert string) (imap-hash-remove-cr-followed-by-lf) (buffer-string)) (save-excursion (imap-hash-remove-cr-followed-by-lf)))) I wonder if it makes sense to define these functions globally? They are not trivial, though the implementation is short. Thanks Ted