From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Error on http://www.gnu.org/software/emacs/elisp/html_node/Auto-Major-Mode.html Date: Tue, 25 Nov 2008 06:17:59 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <3f5924ac-1b17-4a12-82a0-d84340ede46c@v13g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1227628556 30444 80.91.229.12 (25 Nov 2008 15:55:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2008 15:55:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 25 16:56:58 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L50HZ-0001AI-9D for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Nov 2008 16:56:57 +0100 Original-Received: from localhost ([127.0.0.1]:47517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L50GP-0005Yo-Mo for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Nov 2008 10:55:45 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!t39g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 53 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1227622679 28971 127.0.0.1 (25 Nov 2008 14:17:59 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 25 Nov 2008 14:17:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t39g2000prh.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.26.2 (KHTML, like Gecko) Version/3.2 Safari/525.26.12, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164763 comp.emacs:97389 X-Mailman-Approved-At: Tue, 25 Nov 2008 10:53:01 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60095 Archived-At: On Nov 24, 6:47 am, Decebal wrote: > On this page there is the following code: > (setq auto-mode-alist > (append > ;; File name (within directory) starts with a dot. > '(("/\\.[^/]*\\'" . fundamental-mode) > ;; File name has no dot. > ("[^\\./]*\\'" . fundamental-mode) > ;; File name ends in `.C'. > ("\\.C\\'" . c++-mode)) > auto-mode-alist)) > > But the rule for a file name without a dot should be: > ("/[^\\./]*\\'" . fundamental-mode) > > Where should I tell this so that the error could be modified? Do Alt+x report-emacs-bug. > Also on some places end of the filename is written like \\' and on > other places like $. What is the difference between those two? =E2=80=A2 How To Install Emacs Packages http://xahlee.org/emacs/emacs_installing_packages.html Quote: =C2=AB (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) Note: The double backslash in the string =E2=80=9C\\.js\\'=E2=80=9D is used= to escape the backslash. So, the regex engine just got =E2=80=9C\.js\'=E2=80=9D. The = =E2=80=9C\.=E2=80=9D is to match a period. The =E2=80=9C\'=E2=80=9D is one of emacs special regex synt= ax, to match end of a string. =C2=BB See: =E2=80=A2 Regexp Backslash - GNU Emacs Lisp Reference Manual http://xahlee.org/elisp/Regexp-Backslash.html Strictly speaking, using =E2=80=9C\=E2=80=9D is more proper, but often =E2= =80=9C$=E2=80=9D works too unless the file name contains newline char. (thanks to Barry who explained this earlier here) Xah =E2=88=91 http://xahlee.org/ =E2=98=84