From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Schlauer Subject: OT: Newlines in file names (was: PS file in org-mode distribution/auto-mode-alist and `$') Date: Mon, 23 Jul 2007 20:54:54 +0200 Message-ID: References: <17528d99cec250574f13485379496066@science.uva.nl> Reply-To: cs-usenet@arcor.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ID38d-00088V-NC for emacs-orgmode@gnu.org; Mon, 23 Jul 2007 15:00:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ID38b-00088J-Mw for emacs-orgmode@gnu.org; Mon, 23 Jul 2007 15:00:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ID38b-00088G-HK for emacs-orgmode@gnu.org; Mon, 23 Jul 2007 15:00:09 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ID38b-0001gU-0H for emacs-orgmode@gnu.org; Mon, 23 Jul 2007 15:00:09 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1ID38U-0004j8-Mg for emacs-orgmode@gnu.org; Mon, 23 Jul 2007 21:00:02 +0200 Received: from finn.gmane.org ([80.91.229.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Jul 2007 21:00:02 +0200 Received: from cs-usenet by finn.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Jul 2007 21:00:02 +0200 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 Carsten Dominik writes: > On Jul 15, 2007, at 22:51, Christian Schlauer wrote: [...] >> ,---- >> | The "end of string" mark should be "\\'" rather than "$" (which >> | means "end of line"). >> `---- > > Well, $ means end of line, and if the string being tested > is a single line (as every single file name I have encountered > so far is) I agree with you -- I think it is extreeemely exotic, too, I only became aware of this when I read in the documentation of `find': ,----[ (info "(find)Print File Name") ] | If there is the faintest possibility that one of the files for which | you are searching might contain a newline, you should use `-print0' | instead. `---- Nevertheless, such file names are quite easy to create: `C-x C-f foo C-q C-j bar.txt'. > So while of course you have to be aware that $ can match somewhere > in the middle of a multiline string, I completely disagree that one > should not use use $ under such circumstances - it is such a nice > and compact way to write things (too many backslashes in Emacs > regular expressions anyway...). > > Anyway, as you point out, they do ask for this in the > documentation, so I'll play along. Thank you. Sorry for appearing to be nitpicking -- I only brought this up because I try to understand the elisp (and the regexps) that I put in my .emacs and the different styles used by different authors can be confusing: (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) Now, at least the regexp is the same. And I always use `add-to-list' because ,----[ C-h f add-to-list RET ] | (add-to-list LIST-VAR ELEMENT &optional APPEND COMPARE-FN) | | Add ELEMENT to the value of LIST-VAR if it isn't there yet. `----