From mboxrd@z Thu Jan 1 00:00:00 1970 From: Otto =?utf-8?b?UGljaGxow7ZmZXI=?= Subject: Re: Org-capture from Firefox: ^M or not ^M? Date: Wed, 20 Jul 2011 13:18:08 +0000 (UTC) Message-ID: References: <8062myo42x.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjYsh-0007lG-IW for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 11:40:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjYsa-0000pr-Fh for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 11:40:15 -0400 Received: from lo.gmane.org ([80.91.229.12]:34053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjYsZ-0000p0-Ut for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 11:40:08 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QjYsX-00027z-TK for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 17:40:06 +0200 Received: from pichlhoefer.allgmed.meduniwien.ac.at ([193.171.175.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Jul 2011 17:40:05 +0200 Received: from doc by pichlhoefer.allgmed.meduniwien.ac.at with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Jul 2011 17:40:05 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Sebastien Vauban 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