From: Giovanni Ridolfi <giovanni.ridolfi@yahoo.it>
To: emacs-orgmode@gnu.org, Zhichao Hong <zhichao.hong@gmail.com>,
Carsten Dominik <carsten.dominik@gmail.com>
Subject: Re: org-mobile-pull & ^M ( question)
Date: Fri, 6 Nov 2009 16:09:42 +0000 (GMT) [thread overview]
Message-ID: <37453.40370.qm@web28312.mail.ukl.yahoo.com> (raw)
In-Reply-To: <3fea10110911060749y40352f5ap3972736d1ac9755@mail.gmail.com>
--- Ven 6/11/09, Zhichao Hong <zhichao.hong@gmail.com> ha scritto:
> Heading not found on Level 1: <Some heading>^M
>
> I am wondering if the exta ^M is causing this
> issue. I am using it
> on the windows which file encoding is unicode-dos.
^^^^^^^^^
Windows is the culprit for the insertion of
the ^M character
:-(
google is our friend:
http://openacs.org/blog/one-entry?entry_id=297156
----------------------------------------
To replace the annoying ^M characters you can search and replace. The following representation holds true:
^M = C-q C-m
Resulating in this sequence:
M-%
Query replace: C-q C-m with: C-q C-j
-------------
You can write a function [2] that
re-search-forward ^M
replace-match ""
and call this function in a pre-hook
before importing.
Carsten, is there such a pre-hook?
cheers,
Giovanni
[2] google is again our friend ;-)
http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/676113e90825d4e7
I use the following function to remove the trailing ^M from such files:
(defun xsteve-remove-control-M ()
"Remove ^M at end of line in the whole buffer."
(interactive)
(save-match-data
(save-excursion
(let ((remove-count 0))
(goto-char (point-min))
(while (re-search-forward " $" (point-max) t)
(setq remove-count (+ remove-count 1))
(replace-match "" nil nil))
(message (format "%d ^M removed from buffer." remove-count))))))
next prev parent reply other threads:[~2009-11-06 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-06 15:49 org-mobile-pull question Zhichao Hong
2009-11-06 16:03 ` Carsten Dominik
2009-11-06 16:09 ` Giovanni Ridolfi [this message]
2009-11-06 16:45 ` org-mobile-pull & ^M ( question) Zhichao Hong
2009-11-06 17:47 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37453.40370.qm@web28312.mail.ukl.yahoo.com \
--to=giovanni.ridolfi@yahoo.it \
--cc=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=zhichao.hong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).