From: Christian Schlauer <cs-muelleimer-rubbish.bin@arcor.de>
To: emacs-orgmode@gnu.org
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 [thread overview]
Message-ID: <f82the$oic$3@sea.gmane.org> (raw)
In-Reply-To: 17528d99cec250574f13485379496066@science.uva.nl
Carsten Dominik <dominik@science.uva.nl> 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.
`----
prev parent reply other threads:[~2007-07-23 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-15 20:51 PS file in org-mode distribution/auto-mode-alist and `$' Christian Schlauer
2007-07-16 6:50 ` Carsten Dominik
2007-07-23 18:54 ` Christian Schlauer [this message]
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='f82the$oic$3@sea.gmane.org' \
--to=cs-muelleimer-rubbish.bin@arcor.de \
--cc=cs-usenet@arcor.de \
--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).