From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Ridolfi Subject: Re: org-mobile-pull & ^M ( question) Date: Fri, 6 Nov 2009 16:09:42 +0000 (GMT) Message-ID: <37453.40370.qm@web28312.mail.ukl.yahoo.com> References: <3fea10110911060749y40352f5ap3972736d1ac9755@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6RNi-0002Ss-C8 for emacs-orgmode@gnu.org; Fri, 06 Nov 2009 11:09:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6RNg-0002Rd-Oi for emacs-orgmode@gnu.org; Fri, 06 Nov 2009 11:09:45 -0500 Received: from [199.232.76.173] (port=58497 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6RNg-0002RX-El for emacs-orgmode@gnu.org; Fri, 06 Nov 2009 11:09:44 -0500 Received: from web28312.mail.ukl.yahoo.com ([87.248.110.131]:32405) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1N6RNg-0007vX-2Z for emacs-orgmode@gnu.org; Fri, 06 Nov 2009 11:09:44 -0500 In-Reply-To: <3fea10110911060749y40352f5ap3972736d1ac9755@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org, Zhichao Hong , Carsten Dominik --- Ven 6/11/09, Zhichao Hong ha scritto:=0A> Head= ing not found on Level 1: ^M=0A> =0A> I am wondering if=A0 th= e exta ^M is causing this=0A> issue.=A0 I am using it=0A> on the windows wh= ich file encoding is unicode-dos.=0A ^^^^^^^^^=0AWindows is the cul= prit for the insertion of =0Athe ^M character=0A:-(=0A=0Agoogle is our fri= end:=0Ahttp://openacs.org/blog/one-entry?entry_id=3D297156=0A--------------= --------------------------=0ATo replace the annoying ^M characters you can = search and replace. The following representation holds true:=0A=0A^M =3D C-= q C-m=0A=0AResulating in this sequence:=0A=0AM-%=0AQuery replace: C-q C-m w= ith: C-q C-j=0A-------------=0AYou can write a function [2] that =0Are-sear= ch-forward ^M=0Areplace-match ""=0A=0Aand call this function in a pre-hook = =0Abefore importing.=0A=0ACarsten, is there such a pre-hook?=0A=0Acheers,= =0AGiovanni=0A=0A[2] google is again our friend ;-)=0A=0Ahttp://groups.goog= le.com/group/gnu.emacs.help/browse_thread/thread/676113e90825d4e7=0A=0AI us= e the following function to remove the trailing ^M from such files:=0A=0A(d= efun xsteve-remove-control-M ()=0A "Remove ^M at end of line in the whole = buffer."=0A (interactive)=0A (save-match-data=0A (save-excursion=0A = (let ((remove-count 0))=0A (goto-char (point-min))=0A (whi= le (re-search-forward " $" (point-max) t)=0A (setq remove-count (+= remove-count 1))=0A (replace-match "" nil nil))=0A (messag= e (format "%d ^M removed from buffer." remove-count)))))) =0A=0A=0A