all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: Is this comment in my .emacs correct?
Date: Fri, 20 Aug 2004 16:38:10 GMT	[thread overview]
Message-ID: <jwv3c2hbwkx.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: barmar-F593BF.20533819082004@comcast.dca.giganews.com

>> '("\\Makefile$" . makefile-mode)         )
[...]
> Not quite.  You'll get makefile mode for any pathname that contains the 
> string "\Makefile" in it.  So it will use this mode for something like 
> "C:\Data\Makefiles\README.txt", but not 
> "C:\Data\My_Makefiles\README.txt".

Still not quite: the string "\\Makefile$" turns into the regexp \Makefile$
but the `\M' is interpreted as just `M' (i.e. the backslash is ignored:
it should be flagged as an error, really).

> The $ matches the end of the pathname.

And it also matches a newline embedded in the pathname (e.g. if a file or
directory's name spans two or more lines).  Use the regexp operator \' if
you only want to match the end of the pathname.

So what the original regexp probably meant was: "\\\\Makefile\\'".
But note that Emacs will very often turn a \ into a / in your pathnames.
So maybe "[\\/]Makefile\\'" is better.

But in any case, there is already an entry

 ("\\(M\\|m\\|GNUm\\)akefile\\'" . makefile-mode)

in auto-mode-alist in not too ancient Emacsen, so you can simply remove the
whole thing from your .emacs file.


        Stefan

  reply	other threads:[~2004-08-20 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-20  0:09 Is this comment in my .emacs correct? William Payne
2004-08-20  0:53 ` Barry Margolin
2004-08-20 16:38   ` Stefan Monnier [this message]
2004-08-20 16:59     ` Eli Zaretskii
     [not found]     ` <mailman.2116.1093021754.2011.help-gnu-emacs@gnu.org>
2004-08-20 18:10       ` Stefan Monnier
2004-08-20 18:15         ` Eli Zaretskii
2004-08-20  9:58 ` maddog
2004-08-20 15:26 ` Kevin Rodgers
2004-08-20 16:18   ` William Payne

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv3c2hbwkx.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    /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 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.