* Auto-mode-alist, issue with regexp
@ 2009-05-22 16:32 Saptarshi
2009-05-22 16:43 ` Teemu Likonen
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Saptarshi @ 2009-05-22 16:32 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
I would like to open all files whose name starts with
"mail.google.com" in org-mode.
I tried,
1) --> (add-to-list 'auto-mode-alist '("^mail\\.google\\.com" . org-
mode))
and this doesn't work. Thinking something wrong with my regexp, i
tried to open all files whose name starts with "mail" in org mode,
2) --> (add-to-list 'auto-mode-alist '("^mail" . org-mode))
which also didn't work.
How do I get (1) to work?
Thank you in advance
Saptarshi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Auto-mode-alist, issue with regexp
2009-05-22 16:32 Auto-mode-alist, issue with regexp Saptarshi
@ 2009-05-22 16:43 ` Teemu Likonen
2009-05-22 16:53 ` Saptarshi
2009-05-22 17:08 ` Peter Dyballa
2009-05-22 17:14 ` Nikolaj Schumacher
2 siblings, 1 reply; 6+ messages in thread
From: Teemu Likonen @ 2009-05-22 16:43 UTC (permalink / raw)
To: help-gnu-emacs
On 2009-05-22 09:32 (-0700), Saptarshi wrote:
> I would like to open all files whose name starts with
> "mail.google.com" in org-mode.
> I tried,
> 1) --> (add-to-list 'auto-mode-alist '("^mail\\.google\\.com" . org-mode))
It has to match against full path name. I suggest you try this:
(add-to-list 'auto-mode-alist
'("/mail\\.google\\.com\\'" . org-mode))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Auto-mode-alist, issue with regexp
2009-05-22 16:43 ` Teemu Likonen
@ 2009-05-22 16:53 ` Saptarshi
0 siblings, 0 replies; 6+ messages in thread
From: Saptarshi @ 2009-05-22 16:53 UTC (permalink / raw)
To: help-gnu-emacs
>
> It has to match against full path name. I suggest you try this:
>
> (add-to-list 'auto-mode-alist
> '("/mail\\.google\\.com\\'" . org-mode))
Thank you, I tried this, but got a File Mode specification error:
(invalid-regexp "Trailing Backslash")
The file was called mail.google.com.23234
Emacs is 22.3.1
Thank you
Saptarshi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Auto-mode-alist, issue with regexp
2009-05-22 16:32 Auto-mode-alist, issue with regexp Saptarshi
2009-05-22 16:43 ` Teemu Likonen
@ 2009-05-22 17:08 ` Peter Dyballa
2009-05-22 17:14 ` Nikolaj Schumacher
2 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2009-05-22 17:08 UTC (permalink / raw)
To: Saptarshi; +Cc: help-gnu-emacs
Am 22.05.2009 um 18:32 schrieb Saptarshi:
> 1) --> (add-to-list 'auto-mode-alist '("^mail\\.google\\.com" . org-
> mode))
Presumingly the file's name does not start with ``mail´´ but with /
some/path/elements/to/mail....
Could you try it with ^ substituted by / ?
--
Greetings
Pete
Atheism is a non prophet organization.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Auto-mode-alist, issue with regexp
2009-05-22 16:32 Auto-mode-alist, issue with regexp Saptarshi
2009-05-22 16:43 ` Teemu Likonen
2009-05-22 17:08 ` Peter Dyballa
@ 2009-05-22 17:14 ` Nikolaj Schumacher
2009-05-22 17:19 ` Saptarshi Guha
2 siblings, 1 reply; 6+ messages in thread
From: Nikolaj Schumacher @ 2009-05-22 17:14 UTC (permalink / raw)
To: Saptarshi; +Cc: help-gnu-emacs
Saptarshi <saptarshi.guha@gmail.com> wrote:
> I would like to open all files whose name starts with
> "mail.google.com" in org-mode.
> I tried,
> 1) --> (add-to-list 'auto-mode-alist '("^mail\\.google\\.com" . org-
> mode))
The entire path is matched against the expression, so the ^ is the
problem. Try:
"/mail\\.google\\.com"
regards,
Nikolaj Schumacher
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Auto-mode-alist, issue with regexp
2009-05-22 17:14 ` Nikolaj Schumacher
@ 2009-05-22 17:19 ` Saptarshi Guha
0 siblings, 0 replies; 6+ messages in thread
From: Saptarshi Guha @ 2009-05-22 17:19 UTC (permalink / raw)
To: Nikolaj Schumacher; +Cc: help-gnu-emacs
Perfect. Thank you to everybody. The explanation helped me understand
where I was going wrong.
I'm using ItsAllText firefox extension to compose replies/messages
from GMAIL in Aquamacs. ItsAllText opens aquamacs with a file name
like mail.google.com.[A-Za-z0-9]+.txt which i would ultimately like to
open in message mode.
Thanks again
Regards
Saptarshi Guha
On Fri, May 22, 2009 at 1:14 PM, Nikolaj Schumacher <me@nschum.de> wrote:
> Saptarshi <saptarshi.guha@gmail.com> wrote:
>
>> I would like to open all files whose name starts with
>> "mail.google.com" in org-mode.
>> I tried,
>> 1) --> (add-to-list 'auto-mode-alist '("^mail\\.google\\.com" . org-
>> mode))
>
> The entire path is matched against the expression, so the ^ is the
> problem. Try:
>
> "/mail\\.google\\.com"
>
>
> regards,
> Nikolaj Schumacher
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-22 17:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 16:32 Auto-mode-alist, issue with regexp Saptarshi
2009-05-22 16:43 ` Teemu Likonen
2009-05-22 16:53 ` Saptarshi
2009-05-22 17:08 ` Peter Dyballa
2009-05-22 17:14 ` Nikolaj Schumacher
2009-05-22 17:19 ` Saptarshi Guha
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).