* PS file in org-mode distribution/auto-mode-alist and `$'
@ 2007-07-15 20:51 Christian Schlauer
2007-07-16 6:50 ` Carsten Dominik
0 siblings, 1 reply; 3+ messages in thread
From: Christian Schlauer @ 2007-07-15 20:51 UTC (permalink / raw)
To: emacs-orgmode
Hi Carsten, hi list!
I noticed that orgcard_letter is included twice in the
zip-distribution:
org-5.03/orgcard_letter.pdf
org-5.03/orgcard_letter.ps
As you distribute only PDF files for the other documentation files, I
guess you didn't intend to include orgcard_letter.ps.
Another (tiny) thing: in (info "(org)Activation"), you write
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
Long ago, I had noticed that most other authors use \\' instead of $
in the above line (see for example C-h v auto-mode-alist RET).
Recently, Stefan Monnier wrote in a posting
<news:jwvtztg8wjn.fsf-monnier+gnu.emacs.help@gnu.org> the following
about adding to auto-mode-alist:
,----
| The "end of string" mark should be "\\'" rather than "$" (which
| means "end of line").
`----
I don't know if it really matters, but if you changed that in the
documentation it would be at least more consistent with what seems to
be "common practice" (and I wouldn't wonder "hmm -- why is this
different? ;-).
Regards,
Christian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PS file in org-mode distribution/auto-mode-alist and `$'
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 ` OT: Newlines in file names (was: PS file in org-mode distribution/auto-mode-alist and `$') Christian Schlauer
0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2007-07-16 6:50 UTC (permalink / raw)
To: cs-usenet; +Cc: emacs-orgmode
On Jul 15, 2007, at 22:51, Christian Schlauer wrote:
> Hi Carsten, hi list!
>
> I noticed that orgcard_letter is included twice in the
> zip-distribution:
>
> org-5.03/orgcard_letter.pdf
> org-5.03/orgcard_letter.ps
>
> As you distribute only PDF files for the other documentation files, I
> guess you didn't intend to include orgcard_letter.ps.
Yes, thanks.
>
> Another (tiny) thing: in (info "(org)Activation"), you write
>
> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
>
> Long ago, I had noticed that most other authors use \\' instead of $
> in the above line (see for example C-h v auto-mode-alist RET).
> Recently, Stefan Monnier wrote in a posting
> <news:jwvtztg8wjn.fsf-monnier+gnu.emacs.help@gnu.org> the following
> about adding to auto-mode-alist:
>
> ,----
> | 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), the end of the string is the end of a line, by
any reasonable definition. 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.
- Carsten
^ permalink raw reply [flat|nested] 3+ messages in thread
* OT: Newlines in file names (was: PS file in org-mode distribution/auto-mode-alist and `$')
2007-07-16 6:50 ` Carsten Dominik
@ 2007-07-23 18:54 ` Christian Schlauer
0 siblings, 0 replies; 3+ messages in thread
From: Christian Schlauer @ 2007-07-23 18:54 UTC (permalink / raw)
To: emacs-orgmode
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.
`----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-23 19:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` OT: Newlines in file names (was: PS file in org-mode distribution/auto-mode-alist and `$') Christian Schlauer
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.