From: "Otto Pichlhöfer" <doc@nordrandklinik.at>
To: emacs-orgmode@gnu.org
Subject: Re: Org-capture from Firefox: ^M or not ^M?
Date: Wed, 20 Jul 2011 13:18:08 +0000 (UTC) [thread overview]
Message-ID: <loom.20110720T151442-696@post.gmane.org> (raw)
In-Reply-To: 8062myo42x.fsf@somewhere.org
Sebastien Vauban <wxhgmqzgwmuf@...> writes:
>
> Hello,
>
> In the exact same conditions (I mean, Emacs settings, etc.), when I capture
> some regions from Web pages, they sometimes:
>
> - are mixed "all one one line"
> Example: http://lists.gnu.org/archive/html/help-gnu-emacs/2007-03/msg00670.html
>
> - are copied as on the screen, but with ending ^M at every line
> Example: http://www.emacswiki.org/emacs/DiaryMode
>
> I'm not sure anymore whether or when it is correct:
> - region on multiple lines (as on the screen), and
> - no ending ^M...
>
> Questions:
>
> - Do you see the same behavior as mine? I'm on Windows XP with Firefox
> 3.6.18.
>
> - Is there some work around so that you would not have to fiddle with the
> copied text?
>
> Best regards,
> Seb
>
I do this:
(defun remove-ctrl-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))
(point-max) t) ; so passt es nur am Ende der Zeile
(while (re-search-forward (char-to-string 13) (point-max) t)
(setq remove-count (+ remove-count 1))
(replace-match "" nil nil))
(message (format "%d ^M removed from buffer." remove-count))))))
and:
(add-hook 'org-capture-mode-hook 'remove-ctrl-M)
Regards,
Otto
next prev parent reply other threads:[~2011-07-20 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 12:19 Org-capture from Firefox: ^M or not ^M? Sebastien Vauban
2011-07-20 13:18 ` Otto Pichlhöfer [this message]
2011-07-20 19:23 ` Sebastien Vauban
2011-07-20 21:59 ` Sebastien Vauban
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=loom.20110720T151442-696@post.gmane.org \
--to=doc@nordrandklinik.at \
--cc=emacs-orgmode@gnu.org \
/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).